diff --git a/README.md b/README.md index aa4353d..802396f 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,13 @@ # gate-api -Welcome to Gate.io API - -APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. +Welcome to Gate API +APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 4.22.4 -- Package version: 4.22.4 +- API version: v4.105.8 +- Package version: 7.1.8 - Build package: org.openapitools.codegen.languages.PythonClientCodegen -For more information, please visit [https://www.gate.io/page/contacts](https://www.gate.io/page/contacts) +For more information, please visit [https://www.gate.com/page/contacts](https://www.gate.com/page/contacts) ## Versioning @@ -85,17 +84,16 @@ configuration = gate_api.Configuration( api_client = gate_api.ApiClient(configuration) # Create an instance of the API class -api_instance = gate_api.DeliveryApi(api_client) -settle = 'usdt' # str | Settle currency +api_instance = gate_api.EarnUniApi(api_client) try: - # List all futures contracts - api_response = api_instance.list_delivery_contracts(settle) + # Query lending currency list + api_response = api_instance.list_uni_currencies() 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 DeliveryApi->list_delivery_contracts: %s\n" % e) + print("Exception when calling EarnUniApi->list_uni_currencies: %s\n" % e) ``` @@ -107,211 +105,546 @@ All URIs are relative to *https://api.gateio.ws/api/v4* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*DeliveryApi* | [**list_delivery_contracts**](docs/DeliveryApi.md#list_delivery_contracts) | **GET** /delivery/{settle}/contracts | List all futures contracts -*DeliveryApi* | [**get_delivery_contract**](docs/DeliveryApi.md#get_delivery_contract) | **GET** /delivery/{settle}/contracts/{contract} | Get a single contract -*DeliveryApi* | [**list_delivery_order_book**](docs/DeliveryApi.md#list_delivery_order_book) | **GET** /delivery/{settle}/order_book | Futures order book -*DeliveryApi* | [**list_delivery_trades**](docs/DeliveryApi.md#list_delivery_trades) | **GET** /delivery/{settle}/trades | Futures trading history -*DeliveryApi* | [**list_delivery_candlesticks**](docs/DeliveryApi.md#list_delivery_candlesticks) | **GET** /delivery/{settle}/candlesticks | Get futures candlesticks -*DeliveryApi* | [**list_delivery_tickers**](docs/DeliveryApi.md#list_delivery_tickers) | **GET** /delivery/{settle}/tickers | List futures tickers -*DeliveryApi* | [**list_delivery_insurance_ledger**](docs/DeliveryApi.md#list_delivery_insurance_ledger) | **GET** /delivery/{settle}/insurance | Futures insurance balance history -*DeliveryApi* | [**list_delivery_accounts**](docs/DeliveryApi.md#list_delivery_accounts) | **GET** /delivery/{settle}/accounts | Query futures account -*DeliveryApi* | [**list_delivery_account_book**](docs/DeliveryApi.md#list_delivery_account_book) | **GET** /delivery/{settle}/account_book | Query account book -*DeliveryApi* | [**list_delivery_positions**](docs/DeliveryApi.md#list_delivery_positions) | **GET** /delivery/{settle}/positions | List all positions of a user -*DeliveryApi* | [**get_delivery_position**](docs/DeliveryApi.md#get_delivery_position) | **GET** /delivery/{settle}/positions/{contract} | Get single position +*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 +*EarnUniApi* | [**create_uni_lend**](docs/EarnUniApi.md#create_uni_lend) | **POST** /earn/uni/lends | Create lending or redemption +*EarnUniApi* | [**change_uni_lend**](docs/EarnUniApi.md#change_uni_lend) | **PATCH** /earn/uni/lends | Amend user lending information +*EarnUniApi* | [**list_uni_lend_records**](docs/EarnUniApi.md#list_uni_lend_records) | **GET** /earn/uni/lend_records | Query lending transaction records +*EarnUniApi* | [**get_uni_interest**](docs/EarnUniApi.md#get_uni_interest) | **GET** /earn/uni/interests/{currency} | Query user's total interest income for specified currency +*EarnUniApi* | [**list_uni_interest_records**](docs/EarnUniApi.md#list_uni_interest_records) | **GET** /earn/uni/interest_records | Query user dividend records +*EarnUniApi* | [**get_uni_interest_status**](docs/EarnUniApi.md#get_uni_interest_status) | **GET** /earn/uni/interest_status/{currency} | Query currency interest compounding status +*EarnUniApi* | [**list_uni_chart**](docs/EarnUniApi.md#list_uni_chart) | **GET** /earn/uni/chart | UniLoan currency annualized trend chart +*EarnUniApi* | [**list_uni_rate**](docs/EarnUniApi.md#list_uni_rate) | **GET** /earn/uni/rate | Currency estimated annualized interest rate +*MarginUniApi* | [**list_uni_currency_pairs**](docs/MarginUniApi.md#list_uni_currency_pairs) | **GET** /margin/uni/currency_pairs | List lending markets +*MarginUniApi* | [**get_uni_currency_pair**](docs/MarginUniApi.md#get_uni_currency_pair) | **GET** /margin/uni/currency_pairs/{currency_pair} | Get lending market details +*MarginUniApi* | [**get_margin_uni_estimate_rate**](docs/MarginUniApi.md#get_margin_uni_estimate_rate) | **GET** /margin/uni/estimate_rate | Estimate interest rate for isolated margin currencies +*MarginUniApi* | [**list_uni_loans**](docs/MarginUniApi.md#list_uni_loans) | **GET** /margin/uni/loans | Query loans +*MarginUniApi* | [**create_uni_loan**](docs/MarginUniApi.md#create_uni_loan) | **POST** /margin/uni/loans | Borrow or repay +*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 +*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 +*SubAccountApi* | [**list_sub_account_keys**](docs/SubAccountApi.md#list_sub_account_keys) | **GET** /sub_accounts/{user_id}/keys | List all API key pairs of the sub-account +*SubAccountApi* | [**create_sub_account_keys**](docs/SubAccountApi.md#create_sub_account_keys) | **POST** /sub_accounts/{user_id}/keys | Create new sub-account API key pair +*SubAccountApi* | [**get_sub_account_key**](docs/SubAccountApi.md#get_sub_account_key) | **GET** /sub_accounts/{user_id}/keys/{key} | Get specific API key pair of the sub-account +*SubAccountApi* | [**update_sub_account_keys**](docs/SubAccountApi.md#update_sub_account_keys) | **PUT** /sub_accounts/{user_id}/keys/{key} | Update sub-account API key pair +*SubAccountApi* | [**delete_sub_account_keys**](docs/SubAccountApi.md#delete_sub_account_keys) | **DELETE** /sub_accounts/{user_id}/keys/{key} | Delete sub-account API key pair +*SubAccountApi* | [**lock_sub_account**](docs/SubAccountApi.md#lock_sub_account) | **POST** /sub_accounts/{user_id}/lock | Lock sub-account +*SubAccountApi* | [**unlock_sub_account**](docs/SubAccountApi.md#unlock_sub_account) | **POST** /sub_accounts/{user_id}/unlock | Unlock sub-account +*SubAccountApi* | [**list_unified_mode**](docs/SubAccountApi.md#list_unified_mode) | **GET** /sub_accounts/unified_mode | Get sub-account mode +*UnifiedApi* | [**list_unified_accounts**](docs/UnifiedApi.md#list_unified_accounts) | **GET** /unified/accounts | Get unified account information +*UnifiedApi* | [**get_unified_borrowable**](docs/UnifiedApi.md#get_unified_borrowable) | **GET** /unified/borrowable | Query maximum borrowable amount for unified account +*UnifiedApi* | [**get_unified_transferable**](docs/UnifiedApi.md#get_unified_transferable) | **GET** /unified/transferable | Query maximum transferable amount for unified account +*UnifiedApi* | [**get_unified_transferables**](docs/UnifiedApi.md#get_unified_transferables) | **GET** /unified/transferables | Batch query maximum transferable amount for unified accounts. Each currency shows the maximum value. After user withdrawal, the transferable amount for all currencies will change +*UnifiedApi* | [**get_unified_borrowable_list**](docs/UnifiedApi.md#get_unified_borrowable_list) | **GET** /unified/batch_borrowable | Batch query unified account maximum borrowable amount +*UnifiedApi* | [**list_unified_loans**](docs/UnifiedApi.md#list_unified_loans) | **GET** /unified/loans | Query loans +*UnifiedApi* | [**create_unified_loan**](docs/UnifiedApi.md#create_unified_loan) | **POST** /unified/loans | Borrow or repay +*UnifiedApi* | [**list_unified_loan_records**](docs/UnifiedApi.md#list_unified_loan_records) | **GET** /unified/loan_records | Query loan records +*UnifiedApi* | [**list_unified_loan_interest_records**](docs/UnifiedApi.md#list_unified_loan_interest_records) | **GET** /unified/interest_records | Query interest deduction records +*UnifiedApi* | [**get_unified_risk_units**](docs/UnifiedApi.md#get_unified_risk_units) | **GET** /unified/risk_units | Get user risk unit details +*UnifiedApi* | [**get_unified_mode**](docs/UnifiedApi.md#get_unified_mode) | **GET** /unified/unified_mode | Query mode of the unified account +*UnifiedApi* | [**set_unified_mode**](docs/UnifiedApi.md#set_unified_mode) | **PUT** /unified/unified_mode | Set unified account mode +*UnifiedApi* | [**get_unified_estimate_rate**](docs/UnifiedApi.md#get_unified_estimate_rate) | **GET** /unified/estimate_rate | Query unified account estimated interest rate +*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* | [**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 +*AccountApi* | [**get_account_detail**](docs/AccountApi.md#get_account_detail) | **GET** /account/detail | Retrieve user account information +*AccountApi* | [**get_account_rate_limit**](docs/AccountApi.md#get_account_rate_limit) | **GET** /account/rate_limit | Get user transaction rate limit information +*AccountApi* | [**list_stp_groups**](docs/AccountApi.md#list_stp_groups) | **GET** /account/stp_groups | Query STP user groups created by the user +*AccountApi* | [**create_stp_group**](docs/AccountApi.md#create_stp_group) | **POST** /account/stp_groups | Create STP user group +*AccountApi* | [**list_stp_groups_users**](docs/AccountApi.md#list_stp_groups_users) | **GET** /account/stp_groups/{stp_id}/users | Query users in the STP user group +*AccountApi* | [**add_stp_group_users**](docs/AccountApi.md#add_stp_group_users) | **POST** /account/stp_groups/{stp_id}/users | Add users to the STP user group +*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 +*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 +*DeliveryApi* | [**list_delivery_trades**](docs/DeliveryApi.md#list_delivery_trades) | **GET** /delivery/{settle}/trades | Futures market transaction records +*DeliveryApi* | [**list_delivery_candlesticks**](docs/DeliveryApi.md#list_delivery_candlesticks) | **GET** /delivery/{settle}/candlesticks | Futures market K-line chart +*DeliveryApi* | [**list_delivery_tickers**](docs/DeliveryApi.md#list_delivery_tickers) | **GET** /delivery/{settle}/tickers | Get all futures trading statistics +*DeliveryApi* | [**list_delivery_insurance_ledger**](docs/DeliveryApi.md#list_delivery_insurance_ledger) | **GET** /delivery/{settle}/insurance | Futures market insurance fund history +*DeliveryApi* | [**list_delivery_accounts**](docs/DeliveryApi.md#list_delivery_accounts) | **GET** /delivery/{settle}/accounts | Get futures account +*DeliveryApi* | [**list_delivery_account_book**](docs/DeliveryApi.md#list_delivery_account_book) | **GET** /delivery/{settle}/account_book | Query futures account change history +*DeliveryApi* | [**list_delivery_positions**](docs/DeliveryApi.md#list_delivery_positions) | **GET** /delivery/{settle}/positions | Get user position list +*DeliveryApi* | [**get_delivery_position**](docs/DeliveryApi.md#get_delivery_position) | **GET** /delivery/{settle}/positions/{contract} | Get single position information *DeliveryApi* | [**update_delivery_position_margin**](docs/DeliveryApi.md#update_delivery_position_margin) | **POST** /delivery/{settle}/positions/{contract}/margin | Update position margin *DeliveryApi* | [**update_delivery_position_leverage**](docs/DeliveryApi.md#update_delivery_position_leverage) | **POST** /delivery/{settle}/positions/{contract}/leverage | Update position leverage *DeliveryApi* | [**update_delivery_position_risk_limit**](docs/DeliveryApi.md#update_delivery_position_risk_limit) | **POST** /delivery/{settle}/positions/{contract}/risk_limit | Update position risk limit -*DeliveryApi* | [**list_delivery_orders**](docs/DeliveryApi.md#list_delivery_orders) | **GET** /delivery/{settle}/orders | List futures orders -*DeliveryApi* | [**create_delivery_order**](docs/DeliveryApi.md#create_delivery_order) | **POST** /delivery/{settle}/orders | Create a futures order -*DeliveryApi* | [**cancel_delivery_orders**](docs/DeliveryApi.md#cancel_delivery_orders) | **DELETE** /delivery/{settle}/orders | Cancel all `open` orders matched -*DeliveryApi* | [**get_delivery_order**](docs/DeliveryApi.md#get_delivery_order) | **GET** /delivery/{settle}/orders/{order_id} | Get a single order -*DeliveryApi* | [**cancel_delivery_order**](docs/DeliveryApi.md#cancel_delivery_order) | **DELETE** /delivery/{settle}/orders/{order_id} | Cancel a single order -*DeliveryApi* | [**get_my_delivery_trades**](docs/DeliveryApi.md#get_my_delivery_trades) | **GET** /delivery/{settle}/my_trades | List personal trading history -*DeliveryApi* | [**list_delivery_position_close**](docs/DeliveryApi.md#list_delivery_position_close) | **GET** /delivery/{settle}/position_close | List position close history -*DeliveryApi* | [**list_delivery_liquidates**](docs/DeliveryApi.md#list_delivery_liquidates) | **GET** /delivery/{settle}/liquidates | List liquidation history -*DeliveryApi* | [**list_delivery_settlements**](docs/DeliveryApi.md#list_delivery_settlements) | **GET** /delivery/{settle}/settlements | List settlement history -*DeliveryApi* | [**list_price_triggered_delivery_orders**](docs/DeliveryApi.md#list_price_triggered_delivery_orders) | **GET** /delivery/{settle}/price_orders | List all auto orders -*DeliveryApi* | [**create_price_triggered_delivery_order**](docs/DeliveryApi.md#create_price_triggered_delivery_order) | **POST** /delivery/{settle}/price_orders | Create a price-triggered order -*DeliveryApi* | [**cancel_price_triggered_delivery_order_list**](docs/DeliveryApi.md#cancel_price_triggered_delivery_order_list) | **DELETE** /delivery/{settle}/price_orders | Cancel all open orders -*DeliveryApi* | [**get_price_triggered_delivery_order**](docs/DeliveryApi.md#get_price_triggered_delivery_order) | **GET** /delivery/{settle}/price_orders/{order_id} | Get a single order -*DeliveryApi* | [**cancel_price_triggered_delivery_order**](docs/DeliveryApi.md#cancel_price_triggered_delivery_order) | **DELETE** /delivery/{settle}/price_orders/{order_id} | Cancel a single order -*FuturesApi* | [**list_futures_contracts**](docs/FuturesApi.md#list_futures_contracts) | **GET** /futures/{settle}/contracts | List all futures contracts -*FuturesApi* | [**get_futures_contract**](docs/FuturesApi.md#get_futures_contract) | **GET** /futures/{settle}/contracts/{contract} | Get a single contract -*FuturesApi* | [**list_futures_order_book**](docs/FuturesApi.md#list_futures_order_book) | **GET** /futures/{settle}/order_book | Futures order book -*FuturesApi* | [**list_futures_trades**](docs/FuturesApi.md#list_futures_trades) | **GET** /futures/{settle}/trades | Futures trading history -*FuturesApi* | [**list_futures_candlesticks**](docs/FuturesApi.md#list_futures_candlesticks) | **GET** /futures/{settle}/candlesticks | Get futures candlesticks -*FuturesApi* | [**list_futures_tickers**](docs/FuturesApi.md#list_futures_tickers) | **GET** /futures/{settle}/tickers | List futures tickers -*FuturesApi* | [**list_futures_funding_rate_history**](docs/FuturesApi.md#list_futures_funding_rate_history) | **GET** /futures/{settle}/funding_rate | Funding rate history -*FuturesApi* | [**list_futures_insurance_ledger**](docs/FuturesApi.md#list_futures_insurance_ledger) | **GET** /futures/{settle}/insurance | Futures insurance balance history -*FuturesApi* | [**list_contract_stats**](docs/FuturesApi.md#list_contract_stats) | **GET** /futures/{settle}/contract_stats | Futures stats -*FuturesApi* | [**list_liquidated_orders**](docs/FuturesApi.md#list_liquidated_orders) | **GET** /futures/{settle}/liq_orders | Retrieve liquidation history -*FuturesApi* | [**list_futures_accounts**](docs/FuturesApi.md#list_futures_accounts) | **GET** /futures/{settle}/accounts | Query futures account -*FuturesApi* | [**list_futures_account_book**](docs/FuturesApi.md#list_futures_account_book) | **GET** /futures/{settle}/account_book | Query account book -*FuturesApi* | [**list_positions**](docs/FuturesApi.md#list_positions) | **GET** /futures/{settle}/positions | List all positions of a user -*FuturesApi* | [**get_position**](docs/FuturesApi.md#get_position) | **GET** /futures/{settle}/positions/{contract} | Get single position +*DeliveryApi* | [**list_delivery_orders**](docs/DeliveryApi.md#list_delivery_orders) | **GET** /delivery/{settle}/orders | Query futures order list +*DeliveryApi* | [**create_delivery_order**](docs/DeliveryApi.md#create_delivery_order) | **POST** /delivery/{settle}/orders | Place futures order +*DeliveryApi* | [**cancel_delivery_orders**](docs/DeliveryApi.md#cancel_delivery_orders) | **DELETE** /delivery/{settle}/orders | Cancel all orders with 'open' status +*DeliveryApi* | [**get_delivery_order**](docs/DeliveryApi.md#get_delivery_order) | **GET** /delivery/{settle}/orders/{order_id} | Query single order details +*DeliveryApi* | [**cancel_delivery_order**](docs/DeliveryApi.md#cancel_delivery_order) | **DELETE** /delivery/{settle}/orders/{order_id} | Cancel single order +*DeliveryApi* | [**get_my_delivery_trades**](docs/DeliveryApi.md#get_my_delivery_trades) | **GET** /delivery/{settle}/my_trades | Query personal trading records +*DeliveryApi* | [**list_delivery_position_close**](docs/DeliveryApi.md#list_delivery_position_close) | **GET** /delivery/{settle}/position_close | Query position close history +*DeliveryApi* | [**list_delivery_liquidates**](docs/DeliveryApi.md#list_delivery_liquidates) | **GET** /delivery/{settle}/liquidates | Query liquidation history +*DeliveryApi* | [**list_delivery_settlements**](docs/DeliveryApi.md#list_delivery_settlements) | **GET** /delivery/{settle}/settlements | Query settlement records +*DeliveryApi* | [**list_delivery_risk_limit_tiers**](docs/DeliveryApi.md#list_delivery_risk_limit_tiers) | **GET** /delivery/{settle}/risk_limit_tiers | Query risk limit tiers +*DeliveryApi* | [**list_price_triggered_delivery_orders**](docs/DeliveryApi.md#list_price_triggered_delivery_orders) | **GET** /delivery/{settle}/price_orders | Query auto order list +*DeliveryApi* | [**create_price_triggered_delivery_order**](docs/DeliveryApi.md#create_price_triggered_delivery_order) | **POST** /delivery/{settle}/price_orders | Create price-triggered order +*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 | ETH2 swap +*EarnApi* | [**rate_list_eth2**](docs/EarnApi.md#rate_list_eth2) | **GET** /earn/staking/eth2/rate_records | ETH2 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* | [**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 +*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 +*FuturesApi* | [**list_futures_contracts**](docs/FuturesApi.md#list_futures_contracts) | **GET** /futures/{settle}/contracts | Query all futures contracts +*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 +*FuturesApi* | [**list_futures_candlesticks**](docs/FuturesApi.md#list_futures_candlesticks) | **GET** /futures/{settle}/candlesticks | Futures market K-line chart +*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_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 +*FuturesApi* | [**list_liquidated_orders**](docs/FuturesApi.md#list_liquidated_orders) | **GET** /futures/{settle}/liq_orders | Query liquidation order history +*FuturesApi* | [**list_futures_risk_limit_tiers**](docs/FuturesApi.md#list_futures_risk_limit_tiers) | **GET** /futures/{settle}/risk_limit_tiers | Query risk limit tiers +*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* | [**get_position**](docs/FuturesApi.md#get_position) | **GET** /futures/{settle}/positions/{contract} | Get single position information *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_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 | Enable or disable dual mode -*FuturesApi* | [**get_dual_mode_position**](docs/FuturesApi.md#get_dual_mode_position) | **GET** /futures/{settle}/dual_comp/positions/{contract} | Retrieve position detail in dual mode +*FuturesApi* | [**set_dual_mode**](docs/FuturesApi.md#set_dual_mode) | **POST** /futures/{settle}/dual_mode | Set position mode +*FuturesApi* | [**get_dual_mode_position**](docs/FuturesApi.md#get_dual_mode_position) | **GET** /futures/{settle}/dual_comp/positions/{contract} | Get position information in dual 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 dual 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 dual mode *FuturesApi* | [**update_dual_mode_position_risk_limit**](docs/FuturesApi.md#update_dual_mode_position_risk_limit) | **POST** /futures/{settle}/dual_comp/positions/{contract}/risk_limit | Update position risk limit in dual mode -*FuturesApi* | [**list_futures_orders**](docs/FuturesApi.md#list_futures_orders) | **GET** /futures/{settle}/orders | List futures orders -*FuturesApi* | [**create_futures_order**](docs/FuturesApi.md#create_futures_order) | **POST** /futures/{settle}/orders | Create a futures order -*FuturesApi* | [**cancel_futures_orders**](docs/FuturesApi.md#cancel_futures_orders) | **DELETE** /futures/{settle}/orders | Cancel all `open` orders matched -*FuturesApi* | [**get_futures_order**](docs/FuturesApi.md#get_futures_order) | **GET** /futures/{settle}/orders/{order_id} | Get a single order -*FuturesApi* | [**cancel_futures_order**](docs/FuturesApi.md#cancel_futures_order) | **DELETE** /futures/{settle}/orders/{order_id} | Cancel a single order -*FuturesApi* | [**get_my_trades**](docs/FuturesApi.md#get_my_trades) | **GET** /futures/{settle}/my_trades | List personal trading history -*FuturesApi* | [**list_position_close**](docs/FuturesApi.md#list_position_close) | **GET** /futures/{settle}/position_close | List position close history -*FuturesApi* | [**list_liquidates**](docs/FuturesApi.md#list_liquidates) | **GET** /futures/{settle}/liquidates | List liquidation history -*FuturesApi* | [**list_price_triggered_orders**](docs/FuturesApi.md#list_price_triggered_orders) | **GET** /futures/{settle}/price_orders | List all auto orders -*FuturesApi* | [**create_price_triggered_order**](docs/FuturesApi.md#create_price_triggered_order) | **POST** /futures/{settle}/price_orders | Create a price-triggered order -*FuturesApi* | [**cancel_price_triggered_order_list**](docs/FuturesApi.md#cancel_price_triggered_order_list) | **DELETE** /futures/{settle}/price_orders | Cancel all open orders -*FuturesApi* | [**get_price_triggered_order**](docs/FuturesApi.md#get_price_triggered_order) | **GET** /futures/{settle}/price_orders/{order_id} | Get a single order -*FuturesApi* | [**cancel_price_triggered_order**](docs/FuturesApi.md#cancel_price_triggered_order) | **DELETE** /futures/{settle}/price_orders/{order_id} | Cancel a single order -*MarginApi* | [**list_margin_currency_pairs**](docs/MarginApi.md#list_margin_currency_pairs) | **GET** /margin/currency_pairs | List all supported currency pairs supported in margin trading -*MarginApi* | [**get_margin_currency_pair**](docs/MarginApi.md#get_margin_currency_pair) | **GET** /margin/currency_pairs/{currency_pair} | Query one single margin currency pair -*MarginApi* | [**list_funding_book**](docs/MarginApi.md#list_funding_book) | **GET** /margin/funding_book | Order book of lending loans +*FuturesApi* | [**list_futures_orders**](docs/FuturesApi.md#list_futures_orders) | **GET** /futures/{settle}/orders | Query futures order list +*FuturesApi* | [**create_futures_order**](docs/FuturesApi.md#create_futures_order) | **POST** /futures/{settle}/orders | Place futures order +*FuturesApi* | [**cancel_futures_orders**](docs/FuturesApi.md#cancel_futures_orders) | **DELETE** /futures/{settle}/orders | Cancel all orders with 'open' status +*FuturesApi* | [**get_orders_with_time_range**](docs/FuturesApi.md#get_orders_with_time_range) | **GET** /futures/{settle}/orders_timerange | Query futures order list by time range +*FuturesApi* | [**create_batch_futures_order**](docs/FuturesApi.md#create_batch_futures_order) | **POST** /futures/{settle}/batch_orders | Place batch futures orders +*FuturesApi* | [**get_futures_order**](docs/FuturesApi.md#get_futures_order) | **GET** /futures/{settle}/orders/{order_id} | Query single order details +*FuturesApi* | [**amend_futures_order**](docs/FuturesApi.md#amend_futures_order) | **PUT** /futures/{settle}/orders/{order_id} | Amend single order +*FuturesApi* | [**cancel_futures_order**](docs/FuturesApi.md#cancel_futures_order) | **DELETE** /futures/{settle}/orders/{order_id} | Cancel single order +*FuturesApi* | [**get_my_trades**](docs/FuturesApi.md#get_my_trades) | **GET** /futures/{settle}/my_trades | Query personal trading records +*FuturesApi* | [**get_my_trades_with_time_range**](docs/FuturesApi.md#get_my_trades_with_time_range) | **GET** /futures/{settle}/my_trades_timerange | Query personal trading records by time range +*FuturesApi* | [**list_position_close**](docs/FuturesApi.md#list_position_close) | **GET** /futures/{settle}/position_close | Query position close history +*FuturesApi* | [**list_liquidates**](docs/FuturesApi.md#list_liquidates) | **GET** /futures/{settle}/liquidates | Query liquidation history +*FuturesApi* | [**list_auto_deleverages**](docs/FuturesApi.md#list_auto_deleverages) | **GET** /futures/{settle}/auto_deleverages | Query ADL auto-deleveraging order information +*FuturesApi* | [**countdown_cancel_all_futures**](docs/FuturesApi.md#countdown_cancel_all_futures) | **POST** /futures/{settle}/countdown_cancel_all | Countdown cancel orders +*FuturesApi* | [**get_futures_fee**](docs/FuturesApi.md#get_futures_fee) | **GET** /futures/{settle}/fee | Query futures market trading fee rates +*FuturesApi* | [**cancel_batch_future_orders**](docs/FuturesApi.md#cancel_batch_future_orders) | **POST** /futures/{settle}/batch_cancel_orders | Cancel batch orders by specified ID list +*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* | [**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* | [**cancel_price_triggered_order**](docs/FuturesApi.md#cancel_price_triggered_order) | **DELETE** /futures/{settle}/price_orders/{order_id} | Cancel 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 | List margin account balance change history +*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 -*MarginApi* | [**list_loans**](docs/MarginApi.md#list_loans) | **GET** /margin/loans | List all loans -*MarginApi* | [**create_loan**](docs/MarginApi.md#create_loan) | **POST** /margin/loans | Lend or borrow -*MarginApi* | [**merge_loans**](docs/MarginApi.md#merge_loans) | **POST** /margin/merged_loans | Merge multiple lending loans -*MarginApi* | [**get_loan**](docs/MarginApi.md#get_loan) | **GET** /margin/loans/{loan_id} | Retrieve one single loan detail -*MarginApi* | [**cancel_loan**](docs/MarginApi.md#cancel_loan) | **DELETE** /margin/loans/{loan_id} | Cancel lending loan -*MarginApi* | [**update_loan**](docs/MarginApi.md#update_loan) | **PATCH** /margin/loans/{loan_id} | Modify a loan -*MarginApi* | [**list_loan_repayments**](docs/MarginApi.md#list_loan_repayments) | **GET** /margin/loans/{loan_id}/repayment | List loan repayment records -*MarginApi* | [**repay_loan**](docs/MarginApi.md#repay_loan) | **POST** /margin/loans/{loan_id}/repayment | Repay a loan -*MarginApi* | [**list_loan_records**](docs/MarginApi.md#list_loan_records) | **GET** /margin/loan_records | List repayment records of a specific loan -*MarginApi* | [**get_loan_record**](docs/MarginApi.md#get_loan_record) | **GET** /margin/loan_records/{loan_record_id} | Get one single loan record -*MarginApi* | [**update_loan_record**](docs/MarginApi.md#update_loan_record) | **PATCH** /margin/loan_records/{loan_record_id} | Modify a loan record -*MarginApi* | [**get_auto_repay_status**](docs/MarginApi.md#get_auto_repay_status) | **GET** /margin/auto_repay | Retrieve user auto repayment setting -*MarginApi* | [**set_auto_repay**](docs/MarginApi.md#set_auto_repay) | **POST** /margin/auto_repay | Update user's auto repayment setting -*MarginApi* | [**get_margin_transferable**](docs/MarginApi.md#get_margin_transferable) | **GET** /margin/transferable | Get the max transferable amount for a specific margin currency -*MarginApi* | [**get_margin_borrowable**](docs/MarginApi.md#get_margin_borrowable) | **GET** /margin/borrowable | Get the max borrowable amount for a specific margin currency -*MarginApi* | [**list_cross_margin_currencies**](docs/MarginApi.md#list_cross_margin_currencies) | **GET** /margin/cross/currencies | Currencies supported by cross margin. -*MarginApi* | [**get_cross_margin_currency**](docs/MarginApi.md#get_cross_margin_currency) | **GET** /margin/cross/currencies/{currency} | Retrieve detail of one single currency supported by cross margin -*MarginApi* | [**get_cross_margin_account**](docs/MarginApi.md#get_cross_margin_account) | **GET** /margin/cross/accounts | Retrieve cross margin account -*MarginApi* | [**list_cross_margin_account_book**](docs/MarginApi.md#list_cross_margin_account_book) | **GET** /margin/cross/account_book | Retrieve cross margin account change history -*MarginApi* | [**list_cross_margin_loans**](docs/MarginApi.md#list_cross_margin_loans) | **GET** /margin/cross/loans | List cross margin borrow history -*MarginApi* | [**create_cross_margin_loan**](docs/MarginApi.md#create_cross_margin_loan) | **POST** /margin/cross/loans | Create a cross margin borrow loan -*MarginApi* | [**get_cross_margin_loan**](docs/MarginApi.md#get_cross_margin_loan) | **GET** /margin/cross/loans/{loan_id} | Retrieve single borrow loan detail -*MarginApi* | [**list_cross_margin_repayments**](docs/MarginApi.md#list_cross_margin_repayments) | **GET** /margin/cross/repayments | Retrieve cross margin repayments -*MarginApi* | [**repay_cross_margin_loan**](docs/MarginApi.md#repay_cross_margin_loan) | **POST** /margin/cross/repayments | Repay cross margin loan -*MarginApi* | [**get_cross_margin_transferable**](docs/MarginApi.md#get_cross_margin_transferable) | **GET** /margin/cross/transferable | Get the max transferable amount for a specific cross margin currency -*MarginApi* | [**get_cross_margin_borrowable**](docs/MarginApi.md#get_cross_margin_borrowable) | **GET** /margin/cross/borrowable | Get the max borrowable amount for a specific cross margin currency -*SpotApi* | [**list_currencies**](docs/SpotApi.md#list_currencies) | **GET** /spot/currencies | List all currencies' details -*SpotApi* | [**get_currency**](docs/SpotApi.md#get_currency) | **GET** /spot/currencies/{currency} | Get details of a specific currency -*SpotApi* | [**list_currency_pairs**](docs/SpotApi.md#list_currency_pairs) | **GET** /spot/currency_pairs | List all currency pairs supported -*SpotApi* | [**get_currency_pair**](docs/SpotApi.md#get_currency_pair) | **GET** /spot/currency_pairs/{currency_pair} | Get details of a specifc order -*SpotApi* | [**list_tickers**](docs/SpotApi.md#list_tickers) | **GET** /spot/tickers | Retrieve ticker information -*SpotApi* | [**list_order_book**](docs/SpotApi.md#list_order_book) | **GET** /spot/order_book | Retrieve order book -*SpotApi* | [**list_trades**](docs/SpotApi.md#list_trades) | **GET** /spot/trades | Retrieve market trades -*SpotApi* | [**list_candlesticks**](docs/SpotApi.md#list_candlesticks) | **GET** /spot/candlesticks | Market candlesticks -*SpotApi* | [**get_fee**](docs/SpotApi.md#get_fee) | **GET** /spot/fee | Query user trading fee rates -*SpotApi* | [**list_spot_accounts**](docs/SpotApi.md#list_spot_accounts) | **GET** /spot/accounts | List spot accounts -*SpotApi* | [**create_batch_orders**](docs/SpotApi.md#create_batch_orders) | **POST** /spot/batch_orders | Create a batch of orders +*MarginApi* | [**get_auto_repay_status**](docs/MarginApi.md#get_auto_repay_status) | **GET** /margin/auto_repay | Query user auto repayment settings +*MarginApi* | [**set_auto_repay**](docs/MarginApi.md#set_auto_repay) | **POST** /margin/auto_repay | Update user auto repayment settings +*MarginApi* | [**get_margin_transferable**](docs/MarginApi.md#get_margin_transferable) | **GET** /margin/transferable | Get maximum transferable amount for isolated margin +*MarginApi* | [**get_user_margin_tier**](docs/MarginApi.md#get_user_margin_tier) | **GET** /margin/user/loan_margin_tiers | Query user's own leverage lending tiers in current market +*MarginApi* | [**get_market_margin_tier**](docs/MarginApi.md#get_market_margin_tier) | **GET** /margin/loan_margin_tiers | Query current market leverage lending tiers +*MarginApi* | [**set_user_market_leverage**](docs/MarginApi.md#set_user_market_leverage) | **POST** /margin/leverage/user_market_setting | Set user market leverage multiplier +*MarginApi* | [**list_margin_user_account**](docs/MarginApi.md#list_margin_user_account) | **GET** /margin/user/account | Query user's isolated margin account list +*MarginApi* | [**list_cross_margin_loans**](docs/MarginApi.md#list_cross_margin_loans) | **GET** /margin/cross/loans | Query cross margin borrow history (deprecated) +*MarginApi* | [**list_cross_margin_repayments**](docs/MarginApi.md#list_cross_margin_repayments) | **GET** /margin/cross/repayments | Retrieve cross margin repayments. (deprecated) +*MultiCollateralLoanApi* | [**list_multi_collateral_orders**](docs/MultiCollateralLoanApi.md#list_multi_collateral_orders) | **GET** /loan/multi_collateral/orders | Query multi-currency collateral order list +*MultiCollateralLoanApi* | [**create_multi_collateral**](docs/MultiCollateralLoanApi.md#create_multi_collateral) | **POST** /loan/multi_collateral/orders | Place multi-currency collateral order +*MultiCollateralLoanApi* | [**get_multi_collateral_order_detail**](docs/MultiCollateralLoanApi.md#get_multi_collateral_order_detail) | **GET** /loan/multi_collateral/orders/{order_id} | Query order details +*MultiCollateralLoanApi* | [**list_multi_repay_records**](docs/MultiCollateralLoanApi.md#list_multi_repay_records) | **GET** /loan/multi_collateral/repay | Query multi-currency collateral repayment records +*MultiCollateralLoanApi* | [**repay_multi_collateral_loan**](docs/MultiCollateralLoanApi.md#repay_multi_collateral_loan) | **POST** /loan/multi_collateral/repay | Multi-currency collateral repayment +*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* | [**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 +*OptionsApi* | [**list_options_underlyings**](docs/OptionsApi.md#list_options_underlyings) | **GET** /options/underlyings | List all underlying assets +*OptionsApi* | [**list_options_expirations**](docs/OptionsApi.md#list_options_expirations) | **GET** /options/expirations | List all expiration dates +*OptionsApi* | [**list_options_contracts**](docs/OptionsApi.md#list_options_contracts) | **GET** /options/contracts | List all contracts for specified underlying and expiration date +*OptionsApi* | [**get_options_contract**](docs/OptionsApi.md#get_options_contract) | **GET** /options/contracts/{contract} | Query specified contract details +*OptionsApi* | [**list_options_settlements**](docs/OptionsApi.md#list_options_settlements) | **GET** /options/settlements | List settlement history +*OptionsApi* | [**get_options_settlement**](docs/OptionsApi.md#get_options_settlement) | **GET** /options/settlements/{contract} | Get specified contract settlement information +*OptionsApi* | [**list_my_options_settlements**](docs/OptionsApi.md#list_my_options_settlements) | **GET** /options/my_settlements | Query personal settlement records +*OptionsApi* | [**list_options_order_book**](docs/OptionsApi.md#list_options_order_book) | **GET** /options/order_book | Query options contract order book +*OptionsApi* | [**list_options_tickers**](docs/OptionsApi.md#list_options_tickers) | **GET** /options/tickers | Query options market ticker information +*OptionsApi* | [**list_options_underlying_tickers**](docs/OptionsApi.md#list_options_underlying_tickers) | **GET** /options/underlying/tickers/{underlying} | Query underlying ticker information +*OptionsApi* | [**list_options_candlesticks**](docs/OptionsApi.md#list_options_candlesticks) | **GET** /options/candlesticks | Options contract market candlestick chart +*OptionsApi* | [**list_options_underlying_candlesticks**](docs/OptionsApi.md#list_options_underlying_candlesticks) | **GET** /options/underlying/candlesticks | Underlying index price candlestick chart +*OptionsApi* | [**list_options_trades**](docs/OptionsApi.md#list_options_trades) | **GET** /options/trades | Market trade records +*OptionsApi* | [**list_options_account**](docs/OptionsApi.md#list_options_account) | **GET** /options/accounts | Query account information +*OptionsApi* | [**list_options_account_book**](docs/OptionsApi.md#list_options_account_book) | **GET** /options/account_book | Query account change history +*OptionsApi* | [**list_options_positions**](docs/OptionsApi.md#list_options_positions) | **GET** /options/positions | List user's positions of specified underlying +*OptionsApi* | [**get_options_position**](docs/OptionsApi.md#get_options_position) | **GET** /options/positions/{contract} | Get specified contract position +*OptionsApi* | [**list_options_position_close**](docs/OptionsApi.md#list_options_position_close) | **GET** /options/position_close | List user's liquidation history of specified underlying +*OptionsApi* | [**list_options_orders**](docs/OptionsApi.md#list_options_orders) | **GET** /options/orders | List options orders +*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* | [**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 +*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 +*RebateApi* | [**partner_commissions_history**](docs/RebateApi.md#partner_commissions_history) | **GET** /rebate/partner/commission_history | Partner obtains rebate records of recommended users +*RebateApi* | [**partner_sub_list**](docs/RebateApi.md#partner_sub_list) | **GET** /rebate/partner/sub_list | Partner subordinate list +*RebateApi* | [**rebate_broker_commission_history**](docs/RebateApi.md#rebate_broker_commission_history) | **GET** /rebate/broker/commission_history | Broker obtains user's rebate records +*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 +*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 +*SpotApi* | [**get_currency_pair**](docs/SpotApi.md#get_currency_pair) | **GET** /spot/currency_pairs/{currency_pair} | Query single currency pair details +*SpotApi* | [**list_tickers**](docs/SpotApi.md#list_tickers) | **GET** /spot/tickers | Get currency pair ticker information +*SpotApi* | [**list_order_book**](docs/SpotApi.md#list_order_book) | **GET** /spot/order_book | Get market depth information +*SpotApi* | [**list_trades**](docs/SpotApi.md#list_trades) | **GET** /spot/trades | Query market transaction records +*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* | [**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 a batch of orders with an ID list -*SpotApi* | [**get_order**](docs/SpotApi.md#get_order) | **GET** /spot/orders/{order_id} | Get a single order -*SpotApi* | [**cancel_order**](docs/SpotApi.md#cancel_order) | **DELETE** /spot/orders/{order_id} | Cancel a single order -*SpotApi* | [**list_my_trades**](docs/SpotApi.md#list_my_trades) | **GET** /spot/my_trades | List personal trading history -*SpotApi* | [**list_spot_price_triggered_orders**](docs/SpotApi.md#list_spot_price_triggered_orders) | **GET** /spot/price_orders | Retrieve running auto order list -*SpotApi* | [**create_spot_price_triggered_order**](docs/SpotApi.md#create_spot_price_triggered_order) | **POST** /spot/price_orders | Create a price-triggered order -*SpotApi* | [**cancel_spot_price_triggered_order_list**](docs/SpotApi.md#cancel_spot_price_triggered_order_list) | **DELETE** /spot/price_orders | Cancel all open orders -*SpotApi* | [**get_spot_price_triggered_order**](docs/SpotApi.md#get_spot_price_triggered_order) | **GET** /spot/price_orders/{order_id} | Get a single order -*SpotApi* | [**cancel_spot_price_triggered_order**](docs/SpotApi.md#cancel_spot_price_triggered_order) | **DELETE** /spot/price_orders/{order_id} | Cancel a single order +*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 +*SpotApi* | [**cancel_order**](docs/SpotApi.md#cancel_order) | **DELETE** /spot/orders/{order_id} | Cancel single order +*SpotApi* | [**amend_order**](docs/SpotApi.md#amend_order) | **PATCH** /spot/orders/{order_id} | Amend single order +*SpotApi* | [**list_my_trades**](docs/SpotApi.md#list_my_trades) | **GET** /spot/my_trades | Query personal trading records +*SpotApi* | [**get_system_time**](docs/SpotApi.md#get_system_time) | **GET** /spot/time | Get server current time +*SpotApi* | [**countdown_cancel_all_spot**](docs/SpotApi.md#countdown_cancel_all_spot) | **POST** /spot/countdown_cancel_all | Countdown cancel orders +*SpotApi* | [**amend_batch_orders**](docs/SpotApi.md#amend_batch_orders) | **POST** /spot/amend_batch_orders | Batch modification of orders +*SpotApi* | [**get_spot_insurance_history**](docs/SpotApi.md#get_spot_insurance_history) | **GET** /spot/insurance_history | Query spot insurance fund historical data +*SpotApi* | [**list_spot_price_triggered_orders**](docs/SpotApi.md#list_spot_price_triggered_orders) | **GET** /spot/price_orders | Query running auto order list +*SpotApi* | [**create_spot_price_triggered_order**](docs/SpotApi.md#create_spot_price_triggered_order) | **POST** /spot/price_orders | Create price-triggered order +*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 +*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 | Retrieve withdrawal records -*WalletApi* | [**list_deposits**](docs/WalletApi.md#list_deposits) | **GET** /wallet/deposits | Retrieve deposit records +*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* | [**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 | Retrieve transfer records between main and sub 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* | [**list_withdraw_status**](docs/WalletApi.md#list_withdraw_status) | **GET** /wallet/withdraw_status | Retrieve withdrawal status -*WalletApi* | [**list_sub_account_balances**](docs/WalletApi.md#list_sub_account_balances) | **GET** /wallet/sub_account_balances | Retrieve sub account balances -*WalletApi* | [**get_trade_fee**](docs/WalletApi.md#get_trade_fee) | **GET** /wallet/fee | Retrieve personal trading fee -*WalletApi* | [**get_total_balance**](docs/WalletApi.md#get_total_balance) | **GET** /wallet/total_balance | Retrieve user's total balances +*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* | [**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* | [**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 +*WalletApi* | [**convert_small_balance**](docs/WalletApi.md#convert_small_balance) | **POST** /wallet/small_balance | Convert small balance currency +*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 *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 ## Documentation For Models - [AccountBalance](docs/AccountBalance.md) + - [AccountDetail](docs/AccountDetail.md) + - [AccountDetailKey](docs/AccountDetailKey.md) + - [AccountRateLimit](docs/AccountRateLimit.md) + - [AgencyCommission](docs/AgencyCommission.md) + - [AgencyCommissionHistory](docs/AgencyCommissionHistory.md) + - [AgencyTransaction](docs/AgencyTransaction.md) + - [AgencyTransactionHistory](docs/AgencyTransactionHistory.md) - [AutoRepaySetting](docs/AutoRepaySetting.md) + - [BatchAmendItem](docs/BatchAmendItem.md) + - [BatchAmendOrderReq](docs/BatchAmendOrderReq.md) + - [BatchFuturesOrder](docs/BatchFuturesOrder.md) - [BatchOrder](docs/BatchOrder.md) - - [CancelOrder](docs/CancelOrder.md) + - [BorrowCurrencyInfo](docs/BorrowCurrencyInfo.md) + - [BrokerCommission](docs/BrokerCommission.md) + - [BrokerCommission1](docs/BrokerCommission1.md) + - [BrokerCommissionSubBrokerInfo](docs/BrokerCommissionSubBrokerInfo.md) + - [BrokerTransaction](docs/BrokerTransaction.md) + - [BrokerTransaction1](docs/BrokerTransaction1.md) + - [CancelBatchOrder](docs/CancelBatchOrder.md) - [CancelOrderResult](docs/CancelOrderResult.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) - [Contract](docs/Contract.md) - [ContractStat](docs/ContractStat.md) - - [CrossMarginAccount](docs/CrossMarginAccount.md) - - [CrossMarginAccountBook](docs/CrossMarginAccountBook.md) + - [ConvertSmallBalance](docs/ConvertSmallBalance.md) + - [CountdownCancelAllFuturesTask](docs/CountdownCancelAllFuturesTask.md) + - [CountdownCancelAllOptionsTask](docs/CountdownCancelAllOptionsTask.md) + - [CountdownCancelAllSpotTask](docs/CountdownCancelAllSpotTask.md) + - [CreateCollateralOrder](docs/CreateCollateralOrder.md) + - [CreateMultiCollateralOrder](docs/CreateMultiCollateralOrder.md) + - [CreateUniLend](docs/CreateUniLend.md) + - [CreateUniLoan](docs/CreateUniLoan.md) - [CrossMarginBalance](docs/CrossMarginBalance.md) - - [CrossMarginBorrowable](docs/CrossMarginBorrowable.md) - - [CrossMarginCurrency](docs/CrossMarginCurrency.md) - [CrossMarginLoan](docs/CrossMarginLoan.md) - - [CrossMarginRepayRequest](docs/CrossMarginRepayRequest.md) - [CrossMarginRepayment](docs/CrossMarginRepayment.md) - - [CrossMarginTransferable](docs/CrossMarginTransferable.md) - [Currency](docs/Currency.md) + - [CurrencyChain](docs/CurrencyChain.md) - [CurrencyPair](docs/CurrencyPair.md) + - [CurrencyQuota](docs/CurrencyQuota.md) + - [DebitFee](docs/DebitFee.md) + - [DeliveryCandlestick](docs/DeliveryCandlestick.md) - [DeliveryContract](docs/DeliveryContract.md) - [DeliverySettlement](docs/DeliverySettlement.md) + - [DeliveryTicker](docs/DeliveryTicker.md) - [DepositAddress](docs/DepositAddress.md) + - [DepositRecord](docs/DepositRecord.md) + - [DualGetOrders](docs/DualGetOrders.md) + - [DualGetPlans](docs/DualGetPlans.md) + - [Eth2RateList](docs/Eth2RateList.md) + - [Eth2Swap](docs/Eth2Swap.md) + - [FindCoin](docs/FindCoin.md) + - [FlashSwapCurrencyPair](docs/FlashSwapCurrencyPair.md) + - [FlashSwapOrder](docs/FlashSwapOrder.md) + - [FlashSwapOrderPreview](docs/FlashSwapOrderPreview.md) + - [FlashSwapOrderRequest](docs/FlashSwapOrderRequest.md) + - [FlashSwapPreviewRequest](docs/FlashSwapPreviewRequest.md) - [FundingAccount](docs/FundingAccount.md) - - [FundingBookItem](docs/FundingBookItem.md) - [FundingRateRecord](docs/FundingRateRecord.md) + - [FutureCancelOrderResult](docs/FutureCancelOrderResult.md) - [FuturesAccount](docs/FuturesAccount.md) - [FuturesAccountBook](docs/FuturesAccountBook.md) + - [FuturesAccountHistory](docs/FuturesAccountHistory.md) + - [FuturesAutoDeleverage](docs/FuturesAutoDeleverage.md) + - [FuturesBatchAmendOrderRequest](docs/FuturesBatchAmendOrderRequest.md) - [FuturesCandlestick](docs/FuturesCandlestick.md) + - [FuturesFee](docs/FuturesFee.md) + - [FuturesIndexConstituents](docs/FuturesIndexConstituents.md) - [FuturesInitialOrder](docs/FuturesInitialOrder.md) + - [FuturesLimitRiskTiers](docs/FuturesLimitRiskTiers.md) + - [FuturesLiqOrder](docs/FuturesLiqOrder.md) - [FuturesLiquidate](docs/FuturesLiquidate.md) - [FuturesOrder](docs/FuturesOrder.md) + - [FuturesOrderAmendment](docs/FuturesOrderAmendment.md) - [FuturesOrderBook](docs/FuturesOrderBook.md) - [FuturesOrderBookItem](docs/FuturesOrderBookItem.md) + - [FuturesPositionCrossMode](docs/FuturesPositionCrossMode.md) + - [FuturesPremiumIndex](docs/FuturesPremiumIndex.md) - [FuturesPriceTrigger](docs/FuturesPriceTrigger.md) - [FuturesPriceTriggeredOrder](docs/FuturesPriceTriggeredOrder.md) + - [FuturesRiskLimitTier](docs/FuturesRiskLimitTier.md) - [FuturesTicker](docs/FuturesTicker.md) - [FuturesTrade](docs/FuturesTrade.md) + - [IndexConstituent](docs/IndexConstituent.md) + - [InlineObject](docs/InlineObject.md) + - [InlineResponse200](docs/InlineResponse200.md) + - [InlineResponse2001](docs/InlineResponse2001.md) - [InsuranceRecord](docs/InsuranceRecord.md) - [LedgerRecord](docs/LedgerRecord.md) - - [Loan](docs/Loan.md) - - [LoanPatch](docs/LoanPatch.md) - - [LoanRecord](docs/LoanRecord.md) + - [LiquidateOrder](docs/LiquidateOrder.md) - [MarginAccount](docs/MarginAccount.md) - [MarginAccountBook](docs/MarginAccountBook.md) - [MarginAccountCurrency](docs/MarginAccountCurrency.md) - - [MarginBorrowable](docs/MarginBorrowable.md) - - [MarginCurrencyPair](docs/MarginCurrencyPair.md) + - [MarginLeverageTier](docs/MarginLeverageTier.md) + - [MarginMarketLeverage](docs/MarginMarketLeverage.md) + - [MarginTiers](docs/MarginTiers.md) - [MarginTransferable](docs/MarginTransferable.md) + - [MaxUniBorrowable](docs/MaxUniBorrowable.md) + - [MockFuturesOrder](docs/MockFuturesOrder.md) + - [MockFuturesPosition](docs/MockFuturesPosition.md) + - [MockMarginResult](docs/MockMarginResult.md) + - [MockOptionsOrder](docs/MockOptionsOrder.md) + - [MockOptionsPosition](docs/MockOptionsPosition.md) + - [MockRiskUnit](docs/MockRiskUnit.md) + - [MockSpotBalance](docs/MockSpotBalance.md) + - [MockSpotOrder](docs/MockSpotOrder.md) - [MultiChainAddressItem](docs/MultiChainAddressItem.md) + - [MultiCollateralCurrency](docs/MultiCollateralCurrency.md) + - [MultiCollateralItem](docs/MultiCollateralItem.md) + - [MultiCollateralOrder](docs/MultiCollateralOrder.md) + - [MultiCollateralRecord](docs/MultiCollateralRecord.md) + - [MultiCollateralRecordCurrency](docs/MultiCollateralRecordCurrency.md) + - [MultiLoanItem](docs/MultiLoanItem.md) + - [MultiLoanRepayItem](docs/MultiLoanRepayItem.md) + - [MultiRepayRecord](docs/MultiRepayRecord.md) + - [MultiRepayResp](docs/MultiRepayResp.md) - [MyFuturesTrade](docs/MyFuturesTrade.md) + - [MyFuturesTradeTimeRange](docs/MyFuturesTradeTimeRange.md) - [OpenOrders](docs/OpenOrders.md) + - [OptionsAccount](docs/OptionsAccount.md) + - [OptionsAccountBook](docs/OptionsAccountBook.md) + - [OptionsCandlestick](docs/OptionsCandlestick.md) + - [OptionsContract](docs/OptionsContract.md) + - [OptionsMMP](docs/OptionsMMP.md) + - [OptionsMMPReset](docs/OptionsMMPReset.md) + - [OptionsMySettlements](docs/OptionsMySettlements.md) + - [OptionsMyTrade](docs/OptionsMyTrade.md) + - [OptionsOrder](docs/OptionsOrder.md) + - [OptionsPosition](docs/OptionsPosition.md) + - [OptionsPositionClose](docs/OptionsPositionClose.md) + - [OptionsPositionCloseOrder](docs/OptionsPositionCloseOrder.md) + - [OptionsSettlement](docs/OptionsSettlement.md) + - [OptionsTicker](docs/OptionsTicker.md) + - [OptionsUnderlying](docs/OptionsUnderlying.md) + - [OptionsUnderlyingTicker](docs/OptionsUnderlyingTicker.md) - [Order](docs/Order.md) - [OrderBook](docs/OrderBook.md) + - [OrderCancel](docs/OrderCancel.md) + - [OrderPatch](docs/OrderPatch.md) + - [OrderResp](docs/OrderResp.md) + - [PartnerCommissionHistory](docs/PartnerCommissionHistory.md) + - [PartnerSub](docs/PartnerSub.md) + - [PartnerSubList](docs/PartnerSubList.md) + - [PartnerTransactionHistory](docs/PartnerTransactionHistory.md) + - [PatchUniLend](docs/PatchUniLend.md) + - [PlaceDualInvestmentOrder](docs/PlaceDualInvestmentOrder.md) - [Position](docs/Position.md) - [PositionClose](docs/PositionClose.md) - [PositionCloseOrder](docs/PositionCloseOrder.md) - - [RepayRequest](docs/RepayRequest.md) - - [Repayment](docs/Repayment.md) + - [ProfitLossRange](docs/ProfitLossRange.md) + - [RebateUserInfo](docs/RebateUserInfo.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) + - [SmallBalance](docs/SmallBalance.md) + - [SmallBalanceHistory](docs/SmallBalanceHistory.md) - [SpotAccount](docs/SpotAccount.md) + - [SpotAccountBook](docs/SpotAccountBook.md) + - [SpotCurrencyChain](docs/SpotCurrencyChain.md) + - [SpotFee](docs/SpotFee.md) + - [SpotInsuranceHistory](docs/SpotInsuranceHistory.md) - [SpotPricePutOrder](docs/SpotPricePutOrder.md) - [SpotPriceTrigger](docs/SpotPriceTrigger.md) - [SpotPriceTriggeredOrder](docs/SpotPriceTriggeredOrder.md) + - [StpGroup](docs/StpGroup.md) + - [StpGroupUser](docs/StpGroupUser.md) + - [StructuredBuy](docs/StructuredBuy.md) + - [StructuredGetProjectList](docs/StructuredGetProjectList.md) + - [StructuredOrderList](docs/StructuredOrderList.md) + - [SubAccount](docs/SubAccount.md) - [SubAccountBalance](docs/SubAccountBalance.md) + - [SubAccountCrossMarginBalance](docs/SubAccountCrossMarginBalance.md) + - [SubAccountFuturesBalance](docs/SubAccountFuturesBalance.md) + - [SubAccountKey](docs/SubAccountKey.md) + - [SubAccountKeyPerms](docs/SubAccountKeyPerms.md) + - [SubAccountMarginBalance](docs/SubAccountMarginBalance.md) + - [SubAccountToSubAccount](docs/SubAccountToSubAccount.md) - [SubAccountTransfer](docs/SubAccountTransfer.md) + - [SubAccountTransferRecordItem](docs/SubAccountTransferRecordItem.md) + - [SubCrossMarginAccount](docs/SubCrossMarginAccount.md) + - [SubUserMode](docs/SubUserMode.md) + - [SwapCoin](docs/SwapCoin.md) + - [SwapCoinStruct](docs/SwapCoinStruct.md) + - [SystemTime](docs/SystemTime.md) - [Ticker](docs/Ticker.md) - [TotalBalance](docs/TotalBalance.md) - [Trade](docs/Trade.md) - [TradeFee](docs/TradeFee.md) + - [TransactionID](docs/TransactionID.md) - [Transfer](docs/Transfer.md) + - [TransferOrderStatus](docs/TransferOrderStatus.md) + - [TransferablesResult](docs/TransferablesResult.md) - [TriggerOrderResponse](docs/TriggerOrderResponse.md) + - [TriggerTime](docs/TriggerTime.md) + - [UidPushOrder](docs/UidPushOrder.md) + - [UidPushWithdrawal](docs/UidPushWithdrawal.md) + - [UidPushWithdrawalResp](docs/UidPushWithdrawalResp.md) + - [UniCurrency](docs/UniCurrency.md) + - [UniCurrencyInterest](docs/UniCurrencyInterest.md) + - [UniCurrencyPair](docs/UniCurrencyPair.md) + - [UniInterestRecord](docs/UniInterestRecord.md) + - [UniLend](docs/UniLend.md) + - [UniLendInterest](docs/UniLendInterest.md) + - [UniLendRecord](docs/UniLendRecord.md) + - [UniLoan](docs/UniLoan.md) + - [UniLoanInterestRecord](docs/UniLoanInterestRecord.md) + - [UniLoanRecord](docs/UniLoanRecord.md) + - [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) + - [UnifiedDiscount](docs/UnifiedDiscount.md) + - [UnifiedDiscountTiers](docs/UnifiedDiscountTiers.md) + - [UnifiedHistoryLoanRate](docs/UnifiedHistoryLoanRate.md) + - [UnifiedHistoryLoanRateRates](docs/UnifiedHistoryLoanRateRates.md) + - [UnifiedLeverageConfig](docs/UnifiedLeverageConfig.md) + - [UnifiedLeverageSetting](docs/UnifiedLeverageSetting.md) + - [UnifiedLoan](docs/UnifiedLoan.md) + - [UnifiedLoanRecord](docs/UnifiedLoanRecord.md) + - [UnifiedLoanResult](docs/UnifiedLoanResult.md) + - [UnifiedMarginTiers](docs/UnifiedMarginTiers.md) + - [UnifiedModeSet](docs/UnifiedModeSet.md) + - [UnifiedPortfolioInput](docs/UnifiedPortfolioInput.md) + - [UnifiedPortfolioOutput](docs/UnifiedPortfolioOutput.md) + - [UnifiedRiskUnits](docs/UnifiedRiskUnits.md) + - [UnifiedSettings](docs/UnifiedSettings.md) + - [UnifiedTransferable](docs/UnifiedTransferable.md) + - [UserLtvInfo](docs/UserLtvInfo.md) + - [UserSub](docs/UserSub.md) + - [UserSubRelation](docs/UserSubRelation.md) + - [UserTotalAmount](docs/UserTotalAmount.md) - [WithdrawStatus](docs/WithdrawStatus.md) + - [WithdrawalRecord](docs/WithdrawalRecord.md) ## Documentation For Authorization @@ -322,11 +655,11 @@ Class | Method | HTTP request | Description Authentication with APIv4 key and secret For details, refer to: -[APIv4 signed request requirements](https://www.gate.io/docs/apiv4/en/index.html#apiv4-signed-request-requirements) +[APIv4 signed request requirements](https://www.gate.com/docs/apiv4/en/index.html#apiv4-signed-request-requirements) ## Author -support@mail.gate.io +support@mail.gate.com diff --git a/docs/AccountApi.md b/docs/AccountApi.md new file mode 100644 index 0000000..855675f --- /dev/null +++ b/docs/AccountApi.md @@ -0,0 +1,625 @@ +# gate_api.AccountApi + +All URIs are relative to *https://api.gateio.ws/api/v4* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_account_detail**](AccountApi.md#get_account_detail) | **GET** /account/detail | Retrieve user account information +[**get_account_rate_limit**](AccountApi.md#get_account_rate_limit) | **GET** /account/rate_limit | Get user transaction rate limit information +[**list_stp_groups**](AccountApi.md#list_stp_groups) | **GET** /account/stp_groups | Query STP user groups created by the user +[**create_stp_group**](AccountApi.md#create_stp_group) | **POST** /account/stp_groups | Create STP user group +[**list_stp_groups_users**](AccountApi.md#list_stp_groups_users) | **GET** /account/stp_groups/{stp_id}/users | Query users in the STP user group +[**add_stp_group_users**](AccountApi.md#add_stp_group_users) | **POST** /account/stp_groups/{stp_id}/users | Add users to the STP user group +[**delete_stp_group_users**](AccountApi.md#delete_stp_group_users) | **DELETE** /account/stp_groups/{stp_id}/users | Delete users from the STP user group +[**get_debit_fee**](AccountApi.md#get_debit_fee) | **GET** /account/debit_fee | Query GT fee deduction configuration +[**set_debit_fee**](AccountApi.md#set_debit_fee) | **POST** /account/debit_fee | Configure GT fee deduction + + +# **get_account_detail** +> AccountDetail get_account_detail() + +Retrieve user 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.AccountApi(api_client) + +try: + # Retrieve user account information + api_response = api_instance.get_account_detail() + 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 AccountApi->get_account_detail: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**AccountDetail**](AccountDetail.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_account_rate_limit** +> list[AccountRateLimit] get_account_rate_limit() + +Get user transaction rate limit 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.AccountApi(api_client) + +try: + # Get user transaction rate limit information + api_response = api_instance.get_account_rate_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 AccountApi->get_account_rate_limit: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**list[AccountRateLimit]**](AccountRateLimit.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_stp_groups** +> list[StpGroup] list_stp_groups(name=name) + +Query STP user groups created by the user + +Only query STP user groups created by the current main account + +### 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.AccountApi(api_client) +name = 'group' # str | Fuzzy search by name (optional) + +try: + # Query STP user groups created by the user + api_response = api_instance.list_stp_groups(name=name) + 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 AccountApi->list_stp_groups: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **str**| Fuzzy search by name | [optional] + +### Return type + +[**list[StpGroup]**](StpGroup.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) + +# **create_stp_group** +> StpGroup create_stp_group(stp_group) + +Create STP user group + +Only the main account is allowed to create a new STP user group + +### 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.AccountApi(api_client) +stp_group = gate_api.StpGroup() # StpGroup | + +try: + # Create STP user group + api_response = api_instance.create_stp_group(stp_group) + 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 AccountApi->create_stp_group: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **stp_group** | [**StpGroup**](StpGroup.md)| | + +### Return type + +[**StpGroup**](StpGroup.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** | User added successfully, returning current users in the STP group | - | + +[[Back to top]](#) [[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_stp_groups_users** +> list[StpGroupUser] list_stp_groups_users(stp_id) + +Query users in the STP user group + +Only the main account that created this STP group can query the account ID list in the current STP group + +### 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.AccountApi(api_client) +stp_id = 1 # int | STP Group ID + +try: + # Query users in the STP user group + api_response = api_instance.list_stp_groups_users(stp_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 AccountApi->list_stp_groups_users: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **stp_id** | **int**| STP Group ID | + +### Return type + +[**list[StpGroupUser]**](StpGroupUser.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) + +# **add_stp_group_users** +> list[StpGroupUser] add_stp_group_users(stp_id, request_body) + +Add users to the STP user group + +- Only the main account that created this STP group can add users to the STP user group - Only accounts under the current main account are allowed, cross-main account is not permitted + +### 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.AccountApi(api_client) +stp_id = 1 # int | STP Group ID +request_body = [[1,2,3]] # list[int] | User ID + +try: + # Add users to the STP user group + api_response = api_instance.add_stp_group_users(stp_id, request_body) + 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 AccountApi->add_stp_group_users: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **stp_id** | **int**| STP Group ID | + **request_body** | [**list[int]**](int.md)| User ID | + +### Return type + +[**list[StpGroupUser]**](StpGroupUser.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** | User added successfully, returning current users in the STP group | - | + +[[Back to top]](#) [[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_stp_group_users** +> list[StpGroupUser] delete_stp_group_users(stp_id, user_id) + +Delete users from the STP user group + +- Only the main account that created this STP group is allowed to delete users from the STP user group - Deletion is limited to accounts under the current main account; cross-account deletion is not permitted + +### 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.AccountApi(api_client) +stp_id = 1 # int | STP Group ID +user_id = 1 # int | STP user IDs, multiple IDs can be separated by commas + +try: + # Delete users from the STP user group + api_response = api_instance.delete_stp_group_users(stp_id, user_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 AccountApi->delete_stp_group_users: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **stp_id** | **int**| STP Group ID | + **user_id** | **int**| STP user IDs, multiple IDs can be separated by commas | + +### Return type + +[**list[StpGroupUser]**](StpGroupUser.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** | Users deleted successfully, returns current users in the STP group | - | + +[[Back to top]](#) [[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_debit_fee** +> DebitFee get_debit_fee() + +Query GT fee deduction configuration + +Query the GT fee deduction configuration for the current account + +### 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.AccountApi(api_client) + +try: + # Query GT fee deduction configuration + api_response = api_instance.get_debit_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 AccountApi->get_debit_fee: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**DebitFee**](DebitFee.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** | 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) + +# **set_debit_fee** +> set_debit_fee(debit_fee) + +Configure GT fee deduction + +Enable or disable GT fee deduction for the current account + +### 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.AccountApi(api_client) +debit_fee = gate_api.DebitFee() # DebitFee | + +try: + # Configure GT fee deduction + api_instance.set_debit_fee(debit_fee) +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 AccountApi->set_debit_fee: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **debit_fee** | [**DebitFee**](DebitFee.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** | 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) + diff --git a/docs/AccountBalance.md b/docs/AccountBalance.md index cf686f7..7941688 100644 --- a/docs/AccountBalance.md +++ b/docs/AccountBalance.md @@ -6,6 +6,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **amount** | **str** | Account total balance amount | [optional] **currency** | **str** | Currency | [optional] +**unrealised_pnl** | **str** | Unrealised_pnl, this field will only appear in futures, options, delivery, and total accounts | [optional] +**borrowed** | **str** | Total borrowed amount, this field will only appear in margin and cross_margin accounts | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/AccountDetail.md b/docs/AccountDetail.md new file mode 100644 index 0000000..8e01703 --- /dev/null +++ b/docs/AccountDetail.md @@ -0,0 +1,16 @@ +# AccountDetail + +Account details +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ip_whitelist** | **list[str]** | IP Whitelist | [optional] +**currency_pairs** | **list[str]** | Trading pair whitelist | [optional] +**user_id** | **int** | User ID | [optional] +**tier** | **int** | User VIP level | [optional] +**key** | [**AccountDetailKey**](AccountDetailKey.md) | | [optional] +**copy_trading_role** | **int** | User role: 0 - Normal user, 1 - Copy trading leader, 2 - Follower, 3 - Both leader and follower | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AccountDetailKey.md b/docs/AccountDetailKey.md new file mode 100644 index 0000000..363513d --- /dev/null +++ b/docs/AccountDetailKey.md @@ -0,0 +1,11 @@ +# AccountDetailKey + +API Key details +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mode** | **int** | Mode: 1 - Classic mode, 2 - Legacy unified 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/AccountRateLimit.md b/docs/AccountRateLimit.md new file mode 100644 index 0000000..b91882b --- /dev/null +++ b/docs/AccountRateLimit.md @@ -0,0 +1,13 @@ +# AccountRateLimit + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tier** | **str** | Frequency limit level (For detailed frequency limit rules, see [Transaction ratio frequency limit](#rate-limit-based-on-fill-ratio)) | [optional] +**ratio** | **str** | Fill rate | [optional] +**main_ratio** | **str** | Total fill ratio of main account | [optional] +**updated_at** | **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/AgencyCommission.md b/docs/AgencyCommission.md new file mode 100644 index 0000000..1151423 --- /dev/null +++ b/docs/AgencyCommission.md @@ -0,0 +1,15 @@ +# AgencyCommission + +## Properties +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_asset** | **str** | Commission Asset | [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/AgencyCommissionHistory.md b/docs/AgencyCommissionHistory.md new file mode 100644 index 0000000..195a454 --- /dev/null +++ b/docs/AgencyCommissionHistory.md @@ -0,0 +1,12 @@ +# AgencyCommissionHistory + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency_pair** | **str** | Currency pair | [optional] +**total** | **int** | Total | [optional] +**list** | [**list[AgencyCommission]**](AgencyCommission.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/AgencyTransaction.md b/docs/AgencyTransaction.md new file mode 100644 index 0000000..930d2b7 --- /dev/null +++ b/docs/AgencyTransaction.md @@ -0,0 +1,18 @@ +# AgencyTransaction + +## 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 | [optional] +**fee_asset** | **str** | Fee currency | [optional] +**currency_pair** | **str** | Currency pair | [optional] +**amount** | **str** | Transaction amount | [optional] +**amount_asset** | **str** | Commission Asset | [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/AgencyTransactionHistory.md b/docs/AgencyTransactionHistory.md new file mode 100644 index 0000000..a79d13c --- /dev/null +++ b/docs/AgencyTransactionHistory.md @@ -0,0 +1,12 @@ +# AgencyTransactionHistory + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency_pair** | **str** | Currency pair | [optional] +**total** | **int** | Total | [optional] +**list** | [**list[AgencyTransaction]**](AgencyTransaction.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/AutoRepaySetting.md b/docs/AutoRepaySetting.md index 14d2c7e..d71d92d 100644 --- a/docs/AutoRepaySetting.md +++ b/docs/AutoRepaySetting.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**status** | **str** | Auto repayment status. `on` - enabled, `off` - disabled | [optional] +**status** | **str** | Auto repayment status: `on` - enabled, `off` - disabled | [optional] [[Back to Model list]](../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 new file mode 100644 index 0000000..62bc971 --- /dev/null +++ b/docs/BatchAmendItem.md @@ -0,0 +1,17 @@ +# BatchAmendItem + +Order information that needs to be modified +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**order_id** | **str** | The order ID returned upon successful creation or the custom ID specified by the user during creation (i.e., the 'text' field) | +**currency_pair** | **str** | Currency pair | +**account** | **str** | Default spot, unified account and warehouse-by-store leverage account | [optional] +**amount** | **str** | Trading Quantity. Only one of `amount` or `price` can be specified | [optional] +**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] + +[[Back to Model list]](../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 new file mode 100644 index 0000000..41df706 --- /dev/null +++ b/docs/BatchAmendOrderReq.md @@ -0,0 +1,15 @@ +# BatchAmendOrderReq + +Modify contract order parameters +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**order_id** | **int** | Order id, order_id and text must contain at least one | [optional] +**text** | **str** | User-defined order text, at least one of order_id and text must be passed | [optional] +**size** | **int** | 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] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/BatchFuturesOrder.md b/docs/BatchFuturesOrder.md new file mode 100644 index 0000000..c7599b6 --- /dev/null +++ b/docs/BatchFuturesOrder.md @@ -0,0 +1,38 @@ +# BatchFuturesOrder + +Futures order details +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**succeeded** | **bool** | Request execution result | [optional] +**label** | **str** | Error label, only exists if execution fails | [optional] +**detail** | **str** | Error detail, only present if execution failed and details need to be given | [optional] +**id** | **int** | Futures order ID | [optional] [readonly] +**user** | **int** | User ID | [optional] [readonly] +**create_time** | **float** | Creation time of order | [optional] [readonly] +**finish_time** | **float** | 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 | [optional] +**size** | **int** | Required. Trading quantity. Positive for buy, negative for sell. Set to 0 for close position orders. | [optional] +**iceberg** | **int** | Display size for iceberg orders. 0 for non-iceberg orders. Note that hidden portions are charged taker fees. | [optional] +**price** | **str** | Order price. Price of 0 with `tif` set to `ioc` represents a market order. | [optional] +**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** | **int** | Unfilled quantity | [optional] [readonly] +**fill_price** | **str** | Fill price | [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: - web: from web - api: from API - app: from mobile phones - auto_deleveraging: from ADL - liquidation: from liquidation - insurance: from insurance | [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_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] +**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] + +[[Back to Model list]](../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 64c164c..7840bc6 100644 --- a/docs/BatchOrder.md +++ b/docs/BatchOrder.md @@ -4,8 +4,10 @@ Batch order details ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**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(.) | [optional] -**succeeded** | **bool** | Whether the batch of orders succeeded | [optional] +**order_id** | **str** | Order ID | [optional] +**amend_text** | **str** | The custom data that the user remarked when amending the order | [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] +**succeeded** | **bool** | Request execution result | [optional] **label** | **str** | Error label, if any, otherwise an empty string | [optional] **message** | **str** | Detailed error message, if any, otherwise an empty string | [optional] **id** | **str** | Order ID | [optional] [readonly] @@ -15,25 +17,30 @@ Name | Type | Description | Notes **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] **currency_pair** | **str** | Currency pair | [optional] -**type** | **str** | Order type. limit - limit order | [optional] [default to 'limit'] -**account** | **str** | Account type. spot - use spot account; margin - use margin account; cross_margin - use cross margin account | [optional] [default to 'spot'] -**side** | **str** | Order side | [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'] +**side** | **str** | Buy or sell order | [optional] **amount** | **str** | Trade amount | [optional] **price** | **str** | Order price | [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 | [optional] [default to 'gtc'] -**iceberg** | **str** | Amount to display for the iceberg order. Null or 0 for normal orders. Set to -1 to hide the order completely | [optional] -**auto_borrow** | **bool** | Used in margin or cross margin trading to allow automatic loan of insufficient amount if balance is not enough. | [optional] -**auto_repay** | **bool** | Enable or disable automatic repayment for automatic borrow loan generated by cross margin order. Default is disabled. Note that: 1. This field is only effective for cross margin orders. Margin account does not support setting auto repayment for orders. 2. `auto_borrow` and `auto_repay` cannot be both set to true in one order. | [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 | [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] +**auto_borrow** | **bool** | Used in margin or cross margin trading to allow automatic loan of insufficient amount if balance is not enough | [optional] +**auto_repay** | **bool** | Enable or disable automatic repayment for automatic borrow loan generated by cross margin order. Default is disabled. Note that: 1. This field is only effective for cross margin orders. Margin account does not support setting auto repayment for orders. 2. `auto_borrow` and `auto_repay` can be both set to true in one order | [optional] **left** | **str** | Amount left to fill | [optional] [readonly] +**filled_amount** | **str** | Amount filled | [optional] [readonly] **fill_price** | **str** | Total filled in quote currency. Deprecated in favor of `filled_total` | [optional] [readonly] **filled_total** | **str** | Total filled in quote currency | [optional] [readonly] +**avg_deal_price** | **str** | Average fill price | [optional] [readonly] **fee** | **str** | Fee deducted | [optional] [readonly] **fee_currency** | **str** | Fee currency unit | [optional] [readonly] **point_fee** | **str** | Points used to deduct fee | [optional] [readonly] **gt_fee** | **str** | GT used to deduct fee | [optional] [readonly] -**gt_discount** | **bool** | Whether GT fee discount is used | [optional] [readonly] +**gt_discount** | **bool** | Whether GT fee deduction is enabled | [optional] [readonly] **rebated_fee** | **str** | Rebated fee | [optional] [readonly] **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] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/BorrowCurrencyInfo.md b/docs/BorrowCurrencyInfo.md new file mode 100644 index 0000000..64ca722 --- /dev/null +++ b/docs/BorrowCurrencyInfo.md @@ -0,0 +1,14 @@ +# BorrowCurrencyInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **str** | Currency | [optional] +**index_price** | **str** | Currency Index Price | [optional] +**left_repay_principal** | **str** | Outstanding principal | [optional] +**left_repay_interest** | **str** | Outstanding interest | [optional] +**left_repay_usdt** | **str** | Remaining total outstanding value 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/BrokerCommission.md b/docs/BrokerCommission.md new file mode 100644 index 0000000..0cbfd46 --- /dev/null +++ b/docs/BrokerCommission.md @@ -0,0 +1,11 @@ +# BrokerCommission + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total** | **int** | Total | [optional] +**list** | [**list[BrokerCommission1]**](BrokerCommission1.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/BrokerCommission1.md new file mode 100644 index 0000000..0382e9c --- /dev/null +++ b/docs/BrokerCommission1.md @@ -0,0 +1,20 @@ +# BrokerCommission1 + +## Properties +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] +**amount** | **str** | The amount of commission rebates | [optional] +**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] +**currency_pair** | **str** | Currency pair | [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/BrokerCommissionSubBrokerInfo.md b/docs/BrokerCommissionSubBrokerInfo.md new file mode 100644 index 0000000..d6a0912 --- /dev/null +++ b/docs/BrokerCommissionSubBrokerInfo.md @@ -0,0 +1,14 @@ +# BrokerCommissionSubBrokerInfo + +Sub-broker information +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_id** | **int** | Sub-broker user ID | [optional] +**original_commission_rate** | **str** | Sub-broker original commission rate | [optional] +**relative_commission_rate** | **str** | Sub-broker relative commission rate | [optional] +**commission_rate** | **str** | Sub-broker actual commission 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/BrokerTransaction.md b/docs/BrokerTransaction.md new file mode 100644 index 0000000..c450894 --- /dev/null +++ b/docs/BrokerTransaction.md @@ -0,0 +1,11 @@ +# BrokerTransaction + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total** | **int** | Total | [optional] +**list** | [**list[BrokerTransaction1]**](BrokerTransaction1.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/BrokerTransaction1.md b/docs/BrokerTransaction1.md new file mode 100644 index 0000000..07833a8 --- /dev/null +++ b/docs/BrokerTransaction1.md @@ -0,0 +1,19 @@ +# 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/CancelBatchOrder.md b/docs/CancelBatchOrder.md new file mode 100644 index 0000000..4d2953b --- /dev/null +++ b/docs/CancelBatchOrder.md @@ -0,0 +1,14 @@ +# CancelBatchOrder + +Info of order to be cancelled +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency_pair** | **str** | Order currency pair | +**id** | **str** | Order ID or user custom ID. Custom ID are accepted only within 30 minutes after order creation | +**account** | **str** | If the canceled order is a unified account apikey, this field must be specified and set to `unified` | [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] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CancelOrder.md b/docs/CancelOrder.md deleted file mode 100644 index 1ef6414..0000000 --- a/docs/CancelOrder.md +++ /dev/null @@ -1,13 +0,0 @@ -# CancelOrder - -Info of order to be cancelled -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**currency_pair** | **str** | Order currency pair | -**id** | **str** | Order ID or user custom ID. Custom ID are accepted only within 30 minutes after order creation | -**account** | **str** | If cancelled order is cross margin order, this field must be set and can only be `cross_margin` | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/CancelOrderResult.md b/docs/CancelOrderResult.md index d5cb671..8aa2f77 100644 --- a/docs/CancelOrderResult.md +++ b/docs/CancelOrderResult.md @@ -6,10 +6,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **currency_pair** | **str** | Order currency pair | [optional] **id** | **str** | Order ID | [optional] +**text** | **str** | Custom order information | [optional] **succeeded** | **bool** | Whether cancellation succeeded | [optional] **label** | **str** | Error label when failed to cancel the order; emtpy if succeeded | [optional] -**message** | **str** | Error message when failed to cancel the order; empty if succeeded | [optional] -**account** | **str** | Empty by default. If cancelled order is cross margin order, this field is set to `cross_margin` | [optional] +**message** | **str** | Error description when cancellation fails, empty if successful | [optional] +**account** | **str** | Default is empty (deprecated) | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CollateralAdjust.md b/docs/CollateralAdjust.md new file mode 100644 index 0000000..945eda4 --- /dev/null +++ b/docs/CollateralAdjust.md @@ -0,0 +1,12 @@ +# CollateralAdjust + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**order_id** | **int** | Order ID | +**type** | **str** | Operation type: append - add collateral, redeem - withdraw collateral | +**collaterals** | [**list[CollateralCurrency]**](CollateralCurrency.md) | Collateral currency 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/CollateralAdjustRes.md b/docs/CollateralAdjustRes.md new file mode 100644 index 0000000..d116036 --- /dev/null +++ b/docs/CollateralAdjustRes.md @@ -0,0 +1,12 @@ +# CollateralAdjustRes + +Multi-collateral adjustment result +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**order_id** | **int** | Order ID | [optional] +**collateral_currencies** | [**list[CollateralCurrencyRes]**](CollateralCurrencyRes.md) | Collateral currency 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/CollateralAlign.md b/docs/CollateralAlign.md new file mode 100644 index 0000000..4b14840 --- /dev/null +++ b/docs/CollateralAlign.md @@ -0,0 +1,13 @@ +# CollateralAlign + +## 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 | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CrossMarginRepayRequest.md b/docs/CollateralCurrency.md similarity index 70% rename from docs/CrossMarginRepayRequest.md rename to docs/CollateralCurrency.md index 9c1ca05..016d704 100644 --- a/docs/CrossMarginRepayRequest.md +++ b/docs/CollateralCurrency.md @@ -1,10 +1,10 @@ -# CrossMarginRepayRequest +# CollateralCurrency ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**currency** | **str** | Repayment currency | -**amount** | **str** | Repayment amount | +**currency** | **str** | Currency | [optional] +**amount** | **str** | Size | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CollateralCurrencyInfo.md b/docs/CollateralCurrencyInfo.md new file mode 100644 index 0000000..0b1e1f4 --- /dev/null +++ b/docs/CollateralCurrencyInfo.md @@ -0,0 +1,13 @@ +# CollateralCurrencyInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **str** | Currency | [optional] +**index_price** | **str** | Currency Index Price | [optional] +**left_collateral** | **str** | Remaining collateral amount | [optional] +**left_collateral_usdt** | **str** | Remaining collateral value 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/CollateralCurrencyRes.md b/docs/CollateralCurrencyRes.md new file mode 100644 index 0000000..1a64fff --- /dev/null +++ b/docs/CollateralCurrencyRes.md @@ -0,0 +1,14 @@ +# CollateralCurrencyRes + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**succeeded** | **bool** | Update success status | [optional] +**label** | **str** | Error identifier for failed operations; empty when successful | [optional] +**message** | **str** | Error description for failed operations; empty when successful | [optional] +**currency** | **str** | Currency | [optional] +**amount** | **str** | Successfully operated collateral quantity; 0 if operation fails | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CollateralCurrentRate.md b/docs/CollateralCurrentRate.md new file mode 100644 index 0000000..f9a94d0 --- /dev/null +++ b/docs/CollateralCurrentRate.md @@ -0,0 +1,12 @@ +# CollateralCurrentRate + +Multi-collateral current interest rate +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **str** | Currency | [optional] +**current_rate** | **str** | Currency current 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/CollateralFixRate.md b/docs/CollateralFixRate.md new file mode 100644 index 0000000..2f3f84f --- /dev/null +++ b/docs/CollateralFixRate.md @@ -0,0 +1,14 @@ +# CollateralFixRate + +Multi-collateral fixed interest rate +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **str** | Currency | [optional] +**rate_7d** | **str** | Fixed interest rate for 7-day lending period | [optional] +**rate_30d** | **str** | Fixed interest rate for 30-day lending period | [optional] +**update_time** | **int** | Update 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/CollateralLoanApi.md b/docs/CollateralLoanApi.md new file mode 100644 index 0000000..bfd5ed6 --- /dev/null +++ b/docs/CollateralLoanApi.md @@ -0,0 +1,704 @@ +# gate_api.CollateralLoanApi + +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_collateral_loan_orders** +> list[CollateralOrder] list_collateral_loan_orders(page=page, limit=limit, collateral_currency=collateral_currency, borrow_currency=borrow_currency) + +Query collateral loan 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.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) + +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) + 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) +``` + +### 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] + +### Return type + +[**list[CollateralOrder]**](CollateralOrder.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) + +# **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) + +# **get_collateral_loan_order_detail** +> CollateralOrder get_collateral_loan_order_detail(order_id) + +Query single 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.CollateralLoanApi(api_client) +order_id = 100001 # int | Order ID returned when order is successfully created + +try: + # Query single order details + api_response = api_instance.get_collateral_loan_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 CollateralLoanApi->get_collateral_loan_order_detail: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order_id** | **int**| Order ID returned when order is successfully created | + +### Return type + +[**CollateralOrder**](CollateralOrder.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 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) + +# **repay_collateral_loan** +> RepayResp repay_collateral_loan(repay_loan) + +Collateral loan repayment + +### 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) +repay_loan = gate_api.RepayLoan() # RepayLoan | + +try: + # Collateral loan repayment + api_response = api_instance.repay_collateral_loan(repay_loan) + 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) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repay_loan** | [**RepayLoan**](RepayLoan.md)| | + +### Return type + +[**RepayResp**](RepayResp.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** | Operation 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_repay_records** +> list[RepayRecord] list_repay_records(source, borrow_currency=borrow_currency, collateral_currency=collateral_currency, page=page, limit=limit, _from=_from, to=to) + +Query collateral loan repayment 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.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) +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) + 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) +``` + +### 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] + **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) + +### 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_collateral_records** +> list[CollateralRecord] list_collateral_records(page=page, limit=limit, _from=_from, to=to, borrow_currency=borrow_currency, collateral_currency=collateral_currency) + +Query collateral adjustment 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.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) + +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) + 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) +``` + +### 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] + +### Return type + +[**list[CollateralRecord]**](CollateralRecord.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) + +# **operate_collateral** +> operate_collateral(collateral_align) + +Increase or redeem collateral + +### 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) +collateral_align = gate_api.CollateralAlign() # CollateralAlign | + +try: + # Increase or redeem collateral + api_instance.operate_collateral(collateral_align) +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) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **collateral_align** | [**CollateralAlign**](CollateralAlign.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 | +|-------------|-------------|------------------| +**204** | Operation 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_user_total_amount** +> UserTotalAmount get_user_total_amount() + +Query user's total borrowing and collateral 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.CollateralLoanApi(api_client) + +try: + # Query user's total borrowing and collateral amount + api_response = api_instance.get_user_total_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 CollateralLoanApi->get_user_total_amount: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**UserTotalAmount**](UserTotalAmount.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_user_ltv_info** +> UserLtvInfo get_user_ltv_info(collateral_currency, borrow_currency) + +Query user's collateralization ratio and remaining borrowable currencies + +### 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) +collateral_currency = 'BTC' # str | Collateral currency +borrow_currency = 'USDT' # str | Borrowed currency + +try: + # Query user's collateralization ratio and remaining borrowable currencies + api_response = api_instance.get_user_ltv_info(collateral_currency, borrow_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 CollateralLoanApi->get_user_ltv_info: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **collateral_currency** | **str**| Collateral currency | + **borrow_currency** | **str**| Borrowed currency | + +### Return type + +[**UserLtvInfo**](UserLtvInfo.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_collateral_currencies** +> list[CollateralLoanCurrency] list_collateral_currencies(loan_currency=loan_currency) + +Query supported borrowing and collateral currencies + +### 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.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) + +try: + # Query supported borrowing and collateral currencies + api_response = api_instance.list_collateral_currencies(loan_currency=loan_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 CollateralLoanApi->list_collateral_currencies: %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] + +### Return type + +[**list[CollateralLoanCurrency]**](CollateralLoanCurrency.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) + diff --git a/docs/CollateralLoanCurrency.md b/docs/CollateralLoanCurrency.md new file mode 100644 index 0000000..fc4151a --- /dev/null +++ b/docs/CollateralLoanCurrency.md @@ -0,0 +1,12 @@ +# CollateralLoanCurrency + +Supported borrowing and collateral currencies +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**loan_currency** | **str** | Borrowed currency | [optional] +**collateral_currency** | **list[str]** | List of supported collateral currencies | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CollateralLtv.md b/docs/CollateralLtv.md new file mode 100644 index 0000000..5bd7f58 --- /dev/null +++ b/docs/CollateralLtv.md @@ -0,0 +1,13 @@ +# CollateralLtv + +Multi-collateral ratio +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**init_ltv** | **str** | Initial collateralization rate | [optional] +**alert_ltv** | **str** | Warning collateralization rate | [optional] +**liquidate_ltv** | **str** | Liquidation collateralization 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/CollateralOrder.md b/docs/CollateralOrder.md new file mode 100644 index 0000000..b83a7fb --- /dev/null +++ b/docs/CollateralOrder.md @@ -0,0 +1,26 @@ +# 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 new file mode 100644 index 0000000..f2fbfa7 --- /dev/null +++ b/docs/CollateralRecord.md @@ -0,0 +1,20 @@ +# 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/Contract.md b/docs/Contract.md index 646adad..d7adc71 100644 --- a/docs/Contract.md +++ b/docs/Contract.md @@ -1,41 +1,49 @@ # Contract -Contract detail. USD value per contract: - USDT settled contracts: `quanto_multiplier x token price` - BTC settled contracts:`quanto_multiplier x BTC price x token price` +Futures contract details ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | Futures contract | [optional] -**type** | **str** | Futures contract type | [optional] +**type** | **str** | Contract type: inverse - inverse contract, direct - direct contract | [optional] **quanto_multiplier** | **str** | Multiplier used in converting from invoicing to settlement currency | [optional] **leverage_min** | **str** | Minimum leverage | [optional] **leverage_max** | **str** | Maximum leverage | [optional] **maintenance_rate** | **str** | Maintenance rate of margin | [optional] -**mark_type** | **str** | Mark price type, internal - based on internal trading, index - based on external index price | [optional] +**mark_type** | **str** | Mark price type: internal - internal trading price, index - external index price | [optional] **mark_price** | **str** | Current mark price | [optional] **index_price** | **str** | Current index price | [optional] **last_price** | **str** | Last trading price | [optional] -**maker_fee_rate** | **str** | Maker fee rate, where negative means rebate | [optional] +**maker_fee_rate** | **str** | Maker fee rate, negative values indicate rebates | [optional] **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] **funding_rate** | **str** | Current funding rate | [optional] **funding_interval** | **int** | Funding application interval, unit in seconds | [optional] **funding_next_apply** | **float** | Next funding time | [optional] -**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 the contract allowed | [optional] -**order_size_max** | **int** | Maximum order size the contract allowed | [optional] -**order_price_deviate** | **str** | deviation between order price and current index price. If price of an order is denoted as order_price, it must meet the following condition: abs(order_price - mark_price) <= mark_price * order_price_deviate | [optional] -**ref_discount_rate** | **str** | Referral fee rate discount | [optional] -**ref_rebate_rate** | **str** | Referrer commission rate | [optional] -**orderbook_id** | **int** | Current orderbook ID | [optional] +**risk_limit_base** | **str** | Base risk limit (deprecated) | [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** | **int** | Minimum order size allowed by the contract | [optional] +**order_size_max** | **int** | Maximum order size allowed by the contract | [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] +**orderbook_id** | **int** | Orderbook update ID | [optional] **trade_id** | **int** | Current trade ID | [optional] -**trade_size** | **int** | Historical accumulated trade size | [optional] +**trade_size** | **int** | Historical cumulative trading volume | [optional] **position_size** | **int** | Current total long position size | [optional] -**config_change_time** | **float** | Last changed time of configuration | [optional] -**in_delisting** | **bool** | Contract is delisting | [optional] -**orders_limit** | **int** | Maximum number of open orders | [optional] +**config_change_time** | **float** | Last configuration update time | [optional] +**in_delisting** | **bool** | `in_delisting=true` and position_size>0 indicates the contract is in delisting transition period `in_delisting=true` and position_size=0 indicates the contract is delisted | [optional] +**orders_limit** | **int** | Maximum number of pending orders | [optional] +**enable_bonus** | **bool** | Whether bonus is enabled | [optional] +**enable_credit** | **bool** | Whether portfolio margin account is enabled | [optional] +**create_time** | **float** | Created time of the contract | [optional] +**funding_cap_ratio** | **str** | The factor for the maximum of the funding rate. Maximum of funding rate = (1/market maximum leverage - maintenance margin rate) * funding_cap_ratio | [optional] +**status** | **str** | Contract status types include: prelaunch (pre-launch), trading (active), delisting (delisting), delisted (delisted), circuit_breaker (circuit breaker) | [optional] +**launch_time** | **int** | Contract expiry timestamp | [optional] +**delisting_time** | **int** | Timestamp when contract enters reduce-only state | [optional] +**delisted_time** | **int** | Contract delisting 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/ContractStat.md b/docs/ContractStat.md index c66586e..f20a520 100644 --- a/docs/ContractStat.md +++ b/docs/ContractStat.md @@ -4,18 +4,19 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **time** | **int** | Stat timestamp | [optional] -**lsr_taker** | **float** | Long/short account number ratio | [optional] -**lsr_account** | **float** | Long/short taker size ratio | [optional] -**long_liq_size** | **int** | Long liquidation size | [optional] -**long_liq_amount** | **float** | Long liquidation amount(base currency) | [optional] -**long_liq_usd** | **float** | Long liquidation volume(quote currency) | [optional] -**short_liq_size** | **int** | Short liquidation size | [optional] -**short_liq_amount** | **float** | Short liquidation amount(base currency) | [optional] -**short_liq_usd** | **float** | Short liquidation volume(quote currency) | [optional] -**open_interest** | **int** | Open interest size | [optional] -**open_interest_usd** | **float** | Open interest volume(quote currency) | [optional] +**lsr_taker** | **float** | Long/short taker ratio | [optional] +**lsr_account** | **float** | Long/short position user ratio | [optional] +**long_liq_size** | **int** | 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] +**short_liq_size** | **int** | 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] +**open_interest** | **int** | 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** | **float** | Top trader long/short position ratio | [optional] +**mark_price** | **float** | Mark 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/ConvertSmallBalance.md b/docs/ConvertSmallBalance.md new file mode 100644 index 0000000..e412efb --- /dev/null +++ b/docs/ConvertSmallBalance.md @@ -0,0 +1,12 @@ +# ConvertSmallBalance + +Small Balance Conversion +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **list[str]** | Currency to be converted | [optional] +**is_all** | **bool** | Whether to convert all | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CountdownCancelAllFuturesTask.md b/docs/CountdownCancelAllFuturesTask.md new file mode 100644 index 0000000..5cf1cd3 --- /dev/null +++ b/docs/CountdownCancelAllFuturesTask.md @@ -0,0 +1,12 @@ +# CountdownCancelAllFuturesTask + +Countdown cancel task details +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timeout** | **int** | Countdown time in seconds At least 5 seconds, 0 means cancel countdown | +**contract** | **str** | Futures contract | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CountdownCancelAllOptionsTask.md b/docs/CountdownCancelAllOptionsTask.md new file mode 100644 index 0000000..0f50bb0 --- /dev/null +++ b/docs/CountdownCancelAllOptionsTask.md @@ -0,0 +1,13 @@ +# CountdownCancelAllOptionsTask + +Countdown cancel task details +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timeout** | **int** | Countdown time in seconds At least 5 seconds, 0 means cancel countdown | +**contract** | **str** | Options contract name | [optional] +**underlying** | **str** | Underlying | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CountdownCancelAllSpotTask.md b/docs/CountdownCancelAllSpotTask.md new file mode 100644 index 0000000..49c09a8 --- /dev/null +++ b/docs/CountdownCancelAllSpotTask.md @@ -0,0 +1,12 @@ +# CountdownCancelAllSpotTask + +Countdown cancel task details +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timeout** | **int** | Countdown time in seconds At least 5 seconds, 0 means cancel countdown | +**currency_pair** | **str** | Currency pair | [optional] + +[[Back to Model list]](../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/CreateCollateralOrder.md new file mode 100644 index 0000000..41db4cc --- /dev/null +++ b/docs/CreateCollateralOrder.md @@ -0,0 +1,13 @@ +# CreateCollateralOrder + +## 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 | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateMultiCollateralOrder.md b/docs/CreateMultiCollateralOrder.md new file mode 100644 index 0000000..72aa727 --- /dev/null +++ b/docs/CreateMultiCollateralOrder.md @@ -0,0 +1,18 @@ +# CreateMultiCollateralOrder + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**order_id** | **str** | Order ID | [optional] +**order_type** | **str** | current - current rate, fixed - fixed rate, defaults to current if not specified | [optional] +**fixed_type** | **str** | Fixed interest rate lending period: 7d - 7 days, 30d - 30 days. Required for fixed rate | [optional] +**fixed_rate** | **str** | Fixed interest rate, required for fixed rate | [optional] +**auto_renew** | **bool** | Fixed interest rate, auto-renewal | [optional] +**auto_repay** | **bool** | Fixed interest rate, auto-repayment | [optional] +**borrow_currency** | **str** | Borrowed currency | +**borrow_amount** | **str** | Borrowed amount | +**collateral_currencies** | [**list[CollateralCurrency]**](CollateralCurrency.md) | Collateral currency and 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/CreateUniLend.md b/docs/CreateUniLend.md new file mode 100644 index 0000000..8c9af5a --- /dev/null +++ b/docs/CreateUniLend.md @@ -0,0 +1,14 @@ +# CreateUniLend + +Create lending or redemption +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **str** | Currency name | +**amount** | **str** | Amount to deposit into lending pool | +**type** | **str** | Operation type: lend - Lend, redeem - Redeem | +**min_rate** | **str** | Minimum interest rate. If set too high, lending may fail and no interest will be earned. Required for lending operations. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateUniLoan.md b/docs/CreateUniLoan.md new file mode 100644 index 0000000..22ad9da --- /dev/null +++ b/docs/CreateUniLoan.md @@ -0,0 +1,15 @@ +# CreateUniLoan + +Borrow or repay +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **str** | Currency | +**type** | **str** | Type: `borrow` - borrow, `repay` - repay | +**amount** | **str** | Borrow or repayment amount | +**repaid_all** | **bool** | Full repayment. For repayment operations only. When `true`, overrides `amount` and repays the full amount | [optional] +**currency_pair** | **str** | Currency pair | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CrossMarginAccount.md b/docs/CrossMarginAccount.md deleted file mode 100644 index c4bef2d..0000000 --- a/docs/CrossMarginAccount.md +++ /dev/null @@ -1,16 +0,0 @@ -# CrossMarginAccount - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**user_id** | **int** | User ID | [optional] -**locked** | **bool** | Whether account is locked | [optional] -**balances** | [**dict(str, CrossMarginBalance)**](CrossMarginBalance.md) | | [optional] -**total** | **str** | Total account value in USDT, i.e., the sum of all currencies' `(available+freeze)*price*discount` | [optional] -**borrowed** | **str** | Total borrowed value in USDT, i.e., the sum of all currencies' `borrowed*price*discount` | [optional] -**interest** | **str** | Total unpaid interests in USDT, i.e., the sum of all currencies' `interest*price*discount` | [optional] -**risk** | **str** | Risk rate. When it belows 110%, liquidation will be triggered. Calculation formula: `total / (borrowed+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/CrossMarginBalance.md b/docs/CrossMarginBalance.md index d2a1945..f4ccc54 100644 --- a/docs/CrossMarginBalance.md +++ b/docs/CrossMarginBalance.md @@ -3,10 +3,10 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**available** | **str** | Available amount | [optional] -**freeze** | **str** | Locked amount | [optional] -**borrowed** | **str** | Borrowed amount | [optional] -**interest** | **str** | Unpaid interests | [optional] +**available** | **str** | Available balance | [optional] +**freeze** | **str** | Locked balance | [optional] +**borrowed** | **str** | Borrowed balance | [optional] +**interest** | **str** | Unpaid 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/CrossMarginCurrency.md b/docs/CrossMarginCurrency.md deleted file mode 100644 index 7f47bce..0000000 --- a/docs/CrossMarginCurrency.md +++ /dev/null @@ -1,17 +0,0 @@ -# CrossMarginCurrency - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | Currency name | [optional] -**rate** | **str** | Loan rate | [optional] -**prec** | **str** | Currency precision | [optional] -**discount** | **str** | Currency value discount, which is used in total value calculation | [optional] -**min_borrow_amount** | **str** | Minimum currency borrow amount. Unit is currency itself | [optional] -**user_max_borrow_amount** | **str** | Maximum borrow value allowed per user, in USDT | [optional] -**total_max_borrow_amount** | **str** | Maximum borrow value allowed for this currency, in USDT | [optional] -**price** | **str** | Price change between this currency and 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/CrossMarginLoan.md b/docs/CrossMarginLoan.md index ff39ca2..662a94c 100644 --- a/docs/CrossMarginLoan.md +++ b/docs/CrossMarginLoan.md @@ -3,16 +3,16 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **str** | Borrow loan ID | [optional] [readonly] +**id** | **str** | Loan record ID | [optional] [readonly] **create_time** | **int** | Creation timestamp, in milliseconds | [optional] [readonly] **update_time** | **int** | Update timestamp, in milliseconds | [optional] [readonly] **currency** | **str** | Currency name | **amount** | **str** | Borrowed amount | **text** | **str** | User defined custom ID | [optional] -**status** | **int** | Borrow loan status, which includes: - 1: failed to borrow - 2: borrowed but not repaid - 3: repayment complete | [optional] [readonly] +**status** | **int** | Deprecated. Currently, all statuses have been set to 2. Borrow loan status, which includes: - 1: failed to borrow - 2: borrowed but not repaid - 3: repayment complete | [optional] [readonly] **repaid** | **str** | Repaid amount | [optional] [readonly] **repaid_interest** | **str** | Repaid interest | [optional] [readonly] -**unpaid_interest** | **str** | Outstanding interest yet to be paid | [optional] [readonly] +**unpaid_interest** | **str** | Unpaid interest | [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/CrossMarginRepayment.md b/docs/CrossMarginRepayment.md index 96813ac..3997879 100644 --- a/docs/CrossMarginRepayment.md +++ b/docs/CrossMarginRepayment.md @@ -5,10 +5,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | Loan record ID | [optional] **create_time** | **int** | Repayment time | [optional] -**loan_id** | **str** | Borrow loan ID | [optional] +**loan_id** | **str** | Loan record ID | [optional] **currency** | **str** | Currency name | [optional] **principal** | **str** | Repaid principal | [optional] **interest** | **str** | Repaid interest | [optional] +**repayment_type** | **str** | Repayment type: none - no repayment type, manual_repay - manual repayment, auto_repay - automatic repayment after cancellation | [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/Currency.md b/docs/Currency.md index 3b887d2..27e0400 100644 --- a/docs/Currency.md +++ b/docs/Currency.md @@ -3,12 +3,16 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**currency** | **str** | Currency name | [optional] +**currency** | **str** | Currency symbol | [optional] +**name** | **str** | Currency name | [optional] **delisted** | **bool** | Whether currency is de-listed | [optional] -**withdraw_disabled** | **bool** | Whether currency's withdrawal is disabled | [optional] -**withdraw_delayed** | **bool** | Whether currency's withdrawal is delayed | [optional] -**deposit_disabled** | **bool** | Whether currency's deposit is disabled | [optional] +**withdraw_disabled** | **bool** | Whether currency's withdrawal is disabled (deprecated) | [optional] +**withdraw_delayed** | **bool** | Whether currency's withdrawal is delayed (deprecated) | [optional] +**deposit_disabled** | **bool** | Whether currency's deposit is disabled (deprecated) | [optional] **trade_disabled** | **bool** | Whether currency's trading is disabled | [optional] +**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] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CurrencyChain.md b/docs/CurrencyChain.md new file mode 100644 index 0000000..90a4984 --- /dev/null +++ b/docs/CurrencyChain.md @@ -0,0 +1,17 @@ +# CurrencyChain + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**chain** | **str** | Chain name | [optional] +**name_cn** | **str** | Chain name in Chinese | [optional] +**name_en** | **str** | Chain name in English | [optional] +**contract_address** | **str** | Smart contract address for the currency; if no address is available, it will be an empty string | [optional] +**is_disabled** | **int** | If it is disabled. 0 means NOT being disabled | [optional] +**is_deposit_disabled** | **int** | Is deposit disabled. 0 means not disabled | [optional] +**is_withdraw_disabled** | **int** | Is withdrawal disabled. 0 means not disabled | [optional] +**decimal** | **str** | Withdrawal precision | [optional] + +[[Back to Model list]](../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 19d4e7b..3f5f39f 100644 --- a/docs/CurrencyPair.md +++ b/docs/CurrencyPair.md @@ -6,15 +6,23 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | Currency pair | [optional] **base** | **str** | Base currency | [optional] +**base_name** | **str** | Base currency name | [optional] **quote** | **str** | Quote currency | [optional] -**fee** | **str** | Trading fee | [optional] +**quote_name** | **str** | Quote currency name | [optional] +**fee** | **str** | Trading fee rate | [optional] **min_base_amount** | **str** | Minimum amount of base currency to trade, `null` means no limit | [optional] **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] -**trade_status** | **str** | How currency pair can be traded - untradable: cannot be bought or sold - buyable: can be bought - sellable: can be sold - tradable: can be bought or sold | [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] +**delisting_time** | **int** | Expected time to remove the shelves, Unix timestamp in seconds | [optional] +**type** | **str** | Trading pair type, normal: normal, premarket: pre-market | [optional] +**trade_url** | **str** | Transaction link | [optional] +**st_tag** | **bool** | Whether the trading pair is in ST risk assessment, false - No, true - Yes | [optional] [[Back to Model list]](../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 new file mode 100644 index 0000000..656a6a8 --- /dev/null +++ b/docs/CurrencyQuota.md @@ -0,0 +1,15 @@ +# CurrencyQuota + +Currency Quota +## Properties +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] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/DebitFee.md b/docs/DebitFee.md new file mode 100644 index 0000000..98d0744 --- /dev/null +++ b/docs/DebitFee.md @@ -0,0 +1,10 @@ +# DebitFee + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enabled** | **bool** | Whether GT fee deduction is enabled | + +[[Back to Model list]](../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 b187e37..88ac2c5 100644 --- a/docs/DeliveryApi.md +++ b/docs/DeliveryApi.md @@ -4,40 +4,41 @@ All URIs are relative to *https://api.gateio.ws/api/v4* Method | HTTP request | Description ------------- | ------------- | ------------- -[**list_delivery_contracts**](DeliveryApi.md#list_delivery_contracts) | **GET** /delivery/{settle}/contracts | List all futures contracts -[**get_delivery_contract**](DeliveryApi.md#get_delivery_contract) | **GET** /delivery/{settle}/contracts/{contract} | Get a single contract -[**list_delivery_order_book**](DeliveryApi.md#list_delivery_order_book) | **GET** /delivery/{settle}/order_book | Futures order book -[**list_delivery_trades**](DeliveryApi.md#list_delivery_trades) | **GET** /delivery/{settle}/trades | Futures trading history -[**list_delivery_candlesticks**](DeliveryApi.md#list_delivery_candlesticks) | **GET** /delivery/{settle}/candlesticks | Get futures candlesticks -[**list_delivery_tickers**](DeliveryApi.md#list_delivery_tickers) | **GET** /delivery/{settle}/tickers | List futures tickers -[**list_delivery_insurance_ledger**](DeliveryApi.md#list_delivery_insurance_ledger) | **GET** /delivery/{settle}/insurance | Futures insurance balance history -[**list_delivery_accounts**](DeliveryApi.md#list_delivery_accounts) | **GET** /delivery/{settle}/accounts | Query futures account -[**list_delivery_account_book**](DeliveryApi.md#list_delivery_account_book) | **GET** /delivery/{settle}/account_book | Query account book -[**list_delivery_positions**](DeliveryApi.md#list_delivery_positions) | **GET** /delivery/{settle}/positions | List all positions of a user -[**get_delivery_position**](DeliveryApi.md#get_delivery_position) | **GET** /delivery/{settle}/positions/{contract} | Get single position +[**list_delivery_contracts**](DeliveryApi.md#list_delivery_contracts) | **GET** /delivery/{settle}/contracts | Query all futures contracts +[**get_delivery_contract**](DeliveryApi.md#get_delivery_contract) | **GET** /delivery/{settle}/contracts/{contract} | Query single contract information +[**list_delivery_order_book**](DeliveryApi.md#list_delivery_order_book) | **GET** /delivery/{settle}/order_book | Query futures market depth information +[**list_delivery_trades**](DeliveryApi.md#list_delivery_trades) | **GET** /delivery/{settle}/trades | Futures market transaction records +[**list_delivery_candlesticks**](DeliveryApi.md#list_delivery_candlesticks) | **GET** /delivery/{settle}/candlesticks | Futures market K-line chart +[**list_delivery_tickers**](DeliveryApi.md#list_delivery_tickers) | **GET** /delivery/{settle}/tickers | Get all futures trading statistics +[**list_delivery_insurance_ledger**](DeliveryApi.md#list_delivery_insurance_ledger) | **GET** /delivery/{settle}/insurance | Futures market insurance fund history +[**list_delivery_accounts**](DeliveryApi.md#list_delivery_accounts) | **GET** /delivery/{settle}/accounts | Get futures account +[**list_delivery_account_book**](DeliveryApi.md#list_delivery_account_book) | **GET** /delivery/{settle}/account_book | Query futures account change history +[**list_delivery_positions**](DeliveryApi.md#list_delivery_positions) | **GET** /delivery/{settle}/positions | Get user position list +[**get_delivery_position**](DeliveryApi.md#get_delivery_position) | **GET** /delivery/{settle}/positions/{contract} | Get single position information [**update_delivery_position_margin**](DeliveryApi.md#update_delivery_position_margin) | **POST** /delivery/{settle}/positions/{contract}/margin | Update position margin [**update_delivery_position_leverage**](DeliveryApi.md#update_delivery_position_leverage) | **POST** /delivery/{settle}/positions/{contract}/leverage | Update position leverage [**update_delivery_position_risk_limit**](DeliveryApi.md#update_delivery_position_risk_limit) | **POST** /delivery/{settle}/positions/{contract}/risk_limit | Update position risk limit -[**list_delivery_orders**](DeliveryApi.md#list_delivery_orders) | **GET** /delivery/{settle}/orders | List futures orders -[**create_delivery_order**](DeliveryApi.md#create_delivery_order) | **POST** /delivery/{settle}/orders | Create a futures order -[**cancel_delivery_orders**](DeliveryApi.md#cancel_delivery_orders) | **DELETE** /delivery/{settle}/orders | Cancel all `open` orders matched -[**get_delivery_order**](DeliveryApi.md#get_delivery_order) | **GET** /delivery/{settle}/orders/{order_id} | Get a single order -[**cancel_delivery_order**](DeliveryApi.md#cancel_delivery_order) | **DELETE** /delivery/{settle}/orders/{order_id} | Cancel a single order -[**get_my_delivery_trades**](DeliveryApi.md#get_my_delivery_trades) | **GET** /delivery/{settle}/my_trades | List personal trading history -[**list_delivery_position_close**](DeliveryApi.md#list_delivery_position_close) | **GET** /delivery/{settle}/position_close | List position close history -[**list_delivery_liquidates**](DeliveryApi.md#list_delivery_liquidates) | **GET** /delivery/{settle}/liquidates | List liquidation history -[**list_delivery_settlements**](DeliveryApi.md#list_delivery_settlements) | **GET** /delivery/{settle}/settlements | List settlement history -[**list_price_triggered_delivery_orders**](DeliveryApi.md#list_price_triggered_delivery_orders) | **GET** /delivery/{settle}/price_orders | List all auto orders -[**create_price_triggered_delivery_order**](DeliveryApi.md#create_price_triggered_delivery_order) | **POST** /delivery/{settle}/price_orders | Create a price-triggered order -[**cancel_price_triggered_delivery_order_list**](DeliveryApi.md#cancel_price_triggered_delivery_order_list) | **DELETE** /delivery/{settle}/price_orders | Cancel all open orders -[**get_price_triggered_delivery_order**](DeliveryApi.md#get_price_triggered_delivery_order) | **GET** /delivery/{settle}/price_orders/{order_id} | Get a single order -[**cancel_price_triggered_delivery_order**](DeliveryApi.md#cancel_price_triggered_delivery_order) | **DELETE** /delivery/{settle}/price_orders/{order_id} | Cancel a single order +[**list_delivery_orders**](DeliveryApi.md#list_delivery_orders) | **GET** /delivery/{settle}/orders | Query futures order list +[**create_delivery_order**](DeliveryApi.md#create_delivery_order) | **POST** /delivery/{settle}/orders | Place futures order +[**cancel_delivery_orders**](DeliveryApi.md#cancel_delivery_orders) | **DELETE** /delivery/{settle}/orders | Cancel all orders with 'open' status +[**get_delivery_order**](DeliveryApi.md#get_delivery_order) | **GET** /delivery/{settle}/orders/{order_id} | Query single order details +[**cancel_delivery_order**](DeliveryApi.md#cancel_delivery_order) | **DELETE** /delivery/{settle}/orders/{order_id} | Cancel single order +[**get_my_delivery_trades**](DeliveryApi.md#get_my_delivery_trades) | **GET** /delivery/{settle}/my_trades | Query personal trading records +[**list_delivery_position_close**](DeliveryApi.md#list_delivery_position_close) | **GET** /delivery/{settle}/position_close | Query position close history +[**list_delivery_liquidates**](DeliveryApi.md#list_delivery_liquidates) | **GET** /delivery/{settle}/liquidates | Query liquidation history +[**list_delivery_settlements**](DeliveryApi.md#list_delivery_settlements) | **GET** /delivery/{settle}/settlements | Query settlement records +[**list_delivery_risk_limit_tiers**](DeliveryApi.md#list_delivery_risk_limit_tiers) | **GET** /delivery/{settle}/risk_limit_tiers | Query risk limit tiers +[**list_price_triggered_delivery_orders**](DeliveryApi.md#list_price_triggered_delivery_orders) | **GET** /delivery/{settle}/price_orders | Query auto order list +[**create_price_triggered_delivery_order**](DeliveryApi.md#create_price_triggered_delivery_order) | **POST** /delivery/{settle}/price_orders | Create price-triggered order +[**cancel_price_triggered_delivery_order_list**](DeliveryApi.md#cancel_price_triggered_delivery_order_list) | **DELETE** /delivery/{settle}/price_orders | Cancel all auto orders +[**get_price_triggered_delivery_order**](DeliveryApi.md#get_price_triggered_delivery_order) | **GET** /delivery/{settle}/price_orders/{order_id} | Query single auto order details +[**cancel_price_triggered_delivery_order**](DeliveryApi.md#cancel_price_triggered_delivery_order) | **DELETE** /delivery/{settle}/price_orders/{order_id} | Cancel single auto order # **list_delivery_contracts** > list[DeliveryContract] list_delivery_contracts(settle) -List all futures contracts +Query all futures contracts ### Example @@ -57,7 +58,7 @@ api_instance = gate_api.DeliveryApi(api_client) settle = 'usdt' # str | Settle currency try: - # List all futures contracts + # Query all futures contracts api_response = api_instance.list_delivery_contracts(settle) print(api_response) except GateApiException as ex: @@ -88,14 +89,14 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**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_delivery_contract** > DeliveryContract get_delivery_contract(settle, contract) -Get a single contract +Query single contract information ### Example @@ -116,7 +117,7 @@ settle = 'usdt' # str | Settle currency contract = 'BTC_USDT_20200814' # str | Futures contract try: - # Get a single contract + # Query single contract information api_response = api_instance.get_delivery_contract(settle, contract) print(api_response) except GateApiException as ex: @@ -155,7 +156,7 @@ No authorization required # **list_delivery_order_book** > FuturesOrderBook list_delivery_order_book(settle, contract, interval=interval, limit=limit, with_id=with_id) -Futures order book +Query futures market depth information Bids will be sorted by price from high to low, while asks sorted reversely @@ -176,12 +177,12 @@ 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 | Order depth. 0 means no aggregation is applied. default to 0 (optional) (default to '0') -limit = 10 # int | Maximum number of order depth data in asks or bids (optional) (default to 10) -with_id = False # bool | Whether the order book update ID will be returned. This ID increases by 1 on every order book update (optional) (default to False) +interval = '0' # str | Price precision for depth aggregation, 0 means no aggregation, defaults to 0 if not specified (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 depth changes (optional) (default to False) try: - # Futures order book + # Query futures market depth information api_response = api_instance.list_delivery_order_book(settle, contract, interval=interval, limit=limit, with_id=with_id) print(api_response) except GateApiException as ex: @@ -196,9 +197,9 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | **contract** | **str**| Futures contract | - **interval** | **str**| Order depth. 0 means no aggregation is applied. default to 0 | [optional] [default to '0'] - **limit** | **int**| Maximum number of order depth data in asks or bids | [optional] [default to 10] - **with_id** | **bool**| Whether the order book update ID will be returned. This ID increases by 1 on every order book update | [optional] [default to False] + **interval** | **str**| Price precision for depth aggregation, 0 means no aggregation, defaults to 0 if not specified | [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 depth changes | [optional] [default to False] ### Return type @@ -216,14 +217,14 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Order book retrieved | - | +**200** | Depth 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_delivery_trades** > list[FuturesTrade] list_delivery_trades(settle, contract, limit=limit, last_id=last_id, _from=_from, to=to) -Futures trading history +Futures market transaction records ### Example @@ -242,13 +243,13 @@ 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 -limit = 100 # int | Maximum number of records to be returned in a single list (optional) (default to 100) -last_id = '12345' # str | Specify the starting point for this list based on a previously retrieved id This parameter is deprecated. Use `from` and `to` instead to limit time range (optional) +limit = 100 # int | Maximum number of records returned in a single list (optional) (default to 100) +last_id = '12345' # str | Use the ID of the last record in the previous list as the starting point for the next list.This field is no longer supported. For new requests, please use the fromand tofields to specify the time rang (optional) _from = 1546905600 # int | Specify starting time in Unix seconds. If not specified, `to` and `limit` will be used to limit response items. If items between `from` and `to` are more than `limit`, only `limit` number will be returned. (optional) -to = 1546935600 # int | Specify end time in Unix seconds, default to current time (optional) +to = 1546935600 # int | Specify end time in Unix seconds, default to current time. (optional) try: - # Futures trading history + # Futures market transaction records api_response = api_instance.list_delivery_trades(settle, contract, limit=limit, last_id=last_id, _from=_from, to=to) print(api_response) except GateApiException as ex: @@ -263,10 +264,10 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | **contract** | **str**| Futures contract | - **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] - **last_id** | **str**| Specify the starting point for this list based on a previously retrieved id This parameter is deprecated. Use `from` and `to` instead to limit time range | [optional] + **limit** | **int**| Maximum number of records returned in a single list | [optional] [default to 100] + **last_id** | **str**| Use the ID of the last record in the previous list as the starting point for the next list.This field is no longer supported. For new requests, please use the fromand tofields to specify the time rang | [optional] **_from** | **int**| Specify starting time in Unix seconds. If not specified, `to` and `limit` will be used to limit response items. If items between `from` and `to` are more than `limit`, only `limit` number will be returned. | [optional] - **to** | **int**| Specify end time in Unix seconds, default to current time | [optional] + **to** | **int**| Specify end time in Unix seconds, default to current time. | [optional] ### Return type @@ -284,14 +285,14 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**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_delivery_candlesticks** -> list[FuturesCandlestick] list_delivery_candlesticks(settle, contract, _from=_from, to=to, limit=limit, interval=interval) +> list[DeliveryCandlestick] list_delivery_candlesticks(settle, contract, _from=_from, to=to, limit=limit, interval=interval) -Get futures candlesticks +Futures market K-line chart Return specified contract candlesticks. If prefix `contract` with `mark_`, the contract's mark price candlesticks are returned; if prefix with `index_`, index price candlesticks will be returned. Maximum of 2000 points are returned in one query. Be sure not to exceed the limit when specifying `from`, `to` and `interval` @@ -313,12 +314,12 @@ api_instance = gate_api.DeliveryApi(api_client) settle = 'usdt' # str | Settle currency contract = 'BTC_USDT_20200814' # 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 | End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time (optional) -limit = 100 # int | Maximum recent data points to return. `limit` is conflicted 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 (optional) (default to '5m') +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 | Time interval between data points, note that 1w represents a natural week, 7d time is aligned with Unix initial time (optional) (default to '5m') try: - # Get futures candlesticks + # Futures market K-line chart api_response = api_instance.list_delivery_candlesticks(settle, contract, _from=_from, to=to, limit=limit, interval=interval) print(api_response) except GateApiException as ex: @@ -334,13 +335,13 @@ Name | Type | Description | Notes **settle** | **str**| Settle currency | **contract** | **str**| Futures contract | **_from** | **int**| Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified | [optional] - **to** | **int**| End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time | [optional] - **limit** | **int**| Maximum recent data points to return. `limit` is conflicted 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 | [optional] [default to '5m'] + **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**| Time interval between data points, note that 1w represents a natural week, 7d time is aligned with Unix initial time | [optional] [default to '5m'] ### Return type -[**list[FuturesCandlestick]**](FuturesCandlestick.md) +[**list[DeliveryCandlestick]**](DeliveryCandlestick.md) ### Authorization @@ -354,14 +355,14 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**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_delivery_tickers** -> list[FuturesTicker] list_delivery_tickers(settle, contract=contract) +> list[DeliveryTicker] list_delivery_tickers(settle, contract=contract) -List futures tickers +Get all futures trading statistics ### Example @@ -382,7 +383,7 @@ settle = 'usdt' # str | Settle currency contract = 'BTC_USDT_20200814' # str | Futures contract (optional) try: - # List futures tickers + # Get all futures trading statistics api_response = api_instance.list_delivery_tickers(settle, contract=contract) print(api_response) except GateApiException as ex: @@ -400,7 +401,7 @@ Name | Type | Description | Notes ### Return type -[**list[FuturesTicker]**](FuturesTicker.md) +[**list[DeliveryTicker]**](DeliveryTicker.md) ### Authorization @@ -414,14 +415,14 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**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_delivery_insurance_ledger** > list[InsuranceRecord] list_delivery_insurance_ledger(settle, limit=limit) -Futures insurance balance history +Futures market insurance fund history ### Example @@ -439,10 +440,10 @@ api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.DeliveryApi(api_client) settle = 'usdt' # str | Settle currency -limit = 100 # int | Maximum number of records to be returned in a single list (optional) (default to 100) +limit = 100 # int | Maximum number of records returned in a single list (optional) (default to 100) try: - # Futures insurance balance history + # Futures market insurance fund history api_response = api_instance.list_delivery_insurance_ledger(settle, limit=limit) print(api_response) except GateApiException as ex: @@ -456,7 +457,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | - **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] + **limit** | **int**| Maximum number of records returned in a single list | [optional] [default to 100] ### Return type @@ -474,14 +475,14 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**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_delivery_accounts** > FuturesAccount list_delivery_accounts(settle) -Query futures account +Get futures account ### Example @@ -510,7 +511,7 @@ api_instance = gate_api.DeliveryApi(api_client) settle = 'usdt' # str | Settle currency try: - # Query futures account + # Get futures account api_response = api_instance.list_delivery_accounts(settle) print(api_response) except GateApiException as ex: @@ -541,14 +542,14 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**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_delivery_account_book** > list[FuturesAccountBook] list_delivery_account_book(settle, limit=limit, _from=_from, to=to, type=type) -Query account book +Query futures account change history ### Example @@ -575,13 +576,13 @@ api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.DeliveryApi(api_client) settle = 'usdt' # str | Settle currency -limit = 100 # int | Maximum number of records to be returned in a single list (optional) (default to 100) -_from = 1547706332 # int | Start timestamp (optional) -to = 1547706332 # int | End timestamp (optional) -type = 'dnw' # str | Changing Type: - dnw: Deposit & Withdraw - pnl: Profit & Loss by reducing position - fee: Trading fee - refr: Referrer rebate - fund: Funding - point_dnw: POINT Deposit & Withdraw - point_fee: POINT Trading fee - point_refr: POINT Referrer rebate (optional) +limit = 100 # int | Maximum number of records returned in a single list (optional) (default to 100) +_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) +type = 'dnw' # str | Change types: - dnw: Deposit and withdrawal - pnl: Profit and loss from position reduction - fee: Trading fees - refr: Referrer rebates - fund: Funding fees - point_dnw: Point card deposit and withdrawal - point_fee: Point card trading fees - point_refr: Point card referrer rebates (optional) try: - # Query account book + # Query futures account change history api_response = api_instance.list_delivery_account_book(settle, limit=limit, _from=_from, to=to, type=type) print(api_response) except GateApiException as ex: @@ -595,10 +596,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | - **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] - **_from** | **int**| Start timestamp | [optional] - **to** | **int**| End timestamp | [optional] - **type** | **str**| Changing Type: - dnw: Deposit & Withdraw - pnl: Profit & Loss by reducing position - fee: Trading fee - refr: Referrer rebate - fund: Funding - point_dnw: POINT Deposit & Withdraw - point_fee: POINT Trading fee - point_refr: POINT Referrer rebate | [optional] + **limit** | **int**| Maximum number of records returned in a single list | [optional] [default to 100] + **_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] + **type** | **str**| Change types: - dnw: Deposit and withdrawal - pnl: Profit and loss from position reduction - fee: Trading fees - refr: Referrer rebates - fund: Funding fees - point_dnw: Point card deposit and withdrawal - point_fee: Point card trading fees - point_refr: Point card referrer rebates | [optional] ### Return type @@ -616,14 +617,14 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**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_delivery_positions** > list[Position] list_delivery_positions(settle) -List all positions of a user +Get user position list ### Example @@ -652,7 +653,7 @@ api_instance = gate_api.DeliveryApi(api_client) settle = 'usdt' # str | Settle currency try: - # List all positions of a user + # Get user position list api_response = api_instance.list_delivery_positions(settle) print(api_response) except GateApiException as ex: @@ -683,14 +684,14 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**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_delivery_position** > Position get_delivery_position(settle, contract) -Get single position +Get single position information ### Example @@ -720,7 +721,7 @@ settle = 'usdt' # str | Settle currency contract = 'BTC_USDT_20200814' # str | Futures contract try: - # Get single position + # Get single position information api_response = api_instance.get_delivery_position(settle, contract) print(api_response) except GateApiException as ex: @@ -787,7 +788,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 -change = '0.01' # str | Margin change. Use positive number to increase margin, negative number otherwise. +change = '0.01' # str | Margin change amount, positive number increases, negative number decreases try: # Update position margin @@ -805,7 +806,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | **contract** | **str**| Futures contract | - **change** | **str**| Margin change. Use positive number to increase margin, negative number otherwise. | + **change** | **str**| Margin change amount, positive number increases, negative number decreases | ### Return type @@ -972,9 +973,9 @@ Name | Type | Description | Notes # **list_delivery_orders** > list[FuturesOrder] list_delivery_orders(settle, status, contract=contract, limit=limit, offset=offset, last_id=last_id, count_total=count_total) -List futures orders +Query futures order list -Zero-fill order cannot be retrieved for 60 seconds after cancellation +Zero-fill orders cannot be retrieved 10 minutes after order cancellation ### Example @@ -1001,15 +1002,15 @@ api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.DeliveryApi(api_client) settle = 'usdt' # str | Settle currency -status = 'open' # str | Only list the orders with this status +status = 'open' # str | Query order list based on status contract = 'BTC_USDT_20200814' # str | Futures contract (optional) -limit = 100 # int | Maximum number of records to be returned in a single list (optional) (default to 100) +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 list staring point using the `id` of last record in previous list-query results (optional) -count_total = 0 # int | Whether to return total number matched. Default to 0(no return) (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) +count_total = 0 # int | Whether to return total number matched, defaults to 0 (no return) (optional) (default to 0) try: - # List futures orders + # Query futures order list api_response = api_instance.list_delivery_orders(settle, status, contract=contract, limit=limit, offset=offset, last_id=last_id, count_total=count_total) print(api_response) except GateApiException as ex: @@ -1023,12 +1024,12 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | - **status** | **str**| Only list the orders with this status | + **status** | **str**| Query order list based on status | **contract** | **str**| Futures contract | [optional] - **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] + **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 list staring point using the `id` of last record in previous list-query results | [optional] - **count_total** | **int**| Whether to return total number matched. Default to 0(no return) | [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] + **count_total** | **int**| Whether to return total number matched, defaults to 0 (no return) | [optional] [default to 0] ### Return type @@ -1046,16 +1047,16 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | * X-Pagination-Limit - Request limit specified
* X-Pagination-Offset - Request offset specified
* X-Pagination-Total - Total number matched. Only returned if `count_total` set to 1
| +**200** | List retrieved successfully | * X-Pagination-Limit - Limit specified for pagination
* X-Pagination-Offset - Offset specified for pagination
* X-Pagination-Total - Total number matched, only returned if `count_total` is set to 1
| [[Back to top]](#) [[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_delivery_order** > FuturesOrder create_delivery_order(settle, futures_order) -Create a futures order +Place futures order -Zero-fill order cannot be retrieved for 60 seconds after cancellation +Zero-fill orders cannot be retrieved 10 minutes after order cancellation ### Example @@ -1085,7 +1086,7 @@ settle = 'usdt' # str | Settle currency futures_order = gate_api.FuturesOrder() # FuturesOrder | try: - # Create a futures order + # Place futures order api_response = api_instance.create_delivery_order(settle, futures_order) print(api_response) except GateApiException as ex: @@ -1124,9 +1125,9 @@ Name | Type | Description | Notes # **cancel_delivery_orders** > list[FuturesOrder] cancel_delivery_orders(settle, contract, side=side) -Cancel all `open` orders matched +Cancel all orders with 'open' status -Zero-fill order cannot be retrieved for 60 seconds after cancellation +Zero-fill orders cannot be retrieved 10 minutes after order cancellation ### Example @@ -1154,10 +1155,10 @@ 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 -side = 'ask' # str | All bids or asks. Both included if not specified (optional) +side = 'ask' # str | Specify all bids or all asks, both included if not specified (optional) try: - # Cancel all `open` orders matched + # Cancel all orders with 'open' status api_response = api_instance.cancel_delivery_orders(settle, contract, side=side) print(api_response) except GateApiException as ex: @@ -1172,7 +1173,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | **contract** | **str**| Futures contract | - **side** | **str**| All bids or asks. Both included if not specified | [optional] + **side** | **str**| Specify all bids or all asks, both included if not specified | [optional] ### Return type @@ -1190,16 +1191,16 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | All orders matched cancelled | - | +**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_delivery_order** > FuturesOrder get_delivery_order(settle, order_id) -Get a single order +Query single order details -Zero-fill order cannot be retrieved for 60 seconds after cancellation +Zero-fill orders cannot be retrieved 10 minutes after order cancellation ### Example @@ -1226,10 +1227,10 @@ api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.DeliveryApi(api_client) settle = 'usdt' # str | Settle currency -order_id = '12345' # str | Retrieve the data of the order with the specified ID +order_id = '12345' # str | ID returned when order is successfully created try: - # Get a single order + # Query single order details api_response = api_instance.get_delivery_order(settle, order_id) print(api_response) except GateApiException as ex: @@ -1243,7 +1244,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | - **order_id** | **str**| Retrieve the data of the order with the specified ID | + **order_id** | **str**| ID returned when order is successfully created | ### Return type @@ -1268,7 +1269,7 @@ Name | Type | Description | Notes # **cancel_delivery_order** > FuturesOrder cancel_delivery_order(settle, order_id) -Cancel a single order +Cancel single order ### Example @@ -1295,10 +1296,10 @@ api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.DeliveryApi(api_client) settle = 'usdt' # str | Settle currency -order_id = '12345' # str | Retrieve the data of the order with the specified ID +order_id = '12345' # str | ID returned when order is successfully created try: - # Cancel a single order + # Cancel single order api_response = api_instance.cancel_delivery_order(settle, order_id) print(api_response) except GateApiException as ex: @@ -1312,7 +1313,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | - **order_id** | **str**| Retrieve the data of the order with the specified ID | + **order_id** | **str**| ID returned when order is successfully created | ### Return type @@ -1337,7 +1338,7 @@ Name | Type | Description | Notes # **get_my_delivery_trades** > list[MyFuturesTrade] get_my_delivery_trades(settle, contract=contract, order=order, limit=limit, offset=offset, last_id=last_id, count_total=count_total) -List personal trading history +Query personal trading records ### Example @@ -1366,13 +1367,13 @@ api_instance = gate_api.DeliveryApi(api_client) settle = 'usdt' # str | Settle currency contract = 'BTC_USDT_20200814' # str | Futures contract (optional) order = 12345 # int | Futures order ID, return related data only if specified (optional) -limit = 100 # int | Maximum number of records to be returned in a single list (optional) (default to 100) +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 list staring point using the `id` of last record in previous list-query results (optional) -count_total = 0 # int | Whether to return total number matched. Default to 0(no return) (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) +count_total = 0 # int | Whether to return total number matched, defaults to 0 (no return) (optional) (default to 0) try: - # List personal trading history + # Query personal trading records api_response = api_instance.get_my_delivery_trades(settle, contract=contract, order=order, limit=limit, offset=offset, last_id=last_id, count_total=count_total) print(api_response) except GateApiException as ex: @@ -1388,10 +1389,10 @@ Name | Type | Description | Notes **settle** | **str**| Settle currency | **contract** | **str**| Futures contract | [optional] **order** | **int**| Futures order ID, return related data only if specified | [optional] - **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] + **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 list staring point using the `id` of last record in previous list-query results | [optional] - **count_total** | **int**| Whether to return total number matched. Default to 0(no return) | [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] + **count_total** | **int**| Whether to return total number matched, defaults to 0 (no return) | [optional] [default to 0] ### Return type @@ -1409,14 +1410,14 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | * X-Pagination-Limit - Request limit specified
* X-Pagination-Offset - Request offset specified
* X-Pagination-Total - Total number matched. Only returned if `count_total` set to 1
| +**200** | List retrieved successfully | * X-Pagination-Limit - Limit specified for pagination
* X-Pagination-Offset - Offset specified for pagination
* X-Pagination-Total - Total number matched, only returned if `count_total` is set to 1
| [[Back to top]](#) [[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_delivery_position_close** > list[PositionClose] list_delivery_position_close(settle, contract=contract, limit=limit) -List position close history +Query position close history ### Example @@ -1444,10 +1445,10 @@ 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 (optional) -limit = 100 # int | Maximum number of records to be returned in a single list (optional) (default to 100) +limit = 100 # int | Maximum number of records returned in a single list (optional) (default to 100) try: - # List position close history + # Query position close history api_response = api_instance.list_delivery_position_close(settle, contract=contract, limit=limit) print(api_response) except GateApiException as ex: @@ -1462,7 +1463,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | **contract** | **str**| Futures contract | [optional] - **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] + **limit** | **int**| Maximum number of records returned in a single list | [optional] [default to 100] ### Return type @@ -1480,14 +1481,14 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**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_delivery_liquidates** > list[FuturesLiquidate] list_delivery_liquidates(settle, contract=contract, limit=limit, at=at) -List liquidation history +Query liquidation history ### Example @@ -1515,11 +1516,11 @@ 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 (optional) -limit = 100 # int | Maximum number of records to be returned in a single list (optional) (default to 100) -at = 0 # int | Specify a liquidation timestamp (optional) (default to 0) +limit = 100 # int | Maximum number of records returned in a single list (optional) (default to 100) +at = 0 # int | Specify liquidation timestamp (optional) (default to 0) try: - # List liquidation history + # Query liquidation history api_response = api_instance.list_delivery_liquidates(settle, contract=contract, limit=limit, at=at) print(api_response) except GateApiException as ex: @@ -1534,8 +1535,8 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | **contract** | **str**| Futures contract | [optional] - **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] - **at** | **int**| Specify a liquidation timestamp | [optional] [default to 0] + **limit** | **int**| Maximum number of records returned in a single list | [optional] [default to 100] + **at** | **int**| Specify liquidation timestamp | [optional] [default to 0] ### Return type @@ -1553,14 +1554,14 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**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_delivery_settlements** > list[DeliverySettlement] list_delivery_settlements(settle, contract=contract, limit=limit, at=at) -List settlement history +Query settlement records ### Example @@ -1588,11 +1589,11 @@ 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 (optional) -limit = 100 # int | Maximum number of records to be returned in a single list (optional) (default to 100) -at = 0 # int | Specify a settlement timestamp (optional) (default to 0) +limit = 100 # int | Maximum number of records returned in a single list (optional) (default to 100) +at = 0 # int | Specify settlement timestamp (optional) (default to 0) try: - # List settlement history + # Query settlement records api_response = api_instance.list_delivery_settlements(settle, contract=contract, limit=limit, at=at) print(api_response) except GateApiException as ex: @@ -1607,8 +1608,8 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | **contract** | **str**| Futures contract | [optional] - **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] - **at** | **int**| Specify a settlement timestamp | [optional] [default to 0] + **limit** | **int**| Maximum number of records returned in a single list | [optional] [default to 100] + **at** | **int**| Specify settlement timestamp | [optional] [default to 0] ### Return type @@ -1626,14 +1627,80 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**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_delivery_risk_limit_tiers** +> list[FuturesLimitRiskTiers] list_delivery_risk_limit_tiers(settle, contract=contract, limit=limit, offset=offset) + +Query risk limit tiers + +When the 'contract' parameter is not passed, the default is to query the risk limits for the top 100 markets. 'Limit' and 'offset' correspond to pagination queries at the market level, not to the length of the returned array. This only takes effect when the contract parameter is empty. + +### 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.DeliveryApi(api_client) +settle = 'usdt' # str | Settle currency +contract = 'BTC_USDT_20200814' # str | Futures contract (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 risk limit tiers + api_response = api_instance.list_delivery_risk_limit_tiers(settle, contract=contract, 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 DeliveryApi->list_delivery_risk_limit_tiers: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **settle** | **str**| Settle currency | + **contract** | **str**| Futures contract | [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[FuturesLimitRiskTiers]**](FuturesLimitRiskTiers.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) # **list_price_triggered_delivery_orders** > list[FuturesPriceTriggeredOrder] list_price_triggered_delivery_orders(settle, status, contract=contract, limit=limit, offset=offset) -List all auto orders +Query auto order list ### Example @@ -1660,13 +1727,13 @@ api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.DeliveryApi(api_client) settle = 'usdt' # str | Settle currency -status = 'status_example' # str | Only list the orders with this status +status = 'status_example' # 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 to be returned in a single list (optional) (default to 100) +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: - # List all auto orders + # Query auto order list api_response = api_instance.list_price_triggered_delivery_orders(settle, status, contract=contract, limit=limit, offset=offset) print(api_response) except GateApiException as ex: @@ -1680,9 +1747,9 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | - **status** | **str**| Only list the orders with this status | + **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 to be returned in a single list | [optional] [default to 100] + **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 @@ -1701,14 +1768,14 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**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) # **create_price_triggered_delivery_order** > TriggerOrderResponse create_price_triggered_delivery_order(settle, futures_price_triggered_order) -Create a price-triggered order +Create price-triggered order ### Example @@ -1738,7 +1805,7 @@ settle = 'usdt' # str | Settle currency futures_price_triggered_order = gate_api.FuturesPriceTriggeredOrder() # FuturesPriceTriggeredOrder | try: - # Create a price-triggered order + # Create price-triggered order api_response = api_instance.create_price_triggered_delivery_order(settle, futures_price_triggered_order) print(api_response) except GateApiException as ex: @@ -1770,14 +1837,14 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**201** | Order created | - | +**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_price_triggered_delivery_order_list** > list[FuturesPriceTriggeredOrder] cancel_price_triggered_delivery_order_list(settle, contract) -Cancel all open orders +Cancel all auto orders ### Example @@ -1807,7 +1874,7 @@ settle = 'usdt' # str | Settle currency contract = 'BTC_USDT' # str | Futures contract try: - # Cancel all open orders + # Cancel all auto orders api_response = api_instance.cancel_price_triggered_delivery_order_list(settle, contract) print(api_response) except GateApiException as ex: @@ -1839,14 +1906,14 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Batch cancellation request accepted. Query order status by listing orders | - | +**200** | Batch cancellation request accepted and processed, success determined by 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_price_triggered_delivery_order** > FuturesPriceTriggeredOrder get_price_triggered_delivery_order(settle, order_id) -Get a single order +Query single auto order details ### Example @@ -1873,10 +1940,10 @@ api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.DeliveryApi(api_client) settle = 'usdt' # str | Settle currency -order_id = 'order_id_example' # str | Retrieve the data of the order with the specified ID +order_id = 'order_id_example' # str | ID returned when order is successfully created try: - # Get a single order + # Query single auto order details api_response = api_instance.get_price_triggered_delivery_order(settle, order_id) print(api_response) except GateApiException as ex: @@ -1890,7 +1957,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | - **order_id** | **str**| Retrieve the data of the order with the specified ID | + **order_id** | **str**| ID returned when order is successfully created | ### Return type @@ -1908,14 +1975,14 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Auto order detail | - | +**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_delivery_order** > FuturesPriceTriggeredOrder cancel_price_triggered_delivery_order(settle, order_id) -Cancel a single order +Cancel single auto order ### Example @@ -1942,10 +2009,10 @@ api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.DeliveryApi(api_client) settle = 'usdt' # str | Settle currency -order_id = 'order_id_example' # str | Retrieve the data of the order with the specified ID +order_id = 'order_id_example' # str | ID returned when order is successfully created try: - # Cancel a single order + # Cancel single auto order api_response = api_instance.cancel_price_triggered_delivery_order(settle, order_id) print(api_response) except GateApiException as ex: @@ -1959,7 +2026,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | - **order_id** | **str**| Retrieve the data of the order with the specified ID | + **order_id** | **str**| ID returned when order is successfully created | ### Return type @@ -1977,7 +2044,7 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Auto order detail | - | +**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) diff --git a/docs/DeliveryCandlestick.md b/docs/DeliveryCandlestick.md new file mode 100644 index 0000000..16cbd49 --- /dev/null +++ b/docs/DeliveryCandlestick.md @@ -0,0 +1,16 @@ +# DeliveryCandlestick + +data point in every timestamp +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**t** | **float** | Unix timestamp in seconds | [optional] +**v** | **int** | size volume (contract size). Only returned if `contract` is not prefixed | [optional] +**c** | **str** | Close price (quote currency) | [optional] +**h** | **str** | Highest price (quote currency) | [optional] +**l** | **str** | Lowest price (quote currency) | [optional] +**o** | **str** | Open price (quote 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/DeliveryContract.md b/docs/DeliveryContract.md index 069eb7b..9675b71 100644 --- a/docs/DeliveryContract.md +++ b/docs/DeliveryContract.md @@ -7,16 +7,16 @@ Name | Type | Description | Notes **name** | **str** | Futures contract | [optional] **underlying** | **str** | Underlying | [optional] **cycle** | **str** | Cycle type, e.g. WEEKLY, QUARTERLY | [optional] -**type** | **str** | Futures contract type | [optional] +**type** | **str** | Contract type: inverse - inverse contract, direct - direct contract | [optional] **quanto_multiplier** | **str** | Multiplier used in converting from invoicing to settlement currency | [optional] **leverage_min** | **str** | Minimum leverage | [optional] **leverage_max** | **str** | Maximum leverage | [optional] **maintenance_rate** | **str** | Maintenance rate of margin | [optional] -**mark_type** | **str** | Mark price type, internal - based on internal trading, index - based on external index price | [optional] +**mark_type** | **str** | Mark price type: internal - internal trading price, index - external index price | [optional] **mark_price** | **str** | Current mark price | [optional] **index_price** | **str** | Current index price | [optional] **last_price** | **str** | Last trading price | [optional] -**maker_fee_rate** | **str** | Maker fee rate, where negative means rebate | [optional] +**maker_fee_rate** | **str** | Maker fee rate, negative values indicate rebates | [optional] **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] @@ -30,18 +30,18 @@ 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 the contract allowed | [optional] -**order_size_max** | **int** | Maximum order size the contract allowed | [optional] -**order_price_deviate** | **str** | deviation between order price and current index price. If price of an order is denoted as order_price, it must meet the following condition: abs(order_price - mark_price) <= mark_price * order_price_deviate | [optional] -**ref_discount_rate** | **str** | Referral fee rate discount | [optional] -**ref_rebate_rate** | **str** | Referrer commission rate | [optional] -**orderbook_id** | **int** | Current orderbook ID | [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_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] +**orderbook_id** | **int** | Orderbook update ID | [optional] **trade_id** | **int** | Current trade ID | [optional] -**trade_size** | **int** | Historical accumulated trade size | [optional] +**trade_size** | **int** | Historical cumulative trading volume | [optional] **position_size** | **int** | Current total long position size | [optional] -**config_change_time** | **float** | Last changed time of configuration | [optional] +**config_change_time** | **float** | Last configuration update time | [optional] **in_delisting** | **bool** | Contract is delisting | [optional] -**orders_limit** | **int** | Maximum number of open orders | [optional] +**orders_limit** | **int** | Maximum number of pending 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/DeliveryTicker.md b/docs/DeliveryTicker.md new file mode 100644 index 0000000..b8de016 --- /dev/null +++ b/docs/DeliveryTicker.md @@ -0,0 +1,32 @@ +# DeliveryTicker + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**contract** | **str** | Futures contract | [optional] +**last** | **str** | Last trading price | [optional] +**change_percentage** | **str** | Price change percentage. Negative values indicate price decrease, e.g. -7.45 | [optional] +**total_size** | **str** | Contract total size | [optional] +**low_24h** | **str** | 24-hour lowest price | [optional] +**high_24h** | **str** | 24-hour highest price | [optional] +**volume_24h** | **str** | 24-hour trading volume | [optional] +**volume_24h_btc** | **str** | 24-hour trading volume in BTC (deprecated, use `volume_24h_base`, `volume_24h_quote`, `volume_24h_settle` instead) | [optional] +**volume_24h_usd** | **str** | 24-hour trading volume in USD (deprecated, use `volume_24h_base`, `volume_24h_quote`, `volume_24h_settle` instead) | [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] +**volume_24h_settle** | **str** | 24-hour trading volume in settle currency | [optional] +**mark_price** | **str** | Recent mark price | [optional] +**funding_rate** | **str** | Funding rate | [optional] +**funding_rate_indicative** | **str** | Indicative Funding rate in next period. (deprecated. use `funding_rate`) | [optional] +**index_price** | **str** | Index price | [optional] +**quanto_base_rate** | **str** | Exchange rate of base currency and settlement currency in Quanto contract. Does not exists in contracts of other types | [optional] +**basis_rate** | **str** | Basis rate | [optional] +**basis_value** | **str** | Basis value | [optional] +**lowest_ask** | **str** | Recent lowest ask | [optional] +**lowest_size** | **str** | The latest seller's lowest price order quantity | [optional] +**highest_bid** | **str** | Recent highest bid | [optional] +**highest_size** | **str** | The latest buyer's highest price order volume | [optional] + +[[Back to Model list]](../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 new file mode 100644 index 0000000..e5fa3b5 --- /dev/null +++ b/docs/DepositRecord.md @@ -0,0 +1,19 @@ +# DepositRecord + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Record ID | [optional] [readonly] +**txid** | **str** | Hash record of the withdrawal | [optional] [readonly] +**withdraw_order_id** | **str** | Client order id, up to 32 length and can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) | [optional] +**timestamp** | **str** | Operation time | [optional] [readonly] +**amount** | **str** | Token amount | +**currency** | **str** | Currency name | +**address** | **str** | Withdrawal address. Required for withdrawals | [optional] +**memo** | **str** | Additional remarks with regards to the withdrawal | [optional] +**status** | **str** | Trading Status - REVIEW: Recharge review (compliance review) - PEND: Processing - DONE: Waiting for funds to be unlocked - INVALID: Invalid data - TRACK: Track the number of confirmations, waiting to add funds to the user (spot) - BLOCKED: Rejected Recharge - DEP_CREDITED: Recharge to account, withdrawal is not unlocked | [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/DualGetOrders.md b/docs/DualGetOrders.md new file mode 100644 index 0000000..91f79de --- /dev/null +++ b/docs/DualGetOrders.md @@ -0,0 +1,26 @@ +# DualGetOrders + +## Properties +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] +**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/DualGetPlans.md b/docs/DualGetPlans.md new file mode 100644 index 0000000..53b3a58 --- /dev/null +++ b/docs/DualGetPlans.md @@ -0,0 +1,22 @@ +# DualGetPlans + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Product ID | [optional] +**instrument_name** | **str** | Product Name | [optional] +**invest_currency** | **str** | Investment Token | [optional] +**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] +**start_time** | **int** | Start Time | [optional] +**end_time** | **int** | End time | [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/EarnApi.md b/docs/EarnApi.md new file mode 100644 index 0000000..a2b83b8 --- /dev/null +++ b/docs/EarnApi.md @@ -0,0 +1,683 @@ +# gate_api.EarnApi + +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 | ETH2 swap +[**rate_list_eth2**](EarnApi.md#rate_list_eth2) | **GET** /earn/staking/eth2/rate_records | ETH2 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 +[**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 + + +# **swap_eth2** +> swap_eth2(eth2_swap) + +ETH2 swap + +### 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) +eth2_swap = gate_api.Eth2Swap() # Eth2Swap | + +try: + # ETH2 swap + api_instance.swap_eth2(eth2_swap) +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) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **eth2_swap** | [**Eth2Swap**](Eth2Swap.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** | Swap 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) + +# **rate_list_eth2** +> list[Eth2RateList] rate_list_eth2() + +ETH2 historical return rate query + +Query ETH earnings rate records for the last 31 days + +### 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: + # ETH2 historical return rate query + api_response = api_instance.rate_list_eth2() + 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) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**list[Eth2RateList]**](Eth2RateList.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_dual_investment_plans** +> list[DualGetPlans] list_dual_investment_plans(plan_id=plan_id) + +Dual Investment product 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.EarnApi(api_client) +plan_id = 1 # int | Financial project ID (optional) + +try: + # Dual Investment product list + api_response = api_instance.list_dual_investment_plans(plan_id=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->list_dual_investment_plans: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **plan_id** | **int**| Financial project ID | [optional] + +### Return type + +[**list[DualGetPlans]**](DualGetPlans.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 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_dual_orders** +> list[DualGetOrders] list_dual_orders(_from=_from, to=to, page=page, limit=limit) + +Dual Investment 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.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) + 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) +``` + +### 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] + +### Return type + +[**list[DualGetOrders]**](DualGetOrders.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) + +# **place_dual_order** +> place_dual_order(place_dual_investment_order) + +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", + 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) +place_dual_investment_order = gate_api.PlaceDualInvestmentOrder() # PlaceDualInvestmentOrder | + +try: + # Place Dual Investment order + api_instance.place_dual_order(place_dual_investment_order) +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) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **place_dual_investment_order** | [**PlaceDualInvestmentOrder**](PlaceDualInvestmentOrder.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** | 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_structured_products** +> list[StructuredGetProjectList] list_structured_products(status, type=type, page=page, limit=limit) + +Structured Product 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.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) + +try: + # Structured Product List + api_response = api_instance.list_structured_products(status, type=type, 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->list_structured_products: %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] + +### Return type + +[**list[StructuredGetProjectList]**](StructuredGetProjectList.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 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_orders** +> list[StructuredOrderList] list_structured_orders(_from=_from, to=to, page=page, limit=limit) + +Structured Product 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.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) + +try: + # Structured Product Order List + api_response = api_instance.list_structured_orders(_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 EarnApi->list_structured_orders: %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] + +### Return type + +[**list[StructuredOrderList]**](StructuredOrderList.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) + +# **place_structured_order** +> place_structured_order(structured_buy) + +Place Structured Product 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.EarnApi(api_client) +structured_buy = gate_api.StructuredBuy() # StructuredBuy | + +try: + # Place Structured Product Order + api_instance.place_structured_order(structured_buy) +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) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **structured_buy** | [**StructuredBuy**](StructuredBuy.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** | 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) + +# **find_coin** +> object find_coin(find_coin) + +Staking coins + +### 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) +find_coin = gate_api.FindCoin() # FindCoin | + +try: + # Staking coins + api_response = api_instance.find_coin(find_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 EarnApi->find_coin: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **find_coin** | [**FindCoin**](FindCoin.md)| | + +### Return type + +**object** + +### 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) + +# **swap_staking_coin** +> SwapCoinStruct swap_staking_coin(swap_coin) + +On-chain token swap for earned coins + +### 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) +swap_coin = gate_api.SwapCoin() # SwapCoin | + +try: + # On-chain token swap for earned coins + api_response = api_instance.swap_staking_coin(swap_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 EarnApi->swap_staking_coin: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **swap_coin** | [**SwapCoin**](SwapCoin.md)| | + +### Return type + +[**SwapCoinStruct**](SwapCoinStruct.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** | Swap 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/EarnUniApi.md b/docs/EarnUniApi.md new file mode 100644 index 0000000..5128e5d --- /dev/null +++ b/docs/EarnUniApi.md @@ -0,0 +1,762 @@ +# gate_api.EarnUniApi + +All URIs are relative to *https://api.gateio.ws/api/v4* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**list_uni_currencies**](EarnUniApi.md#list_uni_currencies) | **GET** /earn/uni/currencies | Query lending currency list +[**get_uni_currency**](EarnUniApi.md#get_uni_currency) | **GET** /earn/uni/currencies/{currency} | Query single lending currency details +[**list_user_uni_lends**](EarnUniApi.md#list_user_uni_lends) | **GET** /earn/uni/lends | Query user's lending order list +[**create_uni_lend**](EarnUniApi.md#create_uni_lend) | **POST** /earn/uni/lends | Create lending or redemption +[**change_uni_lend**](EarnUniApi.md#change_uni_lend) | **PATCH** /earn/uni/lends | Amend user lending information +[**list_uni_lend_records**](EarnUniApi.md#list_uni_lend_records) | **GET** /earn/uni/lend_records | Query lending transaction records +[**get_uni_interest**](EarnUniApi.md#get_uni_interest) | **GET** /earn/uni/interests/{currency} | Query user's total interest income for specified currency +[**list_uni_interest_records**](EarnUniApi.md#list_uni_interest_records) | **GET** /earn/uni/interest_records | Query user dividend records +[**get_uni_interest_status**](EarnUniApi.md#get_uni_interest_status) | **GET** /earn/uni/interest_status/{currency} | Query currency interest compounding status +[**list_uni_chart**](EarnUniApi.md#list_uni_chart) | **GET** /earn/uni/chart | UniLoan currency annualized trend chart +[**list_uni_rate**](EarnUniApi.md#list_uni_rate) | **GET** /earn/uni/rate | Currency estimated annualized interest rate + + +# **list_uni_currencies** +> list[UniCurrency] list_uni_currencies() + +Query lending currency 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.EarnUniApi(api_client) + +try: + # Query lending currency list + api_response = api_instance.list_uni_currencies() + 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) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**list[UniCurrency]**](UniCurrency.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) + +# **get_uni_currency** +> UniCurrency get_uni_currency(currency) + +Query single lending currency 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.EarnUniApi(api_client) +currency = 'btc' # str | Currency + +try: + # Query single lending currency details + api_response = api_instance.get_uni_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 EarnUniApi->get_uni_currency: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currency** | **str**| Currency | + +### Return type + +[**UniCurrency**](UniCurrency.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) + +# **list_user_uni_lends** +> list[UniLend] list_user_uni_lends(currency=currency, page=page, limit=limit) + +Query user's lending 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.EarnUniApi(api_client) +currency = 'BTC' # str | Query by specified currency name (optional) +page = 1 # int | Page number (optional) (default to 1) +limit = 100 # int | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 (optional) (default to 100) + +try: + # Query user's lending order list + api_response = api_instance.list_user_uni_lends(currency=currency, 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 EarnUniApi->list_user_uni_lends: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currency** | **str**| Query by specified currency name | [optional] + **page** | **int**| Page number | [optional] [default to 1] + **limit** | **int**| Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 | [optional] [default to 100] + +### Return type + +[**list[UniLend]**](UniLend.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_uni_lend** +> create_uni_lend(create_uni_lend) + +Create lending or redemption + +Lending: When lending, a minimum lending rate must be set. After successful lending is determined on an hourly basis, earnings will be calculated based on the determined rate. Earnings for each hour will be settled at the top of the hour. If lending fails due to an excessively high interest rate, no interest will be earned for that hour. If funds are redeemed before the hourly for that hour. Priority: Under the same interest rate, wealth management products created or modified earlier will be prioritized for lending. Redemption: For funds that failed to be lent, redemption will be credited immediately. For funds successfully lent, they are entitled to the earnings for that hour, and redemption will be credited in the next hourly interval. Note: The two minutes before and after the hourly mark are the settlement period, during which lending and redemption are prohibited. + +### 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.EarnUniApi(api_client) +create_uni_lend = gate_api.CreateUniLend() # CreateUniLend | + +try: + # Create lending or redemption + api_instance.create_uni_lend(create_uni_lend) +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->create_uni_lend: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **create_uni_lend** | [**CreateUniLend**](CreateUniLend.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 | +|-------------|-------------|------------------| +**204** | Operation 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) + +# **change_uni_lend** +> change_uni_lend(patch_uni_lend) + +Amend user lending information + +Currently only supports amending minimum interest rate (hourly) + +### 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.EarnUniApi(api_client) +patch_uni_lend = gate_api.PatchUniLend() # PatchUniLend | + +try: + # Amend user lending information + api_instance.change_uni_lend(patch_uni_lend) +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->change_uni_lend: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **patch_uni_lend** | [**PatchUniLend**](PatchUniLend.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 | +|-------------|-------------|------------------| +**204** | 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_uni_lend_records** +> list[UniLendRecord] list_uni_lend_records(currency=currency, page=page, limit=limit, _from=_from, to=to, type=type) + +Query lending transaction 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.EarnUniApi(api_client) +currency = 'BTC' # str | Query by specified currency name (optional) +page = 1 # int | Page number (optional) (default to 1) +limit = 100 # int | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 (optional) (default to 100) +_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) +type = 'lend' # str | Operation type: lend - Lend, redeem - Redeem (optional) + +try: + # Query lending transaction records + api_response = api_instance.list_uni_lend_records(currency=currency, page=page, limit=limit, _from=_from, to=to, 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 EarnUniApi->list_uni_lend_records: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currency** | **str**| Query by specified currency name | [optional] + **page** | **int**| Page number | [optional] [default to 1] + **limit** | **int**| Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 | [optional] [default to 100] + **_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] + **type** | **str**| Operation type: lend - Lend, redeem - Redeem | [optional] + +### Return type + +[**list[UniLendRecord]**](UniLendRecord.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_uni_interest** +> UniLendInterest get_uni_interest(currency) + +Query user's total interest income for specified currency + +### 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.EarnUniApi(api_client) +currency = 'btc' # str | Currency + +try: + # Query user's total interest income for specified currency + api_response = api_instance.get_uni_interest(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 EarnUniApi->get_uni_interest: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currency** | **str**| Currency | + +### Return type + +[**UniLendInterest**](UniLendInterest.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_uni_interest_records** +> list[UniInterestRecord] list_uni_interest_records(currency=currency, page=page, limit=limit, _from=_from, to=to) + +Query user dividend 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.EarnUniApi(api_client) +currency = 'BTC' # str | Query by specified currency name (optional) +page = 1 # int | Page number (optional) (default to 1) +limit = 100 # int | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 (optional) (default to 100) +_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) + +try: + # Query user dividend records + api_response = api_instance.list_uni_interest_records(currency=currency, page=page, limit=limit, _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 EarnUniApi->list_uni_interest_records: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currency** | **str**| Query by specified currency name | [optional] + **page** | **int**| Page number | [optional] [default to 1] + **limit** | **int**| Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 | [optional] [default to 100] + **_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] + +### Return type + +[**list[UniInterestRecord]**](UniInterestRecord.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_uni_interest_status** +> UniCurrencyInterest get_uni_interest_status(currency) + +Query currency interest compounding 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.EarnUniApi(api_client) +currency = 'btc' # str | Currency + +try: + # Query currency interest compounding status + api_response = api_instance.get_uni_interest_status(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 EarnUniApi->get_uni_interest_status: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currency** | **str**| Currency | + +### Return type + +[**UniCurrencyInterest**](UniCurrencyInterest.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_uni_chart** +> list[InlineResponse200] list_uni_chart(_from, to, asset) + +UniLoan currency annualized trend chart + +Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-07-17 21:35+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.EarnUniApi(api_client) +_from = 1719763200 # int | Start timestamp in seconds, maximum span 30 days +to = 1722441600 # int | End timestamp in seconds, maximum span 30 days +asset = 'BTC' # str | Currency name + +try: + # UniLoan currency annualized trend chart + api_response = api_instance.list_uni_chart(_from, to, asset) + 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_chart: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **_from** | **int**| Start timestamp in seconds, maximum span 30 days | + **to** | **int**| End timestamp in seconds, maximum span 30 days | + **asset** | **str**| Currency name | + +### 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-07-17 21:35+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_uni_rate** +> list[InlineResponse2001] list_uni_rate() + +Currency estimated annualized interest rate + +Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-07-17 21:35+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.EarnUniApi(api_client) + +try: + # Currency estimated annualized interest rate + api_response = api_instance.list_uni_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 EarnUniApi->list_uni_rate: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### 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-07-17 21:35+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/Eth2RateList.md b/docs/Eth2RateList.md new file mode 100644 index 0000000..574d27a --- /dev/null +++ b/docs/Eth2RateList.md @@ -0,0 +1,12 @@ +# Eth2RateList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**date_time** | **int** | Date Timestamp | [optional] +**date** | **str** | Date | [optional] +**rate** | **str** | Percentage 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/Eth2Swap.md b/docs/Eth2Swap.md new file mode 100644 index 0000000..31c2116 --- /dev/null +++ b/docs/Eth2Swap.md @@ -0,0 +1,12 @@ +# Eth2Swap + +ETH2 Mining +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**side** | **str** | 1-Forward Swap (ETH -> ETH2), 2-Reverse Swap (ETH2 -> 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/FindCoin.md b/docs/FindCoin.md new file mode 100644 index 0000000..784880a --- /dev/null +++ b/docs/FindCoin.md @@ -0,0 +1,10 @@ +# FindCoin + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cointype** | **str** | Currency type: swap - voucher; lock - locked position; debt - US Treasury bond. | [optional] + +[[Back to Model list]](../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 new file mode 100644 index 0000000..39fd84a --- /dev/null +++ b/docs/FlashSwapApi.md @@ -0,0 +1,357 @@ +# gate_api.FlashSwapApi + +All URIs are relative to *https://api.gateio.ws/api/v4* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**list_flash_swap_currency_pair**](FlashSwapApi.md#list_flash_swap_currency_pair) | **GET** /flash_swap/currency_pairs | List All Supported Currency Pairs In Flash Swap +[**list_flash_swap_orders**](FlashSwapApi.md#list_flash_swap_orders) | **GET** /flash_swap/orders | Query flash swap order list +[**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 + + +# **list_flash_swap_currency_pair** +> list[FlashSwapCurrencyPair] list_flash_swap_currency_pair(currency=currency, page=page, limit=limit) + +List All Supported Currency Pairs In Flash Swap + +`BTC_GT` represents selling BTC and buying GT. The limits for each currency may vary across different currency pairs. It is not necessary that two currencies that can be swapped instantaneously can be exchanged with each other. For example, it is possible to sell BTC and buy GT, but it does not necessarily mean that GT can be sold to buy BTC. + +### 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.FlashSwapApi(api_client) +currency = 'BTC' # str | Query by specified currency name (optional) +page = 1 # int | Page number (optional) (default to 1) +limit = 1000 # int | Maximum number of items returned. Default: 1000, minimum: 1, maximum: 1000 (optional) (default to 1000) + +try: + # List All Supported Currency Pairs In Flash Swap + api_response = api_instance.list_flash_swap_currency_pair(currency=currency, 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 FlashSwapApi->list_flash_swap_currency_pair: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currency** | **str**| Query by specified currency name | [optional] + **page** | **int**| Page number | [optional] [default to 1] + **limit** | **int**| Maximum number of items returned. Default: 1000, minimum: 1, maximum: 1000 | [optional] [default to 1000] + +### Return type + +[**list[FlashSwapCurrencyPair]**](FlashSwapCurrencyPair.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) + +# **list_flash_swap_orders** +> list[FlashSwapOrder] list_flash_swap_orders(status=status, sell_currency=sell_currency, buy_currency=buy_currency, reverse=reverse, limit=limit, page=page) + +Query flash swap 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.FlashSwapApi(api_client) +status = 1 # int | Flash swap order status `1` - success `2` - failed (optional) +sell_currency = 'BTC' # str | Asset name to sell - Retrieved from API `GET /flash_swap/currencies` for supported flash swap currencies (optional) +buy_currency = 'BTC' # str | Asset name to buy - Retrieved from API `GET /flash_swap/currencies` for supported flash swap currencies (optional) +reverse = true # bool | Sort by ID in ascending or descending order, default `true` - `true`: ID descending order (most recent data first) - `false`: ID ascending order (oldest data first) (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 flash swap order list + api_response = api_instance.list_flash_swap_orders(status=status, sell_currency=sell_currency, buy_currency=buy_currency, reverse=reverse, 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 FlashSwapApi->list_flash_swap_orders: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | **int**| Flash swap order status `1` - success `2` - failed | [optional] + **sell_currency** | **str**| Asset name to sell - Retrieved from API `GET /flash_swap/currencies` for supported flash swap currencies | [optional] + **buy_currency** | **str**| Asset name to buy - Retrieved from API `GET /flash_swap/currencies` for supported flash swap currencies | [optional] + **reverse** | **bool**| Sort by ID in ascending or descending order, default `true` - `true`: ID descending order (most recent data first) - `false`: ID ascending order (oldest data first) | [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 + +[**list[FlashSwapOrder]**](FlashSwapOrder.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) + +# **create_flash_swap_order** +> FlashSwapOrder create_flash_swap_order(flash_swap_order_request) + +Create a flash swap order + +Initiate a flash swap preview in advance because order creation requires a preview result + +### 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_request = gate_api.FlashSwapOrderRequest() # FlashSwapOrderRequest | + +try: + # Create a flash swap order + api_response = api_instance.create_flash_swap_order(flash_swap_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 FlashSwapApi->create_flash_swap_order: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **flash_swap_order_request** | [**FlashSwapOrderRequest**](FlashSwapOrderRequest.md)| | + +### Return type + +[**FlashSwapOrder**](FlashSwapOrder.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** | Flash swap 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_flash_swap_order** +> FlashSwapOrder get_flash_swap_order(order_id) + +Query single flash swap 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) +order_id = 1 # int | Flash swap order ID + +try: + # Query single flash swap order + api_response = api_instance.get_flash_swap_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 FlashSwapApi->get_flash_swap_order: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order_id** | **int**| Flash swap order ID | + +### Return type + +[**FlashSwapOrder**](FlashSwapOrder.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) + +# **preview_flash_swap_order** +> FlashSwapOrderPreview preview_flash_swap_order(flash_swap_preview_request) + +Flash swap order preview + +### 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_preview_request = gate_api.FlashSwapPreviewRequest() # FlashSwapPreviewRequest | + +try: + # Flash swap order preview + api_response = api_instance.preview_flash_swap_order(flash_swap_preview_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 FlashSwapApi->preview_flash_swap_order: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **flash_swap_preview_request** | [**FlashSwapPreviewRequest**](FlashSwapPreviewRequest.md)| | + +### Return type + +[**FlashSwapOrderPreview**](FlashSwapOrderPreview.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** | Flash swap order preview 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/FlashSwapCurrencyPair.md b/docs/FlashSwapCurrencyPair.md new file mode 100644 index 0000000..28eacbc --- /dev/null +++ b/docs/FlashSwapCurrencyPair.md @@ -0,0 +1,17 @@ +# FlashSwapCurrencyPair + +List all supported currencies in flash swap +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency_pair** | **str** | Currency pair, `BTC_USDT` represents selling `BTC` and buying `USDT` | [optional] [readonly] +**sell_currency** | **str** | Currency to sell | [optional] [readonly] +**buy_currency** | **str** | Currency to buy | [optional] [readonly] +**sell_min_amount** | **str** | Minimum sell quantity | [optional] [readonly] +**sell_max_amount** | **str** | Maximum sell quantity | [optional] [readonly] +**buy_min_amount** | **str** | Minimum buy quantity | [optional] [readonly] +**buy_max_amount** | **str** | Maximum buy quantity | [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/FlashSwapOrder.md b/docs/FlashSwapOrder.md new file mode 100644 index 0000000..bde41a4 --- /dev/null +++ b/docs/FlashSwapOrder.md @@ -0,0 +1,19 @@ +# FlashSwapOrder + +Flash swap order +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Flash swap order ID | [optional] [readonly] +**create_time** | **int** | Creation time of order (in milliseconds) | [optional] [readonly] +**user_id** | **int** | User ID | [optional] [readonly] +**sell_currency** | **str** | Currency to sell | [optional] [readonly] +**sell_amount** | **str** | Amount to sell | [optional] [readonly] +**buy_currency** | **str** | Currency to buy | [optional] [readonly] +**buy_amount** | **str** | Amount to buy | [optional] [readonly] +**price** | **str** | Price | [optional] [readonly] +**status** | **int** | Flash swap order status `1` - success `2` - failure | [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/FlashSwapOrderPreview.md b/docs/FlashSwapOrderPreview.md new file mode 100644 index 0000000..4ee4133 --- /dev/null +++ b/docs/FlashSwapOrderPreview.md @@ -0,0 +1,16 @@ +# FlashSwapOrderPreview + +Flash swap order preview +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**preview_id** | **str** | Preview result ID | [optional] +**sell_currency** | **str** | Name of the sold asset, Refer to the interface Query the list of currencies supported for flash swap GET /flash_swap/currenciesto obtain | [optional] +**sell_amount** | **str** | Amount to sell | [optional] +**buy_currency** | **str** | Name of the purchased asset, Refer to the interface Query the list of currencies supported for flash swap GET /flash_swap/currenciesto obtain | [optional] +**buy_amount** | **str** | Amount to buy | [optional] +**price** | **str** | 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/FlashSwapOrderRequest.md b/docs/FlashSwapOrderRequest.md new file mode 100644 index 0000000..aea0466 --- /dev/null +++ b/docs/FlashSwapOrderRequest.md @@ -0,0 +1,15 @@ +# FlashSwapOrderRequest + +Parameters of flash swap order creation +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**preview_id** | **str** | Preview result ID | +**sell_currency** | **str** | Name of the asset to be sold, obtained from the interface GET /flash_swap/currency_pairs: Query the list of all trading pairs supporting flash swap | +**sell_amount** | **str** | Amount to sell (based on the preview result) | +**buy_currency** | **str** | Name of the asset to be bought, obtained from the interface GET /flash_swap/currency_pairs: Query the list of all trading pairs supporting flash swap | +**buy_amount** | **str** | Amount to buy (based on the preview result) | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FlashSwapPreviewRequest.md b/docs/FlashSwapPreviewRequest.md new file mode 100644 index 0000000..3a45a36 --- /dev/null +++ b/docs/FlashSwapPreviewRequest.md @@ -0,0 +1,14 @@ +# FlashSwapPreviewRequest + +Parameters of flash swap order creation +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sell_currency** | **str** | The name of the asset being sold, as obtained from the \"GET /flash_swap/currency_pairs\" API, which retrieves a list of supported flash swap currency pairs | +**sell_amount** | **str** | Amount to sell. It is required to choose one parameter between `sell_amount` and `buy_amount` | [optional] +**buy_currency** | **str** | The name of the asset being purchased, as obtained from the \"GET /flash_swap/currency_pairs\" API, which provides a list of supported flash swap currency pairs | +**buy_amount** | **str** | Amount to buy. It is required to choose one parameter between `sell_amount` and `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/FutureCancelOrderResult.md b/docs/FutureCancelOrderResult.md new file mode 100644 index 0000000..865d529 --- /dev/null +++ b/docs/FutureCancelOrderResult.md @@ -0,0 +1,14 @@ +# FutureCancelOrderResult + +Order cancellation result +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Order ID | [optional] +**user_id** | **int** | User ID | [optional] +**succeeded** | **bool** | Whether cancellation succeeded | [optional] +**message** | **str** | Error description when cancellation fails, empty if successful | [optional] + +[[Back to Model list]](../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 2134ee2..590e0c8 100644 --- a/docs/FuturesAccount.md +++ b/docs/FuturesAccount.md @@ -3,14 +3,33 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**total** | **str** | Total assets, total = position_margin + order_margin + available | [optional] +**total** | **str** | total is the balance after the user's accumulated deposit, withdraw, profit and loss (including realized profit and loss, fund, fee and referral rebate), excluding unrealized profit and loss. total = SUM(history_dnw, history_pnl, history_fee, history_refr, history_fund) | [optional] **unrealised_pnl** | **str** | Unrealized PNL | [optional] **position_margin** | **str** | Position margin | [optional] **order_margin** | **str** | Order margin of unfinished orders | [optional] -**available** | **str** | Available balance to transfer out or trade | [optional] -**point** | **str** | POINT amount | [optional] -**currency** | **str** | Settle currency | [optional] +**available** | **str** | Available balance for transferring or trading (including bonus. Bonus cannot be withdrawn, so transfer amount needs to deduct bonus) | [optional] +**point** | **str** | Point card amount | [optional] +**currency** | **str** | Settlement currency | [optional] **in_dual_mode** | **bool** | Whether dual 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] +**bonus** | **str** | Bonus | [optional] +**enable_evolved_classic** | **bool** | Classic account margin mode, true-new mode, false-old mode | [optional] +**cross_order_margin** | **str** | Cross margin order margin, applicable to new classic account margin mode | [optional] +**cross_initial_margin** | **str** | Cross margin initial margin, applicable to new classic account margin mode | [optional] +**cross_maintenance_margin** | **str** | Cross margin maintenance margin, applicable to new classic account margin mode | [optional] +**cross_unrealised_pnl** | **str** | Cross margin unrealized P&L, applicable to new classic account margin mode | [optional] +**cross_available** | **str** | Cross margin available balance, applicable to new classic account margin mode | [optional] +**cross_margin_balance** | **str** | Cross margin balance, applicable to new classic account margin mode | [optional] +**cross_mmr** | **str** | Cross margin maintenance margin rate, applicable to new classic account margin mode | [optional] +**cross_imr** | **str** | Cross margin initial margin rate, applicable to new classic account margin mode | [optional] +**isolated_position_margin** | **str** | Isolated position margin, applicable to new classic account margin mode | [optional] +**enable_new_dual_mode** | **bool** | Whether to open a new two-way position mode | [optional] +**margin_mode** | **int** | Margin mode, 0-classic margin mode, 1-cross-currency margin mode, 2-combined margin mode | [optional] +**enable_tiered_mm** | **bool** | Whether to enable tiered maintenance margin calculation | [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/FuturesAccountBook.md b/docs/FuturesAccountBook.md index b1ba011..0056f17 100644 --- a/docs/FuturesAccountBook.md +++ b/docs/FuturesAccountBook.md @@ -6,8 +6,11 @@ Name | Type | Description | Notes **time** | **float** | Change time | [optional] **change** | **str** | Change amount | [optional] **balance** | **str** | Balance after change | [optional] -**type** | **str** | Changing Type: - dnw: Deposit & Withdraw - pnl: Profit & Loss by reducing position - fee: Trading fee - refr: Referrer rebate - fund: Funding - point_dnw: POINT Deposit & Withdraw - point_fee: POINT Trading fee - point_refr: POINT Referrer rebate | [optional] +**type** | **str** | Change types: - dnw: Deposit and withdrawal - pnl: Profit and loss from position reduction - fee: Trading fees - refr: Referrer rebates - fund: Funding fees - point_dnw: Point card deposit and withdrawal - point_fee: Point card trading fees - point_refr: Point card referrer rebates - bonus_offset: Trial fund deduction | [optional] **text** | **str** | Comment | [optional] +**contract** | **str** | Futures contract, the field is only available for data after 2023-10-30 | [optional] +**trade_id** | **str** | trade id | [optional] +**id** | **str** | Account change record 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/FuturesAccountHistory.md b/docs/FuturesAccountHistory.md new file mode 100644 index 0000000..202fdc6 --- /dev/null +++ b/docs/FuturesAccountHistory.md @@ -0,0 +1,20 @@ +# FuturesAccountHistory + +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/FuturesApi.md b/docs/FuturesApi.md index 3e72836..75ce6fe 100644 --- a/docs/FuturesApi.md +++ b/docs/FuturesApi.md @@ -4,47 +4,62 @@ 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 | List all futures contracts -[**get_futures_contract**](FuturesApi.md#get_futures_contract) | **GET** /futures/{settle}/contracts/{contract} | Get a single contract -[**list_futures_order_book**](FuturesApi.md#list_futures_order_book) | **GET** /futures/{settle}/order_book | Futures order book -[**list_futures_trades**](FuturesApi.md#list_futures_trades) | **GET** /futures/{settle}/trades | Futures trading history -[**list_futures_candlesticks**](FuturesApi.md#list_futures_candlesticks) | **GET** /futures/{settle}/candlesticks | Get futures candlesticks -[**list_futures_tickers**](FuturesApi.md#list_futures_tickers) | **GET** /futures/{settle}/tickers | List futures tickers -[**list_futures_funding_rate_history**](FuturesApi.md#list_futures_funding_rate_history) | **GET** /futures/{settle}/funding_rate | Funding rate history -[**list_futures_insurance_ledger**](FuturesApi.md#list_futures_insurance_ledger) | **GET** /futures/{settle}/insurance | Futures insurance balance history -[**list_contract_stats**](FuturesApi.md#list_contract_stats) | **GET** /futures/{settle}/contract_stats | Futures stats -[**list_liquidated_orders**](FuturesApi.md#list_liquidated_orders) | **GET** /futures/{settle}/liq_orders | Retrieve liquidation history -[**list_futures_accounts**](FuturesApi.md#list_futures_accounts) | **GET** /futures/{settle}/accounts | Query futures account -[**list_futures_account_book**](FuturesApi.md#list_futures_account_book) | **GET** /futures/{settle}/account_book | Query account book -[**list_positions**](FuturesApi.md#list_positions) | **GET** /futures/{settle}/positions | List all positions of a user -[**get_position**](FuturesApi.md#get_position) | **GET** /futures/{settle}/positions/{contract} | Get single position +[**list_futures_contracts**](FuturesApi.md#list_futures_contracts) | **GET** /futures/{settle}/contracts | Query all futures contracts +[**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 +[**list_futures_candlesticks**](FuturesApi.md#list_futures_candlesticks) | **GET** /futures/{settle}/candlesticks | Futures market K-line chart +[**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_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 +[**list_liquidated_orders**](FuturesApi.md#list_liquidated_orders) | **GET** /futures/{settle}/liq_orders | Query liquidation order history +[**list_futures_risk_limit_tiers**](FuturesApi.md#list_futures_risk_limit_tiers) | **GET** /futures/{settle}/risk_limit_tiers | Query risk limit tiers +[**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 +[**get_position**](FuturesApi.md#get_position) | **GET** /futures/{settle}/positions/{contract} | Get single position information [**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_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 | Enable or disable dual mode -[**get_dual_mode_position**](FuturesApi.md#get_dual_mode_position) | **GET** /futures/{settle}/dual_comp/positions/{contract} | Retrieve position detail in dual mode +[**set_dual_mode**](FuturesApi.md#set_dual_mode) | **POST** /futures/{settle}/dual_mode | Set position mode +[**get_dual_mode_position**](FuturesApi.md#get_dual_mode_position) | **GET** /futures/{settle}/dual_comp/positions/{contract} | Get position information in dual 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 dual 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 dual mode [**update_dual_mode_position_risk_limit**](FuturesApi.md#update_dual_mode_position_risk_limit) | **POST** /futures/{settle}/dual_comp/positions/{contract}/risk_limit | Update position risk limit in dual mode -[**list_futures_orders**](FuturesApi.md#list_futures_orders) | **GET** /futures/{settle}/orders | List futures orders -[**create_futures_order**](FuturesApi.md#create_futures_order) | **POST** /futures/{settle}/orders | Create a futures order -[**cancel_futures_orders**](FuturesApi.md#cancel_futures_orders) | **DELETE** /futures/{settle}/orders | Cancel all `open` orders matched -[**get_futures_order**](FuturesApi.md#get_futures_order) | **GET** /futures/{settle}/orders/{order_id} | Get a single order -[**cancel_futures_order**](FuturesApi.md#cancel_futures_order) | **DELETE** /futures/{settle}/orders/{order_id} | Cancel a single order -[**get_my_trades**](FuturesApi.md#get_my_trades) | **GET** /futures/{settle}/my_trades | List personal trading history -[**list_position_close**](FuturesApi.md#list_position_close) | **GET** /futures/{settle}/position_close | List position close history -[**list_liquidates**](FuturesApi.md#list_liquidates) | **GET** /futures/{settle}/liquidates | List liquidation history -[**list_price_triggered_orders**](FuturesApi.md#list_price_triggered_orders) | **GET** /futures/{settle}/price_orders | List all auto orders -[**create_price_triggered_order**](FuturesApi.md#create_price_triggered_order) | **POST** /futures/{settle}/price_orders | Create a price-triggered order -[**cancel_price_triggered_order_list**](FuturesApi.md#cancel_price_triggered_order_list) | **DELETE** /futures/{settle}/price_orders | Cancel all open orders -[**get_price_triggered_order**](FuturesApi.md#get_price_triggered_order) | **GET** /futures/{settle}/price_orders/{order_id} | Get a single order -[**cancel_price_triggered_order**](FuturesApi.md#cancel_price_triggered_order) | **DELETE** /futures/{settle}/price_orders/{order_id} | Cancel a single order +[**list_futures_orders**](FuturesApi.md#list_futures_orders) | **GET** /futures/{settle}/orders | Query futures order list +[**create_futures_order**](FuturesApi.md#create_futures_order) | **POST** /futures/{settle}/orders | Place futures order +[**cancel_futures_orders**](FuturesApi.md#cancel_futures_orders) | **DELETE** /futures/{settle}/orders | Cancel all orders with 'open' status +[**get_orders_with_time_range**](FuturesApi.md#get_orders_with_time_range) | **GET** /futures/{settle}/orders_timerange | Query futures order list by time range +[**create_batch_futures_order**](FuturesApi.md#create_batch_futures_order) | **POST** /futures/{settle}/batch_orders | Place batch futures orders +[**get_futures_order**](FuturesApi.md#get_futures_order) | **GET** /futures/{settle}/orders/{order_id} | Query single order details +[**amend_futures_order**](FuturesApi.md#amend_futures_order) | **PUT** /futures/{settle}/orders/{order_id} | Amend single order +[**cancel_futures_order**](FuturesApi.md#cancel_futures_order) | **DELETE** /futures/{settle}/orders/{order_id} | Cancel single order +[**get_my_trades**](FuturesApi.md#get_my_trades) | **GET** /futures/{settle}/my_trades | Query personal trading records +[**get_my_trades_with_time_range**](FuturesApi.md#get_my_trades_with_time_range) | **GET** /futures/{settle}/my_trades_timerange | Query personal trading records by time range +[**list_position_close**](FuturesApi.md#list_position_close) | **GET** /futures/{settle}/position_close | Query position close history +[**list_liquidates**](FuturesApi.md#list_liquidates) | **GET** /futures/{settle}/liquidates | Query liquidation history +[**list_auto_deleverages**](FuturesApi.md#list_auto_deleverages) | **GET** /futures/{settle}/auto_deleverages | Query ADL auto-deleveraging order information +[**countdown_cancel_all_futures**](FuturesApi.md#countdown_cancel_all_futures) | **POST** /futures/{settle}/countdown_cancel_all | Countdown cancel orders +[**get_futures_fee**](FuturesApi.md#get_futures_fee) | **GET** /futures/{settle}/fee | Query futures market trading fee rates +[**cancel_batch_future_orders**](FuturesApi.md#cancel_batch_future_orders) | **POST** /futures/{settle}/batch_cancel_orders | Cancel batch orders by specified ID list +[**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 +[**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 +[**cancel_price_triggered_order**](FuturesApi.md#cancel_price_triggered_order) | **DELETE** /futures/{settle}/price_orders/{order_id} | Cancel single auto order # **list_futures_contracts** -> list[Contract] list_futures_contracts(settle) +> list[Contract] list_futures_contracts(settle, limit=limit, offset=offset) -List all futures contracts +Query all futures contracts ### Example @@ -62,10 +77,12 @@ 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: - # List all futures contracts - api_response = api_instance.list_futures_contracts(settle) + # Query all futures contracts + api_response = api_instance.list_futures_contracts(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)) @@ -78,6 +95,8 @@ except ApiException as e: 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 @@ -95,14 +114,14 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**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) -Get a single contract +Query single contract information ### Example @@ -123,7 +142,7 @@ settle = 'usdt' # str | Settle currency contract = 'BTC_USDT' # str | Futures contract try: - # Get a single contract + # Query single contract information api_response = api_instance.get_futures_contract(settle, contract) print(api_response) except GateApiException as ex: @@ -162,7 +181,7 @@ No authorization required # **list_futures_order_book** > FuturesOrderBook list_futures_order_book(settle, contract, interval=interval, limit=limit, with_id=with_id) -Futures order book +Query futures market depth information Bids will be sorted by price from high to low, while asks sorted reversely @@ -183,12 +202,12 @@ 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 | Order depth. 0 means no aggregation is applied. default to 0 (optional) (default to '0') -limit = 10 # int | Maximum number of order depth data in asks or bids (optional) (default to 10) -with_id = False # bool | Whether the order book update ID will be returned. This ID increases by 1 on every order book update (optional) (default to False) +interval = '0' # str | Price precision for depth aggregation, 0 means no aggregation, defaults to 0 if not specified (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 depth changes (optional) (default to False) try: - # Futures order book + # Query futures market depth information api_response = api_instance.list_futures_order_book(settle, contract, interval=interval, limit=limit, with_id=with_id) print(api_response) except GateApiException as ex: @@ -203,9 +222,9 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | **contract** | **str**| Futures contract | - **interval** | **str**| Order depth. 0 means no aggregation is applied. default to 0 | [optional] [default to '0'] - **limit** | **int**| Maximum number of order depth data in asks or bids | [optional] [default to 10] - **with_id** | **bool**| Whether the order book update ID will be returned. This ID increases by 1 on every order book update | [optional] [default to False] + **interval** | **str**| Price precision for depth aggregation, 0 means no aggregation, defaults to 0 if not specified | [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 depth changes | [optional] [default to False] ### Return type @@ -223,14 +242,14 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Order book retrieved | - | +**200** | Depth 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_trades** -> list[FuturesTrade] list_futures_trades(settle, contract, limit=limit, last_id=last_id, _from=_from, to=to) +> list[FuturesTrade] list_futures_trades(settle, contract, limit=limit, offset=offset, last_id=last_id, _from=_from, to=to) -Futures trading history +Futures market transaction records ### Example @@ -249,14 +268,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 -limit = 100 # int | Maximum number of records to be returned in a single list (optional) (default to 100) +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. Use `from` and `to` instead to limit time range (optional) _from = 1546905600 # int | Specify starting time in Unix seconds. If not specified, `to` and `limit` will be used to limit response items. If items between `from` and `to` are more than `limit`, only `limit` number will be returned. (optional) -to = 1546935600 # int | Specify end time in Unix seconds, default to current time (optional) +to = 1546935600 # int | Specify end time in Unix seconds, default to current time. (optional) try: - # Futures trading history - api_response = api_instance.list_futures_trades(settle, contract, limit=limit, last_id=last_id, _from=_from, to=to) + # Futures market transaction records + api_response = api_instance.list_futures_trades(settle, contract, limit=limit, offset=offset, last_id=last_id, _from=_from, to=to) print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) @@ -270,10 +290,11 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | **contract** | **str**| Futures contract | - **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] + **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. Use `from` and `to` instead to limit time range | [optional] **_from** | **int**| Specify starting time in Unix seconds. If not specified, `to` and `limit` will be used to limit response items. If items between `from` and `to` are more than `limit`, only `limit` number will be returned. | [optional] - **to** | **int**| Specify end time in Unix seconds, default to current time | [optional] + **to** | **int**| Specify end time in Unix seconds, default to current time. | [optional] ### Return type @@ -291,14 +312,14 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**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_futures_candlesticks** -> list[FuturesCandlestick] list_futures_candlesticks(settle, contract, _from=_from, to=to, limit=limit, interval=interval) +> list[FuturesCandlestick] list_futures_candlesticks(settle, contract, _from=_from, to=to, limit=limit, interval=interval, timezone=timezone) -Get futures candlesticks +Futures market K-line chart Return specified contract candlesticks. If prefix `contract` with `mark_`, the contract's mark price candlesticks are returned; if prefix with `index_`, index price candlesticks will be returned. Maximum of 2000 points are returned in one query. Be sure not to exceed the limit when specifying `from`, `to` and `interval` @@ -320,13 +341,14 @@ api_instance = gate_api.FuturesApi(api_client) settle = 'usdt' # str | Settle currency 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 | End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time (optional) -limit = 100 # int | Maximum recent data points to return. `limit` is conflicted 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 (optional) (default to '5m') +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') +timezone = 'utc0' # str | Time zone: all/utc0/utc8, default utc0 (optional) (default to 'utc0') try: - # Get futures candlesticks - api_response = api_instance.list_futures_candlesticks(settle, contract, _from=_from, to=to, limit=limit, interval=interval) + # Futures market K-line chart + api_response = api_instance.list_futures_candlesticks(settle, contract, _from=_from, to=to, limit=limit, interval=interval, timezone=timezone) print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) @@ -341,9 +363,10 @@ Name | Type | Description | Notes **settle** | **str**| Settle currency | **contract** | **str**| Futures contract | **_from** | **int**| Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified | [optional] - **to** | **int**| End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time | [optional] - **limit** | **int**| Maximum recent data points to return. `limit` is conflicted 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 | [optional] [default to '5m'] + **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'] + **timezone** | **str**| Time zone: all/utc0/utc8, default utc0 | [optional] [default to 'utc0'] ### Return type @@ -361,14 +384,84 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**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_futures_premium_index** +> list[FuturesPremiumIndex] list_futures_premium_index(settle, contract, _from=_from, to=to, limit=limit, interval=interval) + +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 + +### 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 +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 | Time interval between data points (optional) (default to '5m') + +try: + # Premium Index K-line chart + api_response = api_instance.list_futures_premium_index(settle, contract, _from=_from, to=to, limit=limit, interval=interval) + 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_premium_index: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **settle** | **str**| Settle currency | + **contract** | **str**| Futures contract | + **_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**| Time interval between data points | [optional] [default to '5m'] + +### Return type + +[**list[FuturesPremiumIndex]**](FuturesPremiumIndex.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) # **list_futures_tickers** > list[FuturesTicker] list_futures_tickers(settle, contract=contract) -List futures tickers +Get all futures trading statistics ### Example @@ -389,7 +482,7 @@ settle = 'usdt' # str | Settle currency contract = 'BTC_USDT' # str | Futures contract, return related data only if specified (optional) try: - # List futures tickers + # Get all futures trading statistics api_response = api_instance.list_futures_tickers(settle, contract=contract) print(api_response) except GateApiException as ex: @@ -421,14 +514,14 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**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_futures_funding_rate_history** -> list[FundingRateRecord] list_futures_funding_rate_history(settle, contract, limit=limit) +> list[FundingRateRecord] list_futures_funding_rate_history(settle, contract, limit=limit, _from=_from, to=to) -Funding rate history +Futures market historical funding rate ### Example @@ -447,11 +540,13 @@ api_client = gate_api.ApiClient(configuration) api_instance = gate_api.FuturesApi(api_client) settle = 'usdt' # str | Settle currency contract = 'BTC_USDT' # str | Futures contract -limit = 100 # int | Maximum number of records to be returned in a single list (optional) (default to 100) +limit = 100 # int | Maximum number of records returned in a single list (optional) (default to 100) +_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) try: - # Funding rate history - api_response = api_instance.list_futures_funding_rate_history(settle, contract, limit=limit) + # Futures market historical funding rate + api_response = api_instance.list_futures_funding_rate_history(settle, contract, limit=limit, _from=_from, to=to) print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) @@ -465,7 +560,9 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | **contract** | **str**| Futures contract | - **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] + **limit** | **int**| Maximum number of records returned in a single list | [optional] [default to 100] + **_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] ### Return type @@ -483,14 +580,14 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | History retrieved | - | +**200** | History 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) -Futures insurance balance history +Futures market insurance fund history ### Example @@ -508,10 +605,10 @@ 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 to be returned in a single list (optional) (default to 100) +limit = 100 # int | Maximum number of records returned in a single list (optional) (default to 100) try: - # Futures insurance balance history + # Futures market insurance fund history api_response = api_instance.list_futures_insurance_ledger(settle, limit=limit) print(api_response) except GateApiException as ex: @@ -525,7 +622,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | - **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] + **limit** | **int**| Maximum number of records returned in a single list | [optional] [default to 100] ### Return type @@ -543,14 +640,14 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**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_contract_stats** > list[ContractStat] list_contract_stats(settle, contract, _from=_from, interval=interval, limit=limit) -Futures stats +Futures statistics ### Example @@ -574,7 +671,7 @@ interval = '5m' # str | (optional) (default to '5m') limit = 30 # int | (optional) (default to 30) try: - # Futures stats + # Futures statistics api_response = api_instance.list_contract_stats(settle, contract, _from=_from, interval=interval, limit=limit) print(api_response) except GateApiException as ex: @@ -609,16 +706,76 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**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_index_constituents** +> FuturesIndexConstituents get_index_constituents(settle, index) + +Query index constituents + +### 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 +index = 'BTC_USDT' # str | Index name + +try: + # Query index constituents + api_response = api_instance.get_index_constituents(settle, index) + 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_index_constituents: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **settle** | **str**| Settle currency | + **index** | **str**| Index name | + +### Return type + +[**FuturesIndexConstituents**](FuturesIndexConstituents.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) # **list_liquidated_orders** -> list[FuturesLiquidate] list_liquidated_orders(settle, contract=contract, _from=_from, to=to, limit=limit) +> list[FuturesLiqOrder] list_liquidated_orders(settle, contract=contract, _from=_from, to=to, limit=limit) -Retrieve liquidation history +Query liquidation order history -Interval between `from` and `to` cannot exceeds 3600. Some private fields will not be returned in public endpoints. Refer to field description for detail. +The time interval between from and to is maximum 3600. Some private fields are not returned by public interfaces, refer to field descriptions for details ### Example @@ -637,12 +794,12 @@ api_client = gate_api.ApiClient(configuration) 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 (optional) -to = 1547706332 # int | End timestamp (optional) -limit = 100 # int | Maximum number of records to be returned in a single list (optional) (default to 100) +_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) try: - # Retrieve liquidation history + # Query liquidation order history api_response = api_instance.list_liquidated_orders(settle, contract=contract, _from=_from, to=to, limit=limit) print(api_response) except GateApiException as ex: @@ -657,13 +814,79 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | **contract** | **str**| Futures contract, return related data only if specified | [optional] - **_from** | **int**| Start timestamp | [optional] - **to** | **int**| End timestamp | [optional] - **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] + **_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] ### Return type -[**list[FuturesLiquidate]**](FuturesLiquidate.md) +[**list[FuturesLiqOrder]**](FuturesLiqOrder.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) + +# **list_futures_risk_limit_tiers** +> list[FuturesLimitRiskTiers] list_futures_risk_limit_tiers(settle, contract=contract, limit=limit, offset=offset) + +Query risk limit tiers + +When the 'contract' parameter is not passed, the default is to query the risk limits for the top 100 markets. 'Limit' and 'offset' correspond to pagination queries at the market level, not to the length of the returned array. This only takes effect when the contract parameter is empty. + +### 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 +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) + +try: + # Query risk limit tiers + api_response = api_instance.list_futures_risk_limit_tiers(settle, contract=contract, 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_risk_limit_tiers: %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] + +### Return type + +[**list[FuturesLimitRiskTiers]**](FuturesLimitRiskTiers.md) ### Authorization @@ -677,14 +900,14 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**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_futures_accounts** > FuturesAccount list_futures_accounts(settle) -Query futures account +Get futures account ### Example @@ -713,7 +936,7 @@ api_instance = gate_api.FuturesApi(api_client) settle = 'usdt' # str | Settle currency try: - # Query futures account + # Get futures account api_response = api_instance.list_futures_accounts(settle) print(api_response) except GateApiException as ex: @@ -744,14 +967,16 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**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_futures_account_book** -> list[FuturesAccountBook] list_futures_account_book(settle, limit=limit, _from=_from, to=to, type=type) +> list[FuturesAccountBook] list_futures_account_book(settle, contract=contract, limit=limit, offset=offset, _from=_from, to=to, type=type) -Query account book +Query futures account change history + +If the contract field is passed, only records containing this field after 2023-10-30 can be filtered. ### Example @@ -778,14 +1003,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 -limit = 100 # int | Maximum number of records to be returned in a single list (optional) (default to 100) -_from = 1547706332 # int | Start timestamp (optional) -to = 1547706332 # int | End timestamp (optional) -type = 'dnw' # str | Changing Type: - dnw: Deposit & Withdraw - pnl: Profit & Loss by reducing position - fee: Trading fee - refr: Referrer rebate - fund: Funding - point_dnw: POINT Deposit & Withdraw - point_fee: POINT Trading fee - point_refr: POINT Referrer rebate (optional) +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) +type = 'dnw' # str | Change types: - dnw: Deposit and withdrawal - pnl: Profit and loss from position reduction - fee: Trading fees - refr: Referrer rebates - fund: Funding fees - point_dnw: Point card deposit and withdrawal - point_fee: Point card trading fees - point_refr: Point card referrer rebates - bonus_offset: Trial fund deduction (optional) try: - # Query account book - api_response = api_instance.list_futures_account_book(settle, limit=limit, _from=_from, to=to, type=type) + # Query futures account change history + api_response = api_instance.list_futures_account_book(settle, contract=contract, limit=limit, offset=offset, _from=_from, to=to, type=type) print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) @@ -798,10 +1025,12 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | - **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] - **_from** | **int**| Start timestamp | [optional] - **to** | **int**| End timestamp | [optional] - **type** | **str**| Changing Type: - dnw: Deposit & Withdraw - pnl: Profit & Loss by reducing position - fee: Trading fee - refr: Referrer rebate - fund: Funding - point_dnw: POINT Deposit & Withdraw - point_fee: POINT Trading fee - point_refr: POINT Referrer rebate | [optional] + **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] + **type** | **str**| Change types: - dnw: Deposit and withdrawal - pnl: Profit and loss from position reduction - fee: Trading fees - refr: Referrer rebates - fund: Funding fees - point_dnw: Point card deposit and withdrawal - point_fee: Point card trading fees - point_refr: Point card referrer rebates - bonus_offset: Trial fund deduction | [optional] ### Return type @@ -819,14 +1048,14 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**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_positions** -> list[Position] list_positions(settle) +> list[Position] list_positions(settle, holding=holding, limit=limit, offset=offset) -List all positions of a user +Get user position list ### Example @@ -853,10 +1082,13 @@ 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 +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) +offset = 0 # int | List offset, starting from 0 (optional) (default to 0) try: - # List all positions of a user - api_response = api_instance.list_positions(settle) + # Get user position list + api_response = api_instance.list_positions(settle, holding=holding, limit=limit, offset=offset) print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) @@ -869,6 +1101,9 @@ except ApiException as e: 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] + **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] ### Return type @@ -886,14 +1121,14 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**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_position** > Position get_position(settle, contract) -Get single position +Get single position information ### Example @@ -923,7 +1158,7 @@ settle = 'usdt' # str | Settle currency contract = 'BTC_USDT' # str | Futures contract try: - # Get single position + # Get single position information api_response = api_instance.get_position(settle, contract) print(api_response) except GateApiException as ex: @@ -990,7 +1225,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 -change = '0.01' # str | Margin change. Use positive number to increase margin, negative number otherwise. +change = '0.01' # str | Margin change amount, positive number increases, negative number decreases try: # Update position margin @@ -1008,7 +1243,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | **contract** | **str**| Futures contract | - **change** | **str**| Margin change. Use positive number to increase margin, negative number otherwise. | + **change** | **str**| Margin change amount, positive number increases, negative number decreases | ### Return type @@ -1031,7 +1266,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) # **update_position_leverage** -> Position update_position_leverage(settle, contract, leverage, cross_leverage_limit=cross_leverage_limit) +> Position update_position_leverage(settle, contract, leverage, cross_leverage_limit=cross_leverage_limit, pid=pid) Update position leverage @@ -1062,11 +1297,12 @@ 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) +cross_leverage_limit = '10' # str | Cross margin leverage (valid only when `leverage` is 0) (optional) +pid = 1 # int | Product ID (optional) try: # Update position leverage - api_response = api_instance.update_position_leverage(settle, contract, leverage, cross_leverage_limit=cross_leverage_limit) + 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)) @@ -1081,7 +1317,8 @@ 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] + **cross_leverage_limit** | **str**| Cross margin leverage (valid only when `leverage` is 0) | [optional] + **pid** | **int**| Product ID | [optional] ### Return type @@ -1103,10 +1340,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_position_risk_limit** -> Position update_position_risk_limit(settle, contract, risk_limit) +# **update_position_cross_mode** +> Position update_position_cross_mode(settle, futures_position_cross_mode) -Update position risk limit +Switch Position Margin Mode ### Example @@ -1133,17 +1370,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 = '10' # str | New position risk limit +futures_position_cross_mode = gate_api.FuturesPositionCrossMode() # FuturesPositionCrossMode | try: - # Update position risk limit - api_response = api_instance.update_position_risk_limit(settle, contract, risk_limit) + # 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->update_position_risk_limit: %s\n" % e) + print("Exception when calling FuturesApi->update_position_cross_mode: %s\n" % e) ``` ### Parameters @@ -1151,8 +1387,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | - **contract** | **str**| Futures contract | - **risk_limit** | **str**| New position risk limit | + **futures_position_cross_mode** | [**FuturesPositionCrossMode**](FuturesPositionCrossMode.md)| | ### Return type @@ -1164,7 +1399,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details @@ -1174,12 +1409,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) +# **update_dual_comp_position_cross_mode** +> list[Position] update_dual_comp_position_cross_mode(settle, inline_object) -Enable or disable dual mode - -Before setting dual mode, make sure all positions are closed and no orders are open +Switch Between Cross and Isolated Margin Modes Under Hedge Mode ### Example @@ -1206,16 +1439,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 dual mode +inline_object = gate_api.InlineObject() # InlineObject | try: - # Enable or disable dual mode - api_response = api_instance.set_dual_mode(settle, dual_mode) + # Switch Between Cross and Isolated Margin Modes Under Hedge Mode + api_response = api_instance.update_dual_comp_position_cross_mode(settle, inline_object) 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_dual_comp_position_cross_mode: %s\n" % e) ``` ### Parameters @@ -1223,11 +1456,11 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | - **dual_mode** | **bool**| Whether to enable dual mode | + **inline_object** | [**InlineObject**](InlineObject.md)| | ### Return type -[**FuturesAccount**](FuturesAccount.md) +[**list[Position]**](Position.md) ### Authorization @@ -1235,20 +1468,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 | - | +**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_dual_mode_position** -> list[Position] get_dual_mode_position(settle, contract) +# **update_position_risk_limit** +> Position update_position_risk_limit(settle, contract, risk_limit) -Retrieve position detail in dual mode +Update position risk limit ### Example @@ -1276,15 +1509,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 +risk_limit = '1000000' # str | New risk limit value try: - # Retrieve position detail in dual mode - api_response = api_instance.get_dual_mode_position(settle, contract) + # 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->get_dual_mode_position: %s\n" % e) + print("Exception when calling FuturesApi->update_position_risk_limit: %s\n" % e) ``` ### Parameters @@ -1293,10 +1527,11 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | **contract** | **str**| Futures contract | + **risk_limit** | **str**| New risk limit value | ### Return type -[**list[Position]**](Position.md) +[**Position**](Position.md) ### Authorization @@ -1310,14 +1545,16 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**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_margin** -> list[Position] update_dual_mode_position_margin(settle, contract, change, dual_side) +# **set_dual_mode** +> FuturesAccount set_dual_mode(settle, dual_mode) -Update position margin in dual mode +Set position mode + +The prerequisite for changing mode is that all positions have no holdings and no pending orders ### Example @@ -1344,18 +1581,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 -change = '0.01' # str | Margin change. Use positive number to increase margin, negative number otherwise. -dual_side = 'dual_long' # str | Long or short position +dual_mode = true # bool | Whether to enable dual mode try: - # Update position margin in dual mode - api_response = api_instance.update_dual_mode_position_margin(settle, contract, change, dual_side) + # 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_margin: %s\n" % e) + print("Exception when calling FuturesApi->set_dual_mode: %s\n" % e) ``` ### Parameters @@ -1363,13 +1598,11 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | - **contract** | **str**| Futures contract | - **change** | **str**| Margin change. Use positive number to increase margin, negative number otherwise. | - **dual_side** | **str**| Long or short position | + **dual_mode** | **bool**| Whether to enable dual mode | ### Return type -[**list[Position]**](Position.md) +[**FuturesAccount**](FuturesAccount.md) ### Authorization @@ -1383,14 +1616,14 @@ Name | Type | Description | Notes ### 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) -# **update_dual_mode_position_leverage** -> list[Position] update_dual_mode_position_leverage(settle, contract, leverage) +# **get_dual_mode_position** +> list[Position] get_dual_mode_position(settle, contract) -Update position leverage in dual mode +Get position information in dual mode ### Example @@ -1418,16 +1651,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 -leverage = '10' # str | New position leverage try: - # Update position leverage in dual mode - api_response = api_instance.update_dual_mode_position_leverage(settle, contract, leverage) + # Get position information in dual 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->update_dual_mode_position_leverage: %s\n" % e) + print("Exception when calling FuturesApi->get_dual_mode_position: %s\n" % e) ``` ### Parameters @@ -1436,7 +1668,6 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | **contract** | **str**| Futures contract | - **leverage** | **str**| New position leverage | ### Return type @@ -1454,14 +1685,14 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**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) -# **update_dual_mode_position_risk_limit** -> list[Position] update_dual_mode_position_risk_limit(settle, contract, risk_limit) +# **update_dual_mode_position_margin** +> list[Position] update_dual_mode_position_margin(settle, contract, change, dual_side) -Update position risk limit in dual mode +Update position margin in dual mode ### Example @@ -1489,16 +1720,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 -risk_limit = '10' # str | New position risk limit +change = '0.01' # str | Margin change amount, positive number increases, negative number decreases +dual_side = 'dual_long' # str | Long or short position try: - # Update position risk limit in dual mode - api_response = api_instance.update_dual_mode_position_risk_limit(settle, contract, risk_limit) + # Update position margin in dual 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->update_dual_mode_position_risk_limit: %s\n" % e) + print("Exception when calling FuturesApi->update_dual_mode_position_margin: %s\n" % e) ``` ### Parameters @@ -1507,7 +1739,8 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | **contract** | **str**| Futures contract | - **risk_limit** | **str**| New position risk limit | + **change** | **str**| Margin change amount, positive number increases, negative number decreases | + **dual_side** | **str**| Long or short position | ### Return type @@ -1525,16 +1758,14 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**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_futures_orders** -> list[FuturesOrder] list_futures_orders(settle, contract, status, limit=limit, offset=offset, last_id=last_id, count_total=count_total) - -List futures orders +# **update_dual_mode_position_leverage** +> list[Position] update_dual_mode_position_leverage(settle, contract, leverage, cross_leverage_limit=cross_leverage_limit) -Zero-fill order cannot be retrieved for 60 seconds after cancellation +Update position leverage in dual mode ### Example @@ -1562,20 +1793,685 @@ api_client = gate_api.ApiClient(configuration) api_instance = gate_api.FuturesApi(api_client) settle = 'usdt' # str | Settle currency contract = 'BTC_USDT' # str | Futures contract -status = 'open' # str | Only list the orders with this status -limit = 100 # int | Maximum number of records to be 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 list staring point using the `id` of last record in previous list-query results (optional) -count_total = 0 # int | Whether to return total number matched. Default to 0(no return) (optional) (default to 0) +leverage = '10' # str | New position leverage +cross_leverage_limit = '10' # str | Cross margin leverage (valid only when `leverage` is 0) (optional) + +try: + # Update position leverage in dual 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->update_dual_mode_position_leverage: %s\n" % e) +``` + +### Parameters + +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] + +### Return type + +[**list[Position]**](Position.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) + +# **update_dual_mode_position_risk_limit** +> list[Position] update_dual_mode_position_risk_limit(settle, contract, risk_limit) + +Update position risk limit in dual 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.FuturesApi(api_client) +settle = 'usdt' # str | Settle currency +contract = 'BTC_USDT' # str | Futures contract +risk_limit = '1000000' # str | New risk limit value + +try: + # Update position risk limit in dual 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->update_dual_mode_position_risk_limit: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **settle** | **str**| Settle currency | + **contract** | **str**| Futures contract | + **risk_limit** | **str**| New risk limit value | + +### Return type + +[**list[Position]**](Position.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_futures_orders** +> list[FuturesOrder] list_futures_orders(settle, status, contract=contract, limit=limit, offset=offset, last_id=last_id) + +Query futures order list + +- 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 + +* 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 +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: + # 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->list_futures_orders: %s\n" % e) +``` + +### Parameters + +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] + +### 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** | 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_futures_order** +> FuturesOrder create_futures_order(settle, futures_order, x_gate_exptime=x_gate_exptime) + +Place futures order + +- 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 + +* 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() # 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 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->create_futures_order: %s\n" % e) +``` + +### Parameters + +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] + +### 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 | +|-------------|-------------|------------------| +**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_orders** +> list[FuturesOrder] cancel_futures_orders(settle, contract, x_gate_exptime=x_gate_exptime, side=side, exclude_reduce_only=exclude_reduce_only, text=text) + +Cancel all orders with 'open' status + +Zero-fill orders cannot be retrieved 10 minutes after order cancellation + +### 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 +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) +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, contract, x_gate_exptime=x_gate_exptime, 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 | + **contract** | **str**| Futures contract | + **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] + **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[FuturesOrder] 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[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** | 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 | 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. + +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**| 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. | + +### 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 | 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) + +try: + # Amend single order + api_response = api_instance.amend_futures_order(settle, order_id, futures_order_amendment, 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_futures_order: %s\n" % e) +``` + +### Parameters + +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)| | + **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) + +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 | 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) try: - # List futures orders - api_response = api_instance.list_futures_orders(settle, contract, status, limit=limit, offset=offset, last_id=last_id, count_total=count_total) + # Cancel single order + api_response = api_instance.cancel_futures_order(settle, order_id, 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->list_futures_orders: %s\n" % e) + print("Exception when calling FuturesApi->cancel_futures_order: %s\n" % e) ``` ### Parameters @@ -1583,16 +2479,12 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | - **contract** | **str**| Futures contract | - **status** | **str**| Only list the orders with this status | - **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] - **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] - **last_id** | **str**| Specify list staring point using the `id` of last record in previous list-query results | [optional] - **count_total** | **int**| Whether to return total number matched. Default to 0(no return) | [optional] [default to 0] + **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] ### Return type -[**list[FuturesOrder]**](FuturesOrder.md) +[**FuturesOrder**](FuturesOrder.md) ### Authorization @@ -1606,16 +2498,16 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | * X-Pagination-Limit - Request limit specified
* X-Pagination-Offset - Request offset specified
* X-Pagination-Total - Total number matched. Only returned if `count_total` set to 1
| +**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) -# **create_futures_order** -> FuturesOrder create_futures_order(settle, futures_order) +# **get_my_trades** +> list[MyFuturesTrade] get_my_trades(settle, contract=contract, order=order, limit=limit, offset=offset, last_id=last_id) -Create a futures order +Query personal trading records -Zero-fill order cannot be retrieved for 60 seconds after cancellation +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`. ### Example @@ -1642,16 +2534,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() # FuturesOrder | +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: - # Create a futures order - api_response = api_instance.create_futures_order(settle, futures_order) + # 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->create_futures_order: %s\n" % e) + print("Exception when calling FuturesApi->get_my_trades: %s\n" % e) ``` ### Parameters @@ -1659,11 +2555,15 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | - **futures_order** | [**FuturesOrder**](FuturesOrder.md)| | + **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 -[**FuturesOrder**](FuturesOrder.md) +[**list[MyFuturesTrade]**](MyFuturesTrade.md) ### Authorization @@ -1671,22 +2571,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** | 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) -# **cancel_futures_orders** -> list[FuturesOrder] cancel_futures_orders(settle, contract, side=side) - -Cancel all `open` orders matched +# **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) -Zero-fill order cannot be retrieved for 60 seconds after cancellation +Query personal trading records by time range ### Example @@ -1713,17 +2611,21 @@ 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 -side = 'ask' # str | All bids or asks. Both included if not specified (optional) +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: - # Cancel all `open` orders matched - api_response = api_instance.cancel_futures_orders(settle, contract, side=side) + # 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->cancel_futures_orders: %s\n" % e) + print("Exception when calling FuturesApi->get_my_trades_with_time_range: %s\n" % e) ``` ### Parameters @@ -1731,12 +2633,16 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | - **contract** | **str**| Futures contract | - **side** | **str**| All bids or asks. Both included if not specified | [optional] + **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[FuturesOrder]**](FuturesOrder.md) +[**list[MyFuturesTradeTimeRange]**](MyFuturesTradeTimeRange.md) ### Authorization @@ -1750,16 +2656,14 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | All orders matched cancelled | - | +**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) - -Get a single order +# **list_position_close** +> list[PositionClose] list_position_close(settle, contract=contract, limit=limit, offset=offset, _from=_from, to=to, side=side, pnl=pnl) -Zero-fill order cannot be retrieved for 60 seconds after cancellation +Query position close history ### Example @@ -1786,16 +2690,22 @@ 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 are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. +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: - # Get a single order - api_response = api_instance.get_futures_order(settle, order_id) + # 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->get_futures_order: %s\n" % e) + print("Exception when calling FuturesApi->list_position_close: %s\n" % e) ``` ### Parameters @@ -1803,11 +2713,17 @@ 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 are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. | + **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 -[**FuturesOrder**](FuturesOrder.md) +[**list[PositionClose]**](PositionClose.md) ### Authorization @@ -1821,14 +2737,14 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Order details | - | +**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) -# **cancel_futures_order** -> FuturesOrder cancel_futures_order(settle, order_id) +# **list_liquidates** +> list[FuturesLiquidate] list_liquidates(settle, contract=contract, limit=limit, offset=offset, _from=_from, to=to, at=at) -Cancel a single order +Query liquidation history ### Example @@ -1855,16 +2771,21 @@ 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 are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. +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: - # Cancel a single order - api_response = api_instance.cancel_futures_order(settle, order_id) + # 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->cancel_futures_order: %s\n" % e) + print("Exception when calling FuturesApi->list_liquidates: %s\n" % e) ``` ### Parameters @@ -1872,11 +2793,16 @@ 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 are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. | + **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 -[**FuturesOrder**](FuturesOrder.md) +[**list[FuturesLiquidate]**](FuturesLiquidate.md) ### Authorization @@ -1890,14 +2816,14 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Order details | - | +**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_my_trades** -> list[MyFuturesTrade] get_my_trades(settle, contract=contract, order=order, limit=limit, offset=offset, last_id=last_id, count_total=count_total) +# **list_auto_deleverages** +> list[FuturesAutoDeleverage] list_auto_deleverages(settle, contract=contract, limit=limit, offset=offset, _from=_from, to=to, at=at) -List personal trading history +Query ADL auto-deleveraging order information ### Example @@ -1925,20 +2851,20 @@ api_client = gate_api.ApiClient(configuration) 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 to be returned in a single list (optional) (default to 100) +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 list staring point using the `id` of last record in previous list-query results (optional) -count_total = 0 # int | Whether to return total number matched. Default to 0(no return) (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: - # List personal trading history - api_response = api_instance.get_my_trades(settle, contract=contract, order=order, limit=limit, offset=offset, last_id=last_id, count_total=count_total) + # 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->get_my_trades: %s\n" % e) + print("Exception when calling FuturesApi->list_auto_deleverages: %s\n" % e) ``` ### Parameters @@ -1947,15 +2873,15 @@ 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 to be returned in a single list | [optional] [default to 100] + **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 list staring point using the `id` of last record in previous list-query results | [optional] - **count_total** | **int**| Whether to return total number matched. Default to 0(no return) | [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[MyFuturesTrade]**](MyFuturesTrade.md) +[**list[FuturesAutoDeleverage]**](FuturesAutoDeleverage.md) ### Authorization @@ -1969,14 +2895,85 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | * X-Pagination-Limit - Request limit specified
* X-Pagination-Offset - Request offset specified
* X-Pagination-Total - Total number matched. Only returned if `count_total` set to 1
| +**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_position_close** -> list[PositionClose] list_position_close(settle, contract=contract, limit=limit, offset=offset, _from=_from, to=to) +# **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) -List position close history +Query futures market trading fee rates ### Example @@ -2004,19 +3001,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, return related data only if specified (optional) -limit = 100 # int | Maximum number of records to be 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 (optional) -to = 1547706332 # int | End timestamp (optional) try: - # List position close history - api_response = api_instance.list_position_close(settle, contract=contract, limit=limit, offset=offset, _from=_from, to=to) + # 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->list_position_close: %s\n" % e) + print("Exception when calling FuturesApi->get_futures_fee: %s\n" % e) ``` ### Parameters @@ -2025,14 +3018,10 @@ 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 to be returned in a single list | [optional] [default to 100] - **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] - **_from** | **int**| Start timestamp | [optional] - **to** | **int**| End timestamp | [optional] ### Return type -[**list[PositionClose]**](PositionClose.md) +[**dict(str, FuturesFee)**](FuturesFee.md) ### Authorization @@ -2046,14 +3035,16 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**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, at=at) +# **cancel_batch_future_orders** +> list[FutureCancelOrderResult] cancel_batch_future_orders(settle, request_body, x_gate_exptime=x_gate_exptime) -List liquidation history +Cancel batch orders by specified ID list + +Multiple different order IDs can be specified, maximum 20 records per request ### Example @@ -2080,18 +3071,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) -limit = 100 # int | Maximum number of records to be returned in a single list (optional) (default to 100) -at = 0 # int | Specify a liquidation timestamp (optional) (default to 0) +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) try: - # List liquidation history - api_response = api_instance.list_liquidates(settle, contract=contract, limit=limit, at=at) + # 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->list_liquidates: %s\n" % e) + print("Exception when calling FuturesApi->cancel_batch_future_orders: %s\n" % e) ``` ### Parameters @@ -2099,18 +3089,152 @@ 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 to be returned in a single list | [optional] [default to 100] - **at** | **int**| Specify a liquidation timestamp | [optional] [default to 0] + **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[FuturesLiquidate]**](FuturesLiquidate.md) +[**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, maximum 10 orders per 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 @@ -2119,14 +3243,14 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**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_price_triggered_orders** > list[FuturesPriceTriggeredOrder] list_price_triggered_orders(settle, status, contract=contract, limit=limit, offset=offset) -List all auto orders +Query auto order list ### Example @@ -2153,13 +3277,13 @@ 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 = 'status_example' # str | Only list the orders with this status +status = 'status_example' # 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 to be returned in a single list (optional) (default to 100) +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: - # List all auto orders + # Query auto order list api_response = api_instance.list_price_triggered_orders(settle, status, contract=contract, limit=limit, offset=offset) print(api_response) except GateApiException as ex: @@ -2173,9 +3297,9 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | - **status** | **str**| Only list the orders with this status | + **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 to be returned in a single list | [optional] [default to 100] + **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 @@ -2194,14 +3318,14 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**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) # **create_price_triggered_order** > TriggerOrderResponse create_price_triggered_order(settle, futures_price_triggered_order) -Create a price-triggered order +Create price-triggered order ### Example @@ -2231,7 +3355,7 @@ settle = 'usdt' # str | Settle currency futures_price_triggered_order = gate_api.FuturesPriceTriggeredOrder() # FuturesPriceTriggeredOrder | try: - # Create a price-triggered order + # Create price-triggered order api_response = api_instance.create_price_triggered_order(settle, futures_price_triggered_order) print(api_response) except GateApiException as ex: @@ -2263,14 +3387,14 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**201** | Order created | - | +**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_price_triggered_order_list** -> list[FuturesPriceTriggeredOrder] cancel_price_triggered_order_list(settle, contract) +> list[FuturesPriceTriggeredOrder] cancel_price_triggered_order_list(settle, contract=contract) -Cancel all open orders +Cancel all auto orders ### Example @@ -2297,11 +3421,11 @@ 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 +contract = 'BTC_USDT' # str | Futures contract, return related data only if specified (optional) try: - # Cancel all open orders - api_response = api_instance.cancel_price_triggered_order_list(settle, contract) + # Cancel all auto orders + api_response = api_instance.cancel_price_triggered_order_list(settle, contract=contract) print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) @@ -2314,7 +3438,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | - **contract** | **str**| Futures contract | + **contract** | **str**| Futures contract, return related data only if specified | [optional] ### Return type @@ -2332,14 +3456,14 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Batch cancellation request accepted. Query order status by listing orders | - | +**200** | Batch cancellation request accepted and processed, success determined by 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_price_triggered_order** > FuturesPriceTriggeredOrder get_price_triggered_order(settle, order_id) -Get a single order +Query single auto order details ### Example @@ -2366,10 +3490,10 @@ 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 | Retrieve the data of the order with the specified ID +order_id = 'order_id_example' # str | ID returned when order is successfully created try: - # Get a single order + # Query single auto order details api_response = api_instance.get_price_triggered_order(settle, order_id) print(api_response) except GateApiException as ex: @@ -2383,7 +3507,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | - **order_id** | **str**| Retrieve the data of the order with the specified ID | + **order_id** | **str**| ID returned when order is successfully created | ### Return type @@ -2401,14 +3525,14 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Auto order detail | - | +**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) -Cancel a single order +Cancel single auto order ### Example @@ -2435,10 +3559,10 @@ 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 | Retrieve the data of the order with the specified ID +order_id = 'order_id_example' # str | ID returned when order is successfully created try: - # Cancel a single order + # Cancel single auto order api_response = api_instance.cancel_price_triggered_order(settle, order_id) print(api_response) except GateApiException as ex: @@ -2452,7 +3576,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | - **order_id** | **str**| Retrieve the data of the order with the specified ID | + **order_id** | **str**| ID returned when order is successfully created | ### Return type @@ -2470,7 +3594,7 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Auto order detail | - | +**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) diff --git a/docs/FuturesAutoDeleverage.md b/docs/FuturesAutoDeleverage.md new file mode 100644 index 0000000..1f2d674 --- /dev/null +++ b/docs/FuturesAutoDeleverage.md @@ -0,0 +1,19 @@ +# FuturesAutoDeleverage + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**time** | **int** | Automatic deleveraging time | [optional] [readonly] +**user** | **int** | User ID | [optional] [readonly] +**order_id** | **int** | Order ID. Order IDs before 2023-02-20 are null | [optional] [readonly] +**contract** | **str** | Futures contract | [optional] [readonly] +**leverage** | **str** | Position leverage | [optional] [readonly] +**cross_leverage_limit** | **str** | Cross margin leverage (valid only when `leverage` is 0) | [optional] [readonly] +**entry_price** | **str** | Average entry price | [optional] [readonly] +**fill_price** | **str** | Average fill price | [optional] [readonly] +**trade_size** | **int** | Trading size | [optional] [readonly] +**position_size** | **int** | Positions after auto-deleveraging | [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/FuturesBatchAmendOrderRequest.md b/docs/FuturesBatchAmendOrderRequest.md new file mode 100644 index 0000000..b8a8467 --- /dev/null +++ b/docs/FuturesBatchAmendOrderRequest.md @@ -0,0 +1,15 @@ +# FuturesBatchAmendOrderRequest + +Modify contract order parameters +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**order_id** | **int** | Order id, order_id and text must contain at least one | [optional] +**text** | **str** | User-defined order text, at least one of order_id and text must be passed | [optional] +**size** | **int** | 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] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FuturesCandlestick.md b/docs/FuturesCandlestick.md index 5d73a6b..202685d 100644 --- a/docs/FuturesCandlestick.md +++ b/docs/FuturesCandlestick.md @@ -5,11 +5,12 @@ data point in every timestamp Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **t** | **float** | Unix timestamp in seconds | [optional] -**v** | **int** | size volume. Only returned if `contract` is not prefixed | [optional] -**c** | **str** | Close price | [optional] -**h** | **str** | Highest price | [optional] -**l** | **str** | Lowest price | [optional] -**o** | **str** | Open price | [optional] +**v** | **int** | size volume (contract size). Only returned if `contract` is not prefixed | [optional] +**c** | **str** | Close price (quote currency) | [optional] +**h** | **str** | Highest price (quote currency) | [optional] +**l** | **str** | Lowest price (quote currency) | [optional] +**o** | **str** | Open price (quote currency) | [optional] +**sum** | **str** | Trading volume (unit: Quote 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/FuturesFee.md b/docs/FuturesFee.md new file mode 100644 index 0000000..5b3c0df --- /dev/null +++ b/docs/FuturesFee.md @@ -0,0 +1,12 @@ +# FuturesFee + +The returned result is a map type, where the key represents the market and taker and maker fee rates +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**taker_fee** | **str** | Taker fee | [optional] [readonly] +**maker_fee** | **str** | maker fee | [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/FuturesIndexConstituents.md b/docs/FuturesIndexConstituents.md new file mode 100644 index 0000000..7564bbe --- /dev/null +++ b/docs/FuturesIndexConstituents.md @@ -0,0 +1,11 @@ +# FuturesIndexConstituents + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**index** | **str** | Index name | [optional] [readonly] +**constituents** | [**list[IndexConstituent]**](IndexConstituent.md) | Constituents | [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/FuturesInitialOrder.md b/docs/FuturesInitialOrder.md index 4ce91c3..6c6dd28 100644 --- a/docs/FuturesInitialOrder.md +++ b/docs/FuturesInitialOrder.md @@ -4,12 +4,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **contract** | **str** | Futures contract | -**size** | **int** | Order size. Positive size means to buy, while negative one means to sell. Set to 0 to close the position | [optional] +**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] **price** | **str** | Order price. Set to 0 to use market price | -**close** | **bool** | Set to true if trying to close the position | [optional] [default to False] -**tif** | **str** | Time in force. If using market price, only `ioc` is supported. - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled | [optional] [default to 'gtc'] -**text** | **str** | How the order is created. Possible values are: web, api and app | [optional] -**reduce_only** | **bool** | Set to true to create a reduce-only order | [optional] [default to False] +**close** | **bool** | When all positions are closed in a single position mode, it must be set to true to perform the closing operation When partially closed positions in single-store mode/double-store mode, you can not set close, or close=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] +**auto_size** | **str** | Single position mode: auto_size is not required Dual position mode full closing (size=0): auto_size must be set, close_long for closing long positions, close_short for closing short positions Dual position mode partial closing (size≠0): auto_size is not required | [optional] **is_reduce_only** | **bool** | Is the order reduce-only | [optional] [readonly] **is_close** | **bool** | Is the order to close position | [optional] [readonly] diff --git a/docs/FuturesLimitRiskTiers.md b/docs/FuturesLimitRiskTiers.md new file mode 100644 index 0000000..704f833 --- /dev/null +++ b/docs/FuturesLimitRiskTiers.md @@ -0,0 +1,17 @@ +# FuturesLimitRiskTiers + +Retrieve risk limit configurations for different tiers under a specified contract +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tier** | **int** | Tier | [optional] +**risk_limit** | **str** | Position risk limit | [optional] +**initial_rate** | **str** | Initial margin rate | [optional] +**maintenance_rate** | **str** | Maintenance margin rate | [optional] +**leverage_max** | **str** | Maximum leverage | [optional] +**contract** | **str** | Market, only visible when market pagination is requested | [optional] +**deduction** | **str** | Maintenance margin quick calculation deduction 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/FuturesLiqOrder.md b/docs/FuturesLiqOrder.md new file mode 100644 index 0000000..daf3c5e --- /dev/null +++ b/docs/FuturesLiqOrder.md @@ -0,0 +1,16 @@ +# FuturesLiqOrder + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**time** | **int** | Liquidation time | [optional] [readonly] +**contract** | **str** | Futures contract | [optional] [readonly] +**size** | **int** | User position size | [optional] [readonly] +**order_size** | **int** | 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** | **int** | System liquidation order maker size | [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/FuturesLiquidate.md b/docs/FuturesLiquidate.md index c8575b9..78b62b2 100644 --- a/docs/FuturesLiquidate.md +++ b/docs/FuturesLiquidate.md @@ -5,13 +5,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **time** | **int** | Liquidation time | [optional] [readonly] **contract** | **str** | Futures contract | [optional] [readonly] -**leverage** | **str** | Position leverage. Not returned in public endpoints. | [optional] [readonly] +**leverage** | **str** | Position leverage. Not returned in public endpoints | [optional] [readonly] **size** | **int** | Position size | [optional] [readonly] -**margin** | **str** | Position margin. Not returned in public endpoints. | [optional] [readonly] -**entry_price** | **str** | Average entry price. Not returned in public endpoints. | [optional] [readonly] -**liq_price** | **str** | Liquidation price. Not returned in public endpoints. | [optional] [readonly] -**mark_price** | **str** | Mark price. Not returned in public endpoints. | [optional] [readonly] -**order_id** | **int** | Liquidation order ID. Not returned in public endpoints. | [optional] [readonly] +**margin** | **str** | Position margin. Not returned in public endpoints | [optional] [readonly] +**entry_price** | **str** | Average entry price. Not returned in public endpoints | [optional] [readonly] +**liq_price** | **str** | Liquidation price. Not returned in public endpoints | [optional] [readonly] +**mark_price** | **str** | Mark price. Not returned in public endpoints | [optional] [readonly] +**order_id** | **int** | Liquidation order ID. Not returned in public endpoints | [optional] [readonly] **order_price** | **str** | Liquidation order price | [optional] [readonly] **fill_price** | **str** | Liquidation order average taker price | [optional] [readonly] **left** | **int** | Liquidation order maker size | [optional] [readonly] diff --git a/docs/FuturesOrder.md b/docs/FuturesOrder.md index ed13ed6..1d0de6a 100644 --- a/docs/FuturesOrder.md +++ b/docs/FuturesOrder.md @@ -7,26 +7,32 @@ 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** | **float** | OrderUpdateTime | [optional] [readonly] **finish_time** | **float** | 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 of position close | [optional] [readonly] -**status** | **str** | Order status - `open`: waiting to be traded - `finished`: finished | [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** | **int** | Order size. Specify positive number to make a bid, and negative number to ask | -**iceberg** | **int** | Display size for iceberg order. 0 for non-iceberg. Note that you will have to pay the taker fee for the hidden size | [optional] -**price** | **str** | Order price. 0 for market order with `tif` set as `ioc` | [optional] +**size** | **int** | Required. Trading quantity. Positive for buy, negative for sell. Set to 0 for close position orders. | +**iceberg** | **int** | Display size for iceberg orders. 0 for non-iceberg orders. Note that hidden portions are charged taker fees. | [optional] +**price** | **str** | Order price. Price of 0 with `tif` set to `ioc` represents a market order. | [optional] **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, reduce-only | [optional] [default to 'gtc'] -**left** | **int** | Size left to be traded | [optional] [readonly] -**fill_price** | **str** | Fill price of the order | [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: - web: from web - api: from API - app: from mobile phones - auto_deleveraging: from ADL - liquidation: from liquidation - insurance: from insurance | [optional] +**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** | 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 | [optional] **tkfr** | **str** | Taker fee | [optional] [readonly] **mkfr** | **str** | Maker fee | [optional] [readonly] -**refu** | **int** | Reference user ID | [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] +**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/FuturesOrderAmendment.md b/docs/FuturesOrderAmendment.md new file mode 100644 index 0000000..4e3bce2 --- /dev/null +++ b/docs/FuturesOrderAmendment.md @@ -0,0 +1,13 @@ +# FuturesOrderAmendment + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**size** | **int** | New order size, including filled part. - If new size is less than or equal to filled size, the order will be cancelled. - Order side must be identical to the original one. - Close order size cannot be changed. - For reduce only orders, increasing size may leads to other reduce only orders being cancelled. - If price is not changed, decreasing size will not change its precedence in order book, while increasing will move it to the last at current price. | [optional] +**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] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FuturesOrderBook.md b/docs/FuturesOrderBook.md index f8ed364..392c531 100644 --- a/docs/FuturesOrderBook.md +++ b/docs/FuturesOrderBook.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[FuturesOrderBookItem]**](FuturesOrderBookItem.md) | Asks order depth | -**bids** | [**list[FuturesOrderBookItem]**](FuturesOrderBookItem.md) | Bids order depth | +**asks** | [**list[FuturesOrderBookItem]**](FuturesOrderBookItem.md) | Ask Depth | +**bids** | [**list[FuturesOrderBookItem]**](FuturesOrderBookItem.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/FuturesOrderBookItem.md b/docs/FuturesOrderBookItem.md index c1ea850..9f3356e 100644 --- a/docs/FuturesOrderBookItem.md +++ b/docs/FuturesOrderBookItem.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**p** | **str** | Price | [optional] +**p** | **str** | Price (quote currency) | [optional] **s** | **int** | Size | [optional] [[Back to Model list]](../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 new file mode 100644 index 0000000..65b0f1d --- /dev/null +++ b/docs/FuturesPositionCrossMode.md @@ -0,0 +1,11 @@ +# FuturesPositionCrossMode + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mode** | **str** | Cross margin or isolated margin mode. ISOLATED - isolated margin mode, CROSS - cross margin mode | +**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 new file mode 100644 index 0000000..91041ef --- /dev/null +++ b/docs/FuturesPremiumIndex.md @@ -0,0 +1,15 @@ +# FuturesPremiumIndex + +data point in every timestamp +## Properties +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] +**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/FuturesPriceTrigger.md b/docs/FuturesPriceTrigger.md index 2ae520f..5fd4eeb 100644 --- a/docs/FuturesPriceTrigger.md +++ b/docs/FuturesPriceTrigger.md @@ -3,11 +3,11 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**strategy_type** | **int** | How the order will be triggered - `0`: by price, which means the order will be triggered if price condition is satisfied - `1`: by price gap, which means the order will be triggered if gap of recent two prices of specified `price_type` are satisfied. Only `0` is supported currently | [optional] -**price_type** | **int** | Price type. 0 - latest deal price, 1 - mark price, 2 - index price | [optional] -**price** | **str** | Value of price on price triggered, or price gap on price gap triggered | [optional] -**rule** | **int** | Trigger condition type - `1`: calculated price based on `strategy_type` and `price_type` >= `price` - `2`: calculated price based on `strategy_type` and `price_type` <= `price` | [optional] -**expiration** | **int** | How long (in seconds) to wait for the condition to be triggered before cancelling the order. | [optional] +**strategy_type** | **int** | Trigger Strategy - 0: Price trigger, triggered when price meets conditions - 1: Price spread trigger, i.e. the difference between the latest price specified in `price_type` and the second-last price Currently only supports 0 (latest transaction price) | [optional] +**price_type** | **int** | Reference price type. 0 - Latest trade price, 1 - Mark price, 2 - Index price | [optional] +**price** | **str** | Price value for price trigger, or spread value for spread trigger | [optional] +**rule** | **int** | Price Condition Type - 1: Trigger when the price calculated based on `strategy_type` and `price_type` is greater than or equal to `Trigger.Price`, while Trigger.Price must > last_price - 2: Trigger when the price calculated based on `strategy_type` and `price_type` is less than or equal to `Trigger.Price`, and Trigger.Price must < last_price | [optional] +**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/FuturesPriceTriggeredOrder.md b/docs/FuturesPriceTriggeredOrder.md index cfc7510..d28e980 100644 --- a/docs/FuturesPriceTriggeredOrder.md +++ b/docs/FuturesPriceTriggeredOrder.md @@ -1,6 +1,6 @@ # FuturesPriceTriggeredOrder -Futures order details +Futures price-triggered order details ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- @@ -8,12 +8,14 @@ Name | Type | Description | Notes **trigger** | [**FuturesPriceTrigger**](FuturesPriceTrigger.md) | | **id** | **int** | Auto order ID | [optional] [readonly] **user** | **int** | User ID | [optional] [readonly] -**create_time** | **float** | Creation time | [optional] [readonly] -**finish_time** | **float** | Finished time | [optional] [readonly] -**trade_id** | **int** | ID of the newly created order on condition triggered | [optional] [readonly] -**status** | **str** | Order status. | [optional] [readonly] -**finish_as** | **str** | How order is finished | [optional] [readonly] -**reason** | **str** | Additional remarks on how the order was finished | [optional] [readonly] +**create_time** | **float** | Created time | [optional] [readonly] +**finish_time** | **float** | End time | [optional] [readonly] +**trade_id** | **int** | ID of the order created after trigger | [optional] [readonly] +**status** | **str** | Order status - `open`: Active - `finished`: Finished - `inactive`: Inactive, only applies to order take-profit/stop-loss - `invalid`: Invalid, only applies to order take-profit/stop-loss | [optional] [readonly] +**finish_as** | **str** | Finish status: cancelled - Cancelled; succeeded - Succeeded; failed - Failed; expired - Expired | [optional] [readonly] +**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] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/FuturesRiskLimitTier.md b/docs/FuturesRiskLimitTier.md new file mode 100644 index 0000000..10b759a --- /dev/null +++ b/docs/FuturesRiskLimitTier.md @@ -0,0 +1,16 @@ +# FuturesRiskLimitTier + +Information for each tier of the gradient risk limit table +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tier** | **int** | Tier | [optional] +**risk_limit** | **str** | Position risk limit | [optional] +**initial_rate** | **str** | Initial margin rate | [optional] +**maintenance_rate** | **str** | Maintenance margin rate | [optional] +**leverage_max** | **str** | Maximum leverage | [optional] +**deduction** | **str** | Maintenance margin quick calculation deduction 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/FuturesTicker.md b/docs/FuturesTicker.md index e7fe936..d0f8511 100644 --- a/docs/FuturesTicker.md +++ b/docs/FuturesTicker.md @@ -5,21 +5,30 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **contract** | **str** | Futures contract | [optional] **last** | **str** | Last trading price | [optional] -**change_percentage** | **str** | Change percentage. | [optional] +**change_percentage** | **str** | Price change percentage. Negative values indicate price decrease, e.g. -7.45 | [optional] **total_size** | **str** | Contract total size | [optional] -**low_24h** | **str** | Lowest trading price in recent 24h | [optional] -**high_24h** | **str** | Highest trading price in recent 24h | [optional] -**volume_24h** | **str** | Trade size in recent 24h | [optional] -**volume_24h_btc** | **str** | Trade volumes in recent 24h in BTC(deprecated, use `volume_24h_base`, `volume_24h_quote`, `volume_24h_settle` instead) | [optional] -**volume_24h_usd** | **str** | Trade volumes in recent 24h in USD(deprecated, use `volume_24h_base`, `volume_24h_quote`, `volume_24h_settle` instead) | [optional] -**volume_24h_base** | **str** | Trade volume in recent 24h, in base currency | [optional] -**volume_24h_quote** | **str** | Trade volume in recent 24h, in quote currency | [optional] -**volume_24h_settle** | **str** | Trade volume in recent 24h, in settle currency | [optional] +**low_24h** | **str** | 24-hour lowest price | [optional] +**high_24h** | **str** | 24-hour highest price | [optional] +**volume_24h** | **str** | 24-hour trading volume | [optional] +**volume_24h_btc** | **str** | 24-hour trading volume in BTC (deprecated, use `volume_24h_base`, `volume_24h_quote`, `volume_24h_settle` instead) | [optional] +**volume_24h_usd** | **str** | 24-hour trading volume in USD (deprecated, use `volume_24h_base`, `volume_24h_quote`, `volume_24h_settle` instead) | [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] +**volume_24h_settle** | **str** | 24-hour trading volume in settle currency | [optional] **mark_price** | **str** | Recent mark price | [optional] **funding_rate** | **str** | Funding rate | [optional] -**funding_rate_indicative** | **str** | Indicative Funding rate in next period | [optional] +**funding_rate_indicative** | **str** | Indicative Funding rate in next period. (deprecated. use `funding_rate`) | [optional] **index_price** | **str** | Index price | [optional] **quanto_base_rate** | **str** | Exchange rate of base currency and settlement currency in Quanto contract. Does not exists in contracts of other types | [optional] +**lowest_ask** | **str** | Recent lowest ask | [optional] +**lowest_size** | **str** | The latest seller's lowest price order quantity | [optional] +**highest_bid** | **str** | Recent highest bid | [optional] +**highest_size** | **str** | The latest buyer's highest price order volume | [optional] +**change_utc0** | **str** | Percentage change at utc0. Negative values indicate a drop, e.g., -7.45% | [optional] +**change_utc8** | **str** | Percentage change at utc8. Negative values indicate a drop, e.g., -7.45% | [optional] +**change_price** | **str** | 24h change amount. Negative values indicate a drop, e.g., -7.45 | [optional] +**change_utc0_price** | **str** | Change amount at utc0. Negative values indicate a drop, e.g., -7.45 | [optional] +**change_utc8_price** | **str** | Change amount at utc8. Negative values indicate a drop, e.g., -7.45 | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/FuturesTrade.md b/docs/FuturesTrade.md index 3d117ed..af3b9fe 100644 --- a/docs/FuturesTrade.md +++ b/docs/FuturesTrade.md @@ -3,12 +3,13 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **int** | Trade ID | [optional] -**create_time** | **float** | Trading time | [optional] -**create_time_ms** | **float** | Trading time, with milliseconds set to 3 decimal places. | [optional] +**id** | **int** | Fill ID | [optional] +**create_time** | **float** | Fill Time | [optional] +**create_time_ms** | **float** | Trade time, with millisecond precision to 3 decimal places | [optional] **contract** | **str** | Futures contract | [optional] **size** | **int** | Trading size | [optional] -**price** | **str** | Trading price | [optional] +**price** | **str** | Trade price (quote currency) | [optional] +**is_internal** | **bool** | Whether it is an internal trade. Internal trade refers to the takeover of liquidation orders by the insurance fund and ADL users. Since it is not a normal matching on the market depth, the trade price may deviate from the market, and it will not be recorded in the K-line. If it is not an internal trade, this field will not 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/IndexConstituent.md b/docs/IndexConstituent.md new file mode 100644 index 0000000..a80703f --- /dev/null +++ b/docs/IndexConstituent.md @@ -0,0 +1,11 @@ +# IndexConstituent + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**exchange** | **str** | Exchange | [optional] +**symbols** | **list[str]** | 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/InlineObject.md b/docs/InlineObject.md new file mode 100644 index 0000000..dccf5f1 --- /dev/null +++ b/docs/InlineObject.md @@ -0,0 +1,11 @@ +# InlineObject + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mode** | **str** | Cross margin or isolated margin mode. ISOLATED - isolated margin mode, CROSS - cross margin mode | +**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/InlineResponse200.md b/docs/InlineResponse200.md new file mode 100644 index 0000000..30030f5 --- /dev/null +++ b/docs/InlineResponse200.md @@ -0,0 +1,11 @@ +# InlineResponse200 + +## 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/InlineResponse2001.md b/docs/InlineResponse2001.md new file mode 100644 index 0000000..31a5f58 --- /dev/null +++ b/docs/InlineResponse2001.md @@ -0,0 +1,11 @@ +# InlineResponse2001 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **str** | | [optional] +**est_rate** | **str** | Unconverted percentage | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/LedgerRecord.md b/docs/LedgerRecord.md index f9d68e9..869f179 100644 --- a/docs/LedgerRecord.md +++ b/docs/LedgerRecord.md @@ -5,13 +5,16 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | Record ID | [optional] [readonly] **txid** | **str** | Hash record of the withdrawal | [optional] [readonly] +**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] **timestamp** | **str** | Operation time | [optional] [readonly] -**amount** | **str** | Currency amount | +**amount** | **str** | Token amount | **currency** | **str** | Currency name | **address** | **str** | Withdrawal address. Required for withdrawals | [optional] **memo** | **str** | Additional remarks with regards to the withdrawal | [optional] -**status** | **str** | Record status. - DONE: done - CANCEL: cancelled - REQUEST: requesting - MANUAL: pending manual approval - BCODE: GateCode operation - EXTPEND: pending confirm after sending - FAIL: pending confirm when fail | [optional] [readonly] -**chain** | **str** | Name of the chain used in withdrawals | [optional] +**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** | Withdrawal record currency type, empty by default. Supports users to query withdrawal records in main area and innovation area on demand. Valid values: SPOT, PILOT SPOT: Main area PILOT: Innovation area | [optional] +**status** | **str** | Transaction status - DONE: Completed - CANCEL: Cancelled - REQUEST: Requesting - MANUAL: Pending manual review - BCODE: GateCode operation - EXTPEND: Sent, waiting for confirmation - FAIL: Failed on chain, waiting for confirmation - INVALID: Invalid order - VERIFY: Verifying - PROCES: Processing - PEND: Processing - DMOVE: Pending manual review - 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/docs/LiquidateOrder.md b/docs/LiquidateOrder.md new file mode 100644 index 0000000..df396e0 --- /dev/null +++ b/docs/LiquidateOrder.md @@ -0,0 +1,15 @@ +# LiquidateOrder + +Spot liquidation order details +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**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] +**currency_pair** | **str** | Currency pair | +**amount** | **str** | Trade amount | +**price** | **str** | Order price | +**action_mode** | **str** | Processing mode: Different fields are returned when placing an order based on action_mode. This field is only valid during the request and is not included in the response `ACK`: Asynchronous mode, only returns key order fields `RESULT`: No liquidation 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/Loan.md b/docs/Loan.md deleted file mode 100644 index 5af4bd0..0000000 --- a/docs/Loan.md +++ /dev/null @@ -1,28 +0,0 @@ -# Loan - -Margin loan details -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **str** | Loan ID | [optional] [readonly] -**create_time** | **str** | Creation time | [optional] [readonly] -**expire_time** | **str** | Repay time of the loan. No value will be returned for lending loan | [optional] [readonly] -**status** | **str** | Loan status open - not fully loaned loaned - all loaned out for lending loan; loaned in for borrowing side finished - loan is finished, either being all repaid or cancelled by the lender auto_repaid - automatically repaid by the system | [optional] [readonly] -**side** | **str** | Loan side | -**currency** | **str** | Loan currency | -**rate** | **str** | Loan rate. Only rates in [0.0002, 0.002] are supported. Not required in lending. Market rate calculated from recent rates will be used if not set | [optional] -**amount** | **str** | Loan amount | -**days** | **int** | Loan days. Only 10 is supported for now | [optional] -**auto_renew** | **bool** | Whether to auto renew the loan upon expiration | [optional] [default to False] -**currency_pair** | **str** | Currency pair. Required if borrowing | [optional] -**left** | **str** | Amount not lent out yet | [optional] [readonly] -**repaid** | **str** | Repaid amount | [optional] [readonly] -**paid_interest** | **str** | Repaid interest | [optional] [readonly] -**unpaid_interest** | **str** | Outstanding interest yet to be paid | [optional] [readonly] -**fee_rate** | **str** | Loan fee rate | [optional] -**orig_id** | **str** | Original loan ID of the loan if auto-renewed, otherwise equals to id | [optional] -**text** | **str** | User defined custom 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/LoanPatch.md b/docs/LoanPatch.md deleted file mode 100644 index 0ba0c58..0000000 --- a/docs/LoanPatch.md +++ /dev/null @@ -1,14 +0,0 @@ -# LoanPatch - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**currency** | **str** | Loan currency | -**side** | **str** | Loan side. Possible values are `lend` and `borrow`. For `LoanRecord` patching, only `lend` is supported | -**auto_renew** | **bool** | Auto renew | -**currency_pair** | **str** | Currency pair. Required if borrowing | [optional] -**loan_id** | **str** | Loan ID. Required for `LoanRecord` patching | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/LoanRecord.md b/docs/LoanRecord.md deleted file mode 100644 index d821108..0000000 --- a/docs/LoanRecord.md +++ /dev/null @@ -1,24 +0,0 @@ -# LoanRecord - -Margin loaned record details -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **str** | Loan record ID | [optional] -**loan_id** | **str** | Loan ID the record belongs to | [optional] -**create_time** | **str** | Loan time | [optional] -**expire_time** | **str** | Expiration time | [optional] -**status** | **str** | Loan record status | [optional] -**borrow_user_id** | **str** | Garbled user ID | [optional] -**currency** | **str** | Loan currency | [optional] -**rate** | **str** | Loan rate | [optional] -**amount** | **str** | Loan amount | [optional] -**days** | **int** | Loan days | [optional] -**auto_renew** | **bool** | Whether the record will auto renew on expiration | [optional] [default to False] -**repaid** | **str** | Repaid amount | [optional] -**paid_interest** | **str** | Repaid interest | [optional] [readonly] -**unpaid_interest** | **str** | Outstanding interest yet to be paid | [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/MarginAccount.md b/docs/MarginAccount.md index 826fd90..265656e 100644 --- a/docs/MarginAccount.md +++ b/docs/MarginAccount.md @@ -1,12 +1,15 @@ # MarginAccount -Margin account detail. `base` refers to base currency, while `quotes to quote currency +Margin account information for a trading pair. `base` corresponds to base currency account information, `quote` corresponds to quote currency account information ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **currency_pair** | **str** | Currency pair | [optional] -**locked** | **bool** | Whether account is locked | [optional] -**risk** | **str** | Current risk rate of margin account | [optional] +**account_type** | **str** | Account type: risk - risk rate account, mmr - maintenance margin rate account, inactive - market not activated | [optional] +**leverage** | **str** | User's current market leverage multiplier | [optional] +**locked** | **bool** | Whether the account is locked | [optional] +**risk** | **str** | Current risk rate of the margin account (returned when the account is a risk rate account) | [optional] +**mmr** | **str** | Leveraged Account Current Maintenance Margin Rate (returned when the Account is Account) | [optional] **base** | [**MarginAccountCurrency**](MarginAccountCurrency.md) | | [optional] **quote** | [**MarginAccountCurrency**](MarginAccountCurrency.md) | | [optional] diff --git a/docs/MarginAccountBook.md b/docs/MarginAccountBook.md index 66f6c44..f5f8c61 100644 --- a/docs/MarginAccountBook.md +++ b/docs/MarginAccountBook.md @@ -4,12 +4,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | Balance change record ID | [optional] -**time** | **str** | Balance changed timestamp | [optional] +**time** | **str** | Account change timestamp | [optional] **time_ms** | **int** | The timestamp of the change (in milliseconds) | [optional] **currency** | **str** | Currency changed | [optional] -**currency_pair** | **str** | Account currency pair | [optional] +**currency_pair** | **str** | Account trading pair | [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] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/MarginAccountCurrency.md b/docs/MarginAccountCurrency.md index 01f80ab..edb06b6 100644 --- a/docs/MarginAccountCurrency.md +++ b/docs/MarginAccountCurrency.md @@ -1,14 +1,14 @@ # MarginAccountCurrency -Account currency details +Currency account information ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **currency** | **str** | Currency name | [optional] -**available** | **str** | Amount suitable for margin trading. | [optional] -**locked** | **str** | Locked amount, used in margin trading | [optional] -**borrowed** | **str** | Borrowed amount | [optional] -**interest** | **str** | Unpaid interests | [optional] +**available** | **str** | Amount available for margin trading, available = margin + borrowed | [optional] +**locked** | **str** | Frozen funds, such as amounts already placed in margin market for order trading | [optional] +**borrowed** | **str** | Borrowed funds | [optional] +**interest** | **str** | Unpaid 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/MarginApi.md b/docs/MarginApi.md index 6923b77..935da57 100644 --- a/docs/MarginApi.md +++ b/docs/MarginApi.md @@ -4,209 +4,19 @@ All URIs are relative to *https://api.gateio.ws/api/v4* Method | HTTP request | Description ------------- | ------------- | ------------- -[**list_margin_currency_pairs**](MarginApi.md#list_margin_currency_pairs) | **GET** /margin/currency_pairs | List all supported currency pairs supported in margin trading -[**get_margin_currency_pair**](MarginApi.md#get_margin_currency_pair) | **GET** /margin/currency_pairs/{currency_pair} | Query one single margin currency pair -[**list_funding_book**](MarginApi.md#list_funding_book) | **GET** /margin/funding_book | Order book of lending loans [**list_margin_accounts**](MarginApi.md#list_margin_accounts) | **GET** /margin/accounts | Margin account list -[**list_margin_account_book**](MarginApi.md#list_margin_account_book) | **GET** /margin/account_book | List margin account balance change history +[**list_margin_account_book**](MarginApi.md#list_margin_account_book) | **GET** /margin/account_book | Query margin account balance change history [**list_funding_accounts**](MarginApi.md#list_funding_accounts) | **GET** /margin/funding_accounts | Funding account list -[**list_loans**](MarginApi.md#list_loans) | **GET** /margin/loans | List all loans -[**create_loan**](MarginApi.md#create_loan) | **POST** /margin/loans | Lend or borrow -[**merge_loans**](MarginApi.md#merge_loans) | **POST** /margin/merged_loans | Merge multiple lending loans -[**get_loan**](MarginApi.md#get_loan) | **GET** /margin/loans/{loan_id} | Retrieve one single loan detail -[**cancel_loan**](MarginApi.md#cancel_loan) | **DELETE** /margin/loans/{loan_id} | Cancel lending loan -[**update_loan**](MarginApi.md#update_loan) | **PATCH** /margin/loans/{loan_id} | Modify a loan -[**list_loan_repayments**](MarginApi.md#list_loan_repayments) | **GET** /margin/loans/{loan_id}/repayment | List loan repayment records -[**repay_loan**](MarginApi.md#repay_loan) | **POST** /margin/loans/{loan_id}/repayment | Repay a loan -[**list_loan_records**](MarginApi.md#list_loan_records) | **GET** /margin/loan_records | List repayment records of a specific loan -[**get_loan_record**](MarginApi.md#get_loan_record) | **GET** /margin/loan_records/{loan_record_id} | Get one single loan record -[**update_loan_record**](MarginApi.md#update_loan_record) | **PATCH** /margin/loan_records/{loan_record_id} | Modify a loan record -[**get_auto_repay_status**](MarginApi.md#get_auto_repay_status) | **GET** /margin/auto_repay | Retrieve user auto repayment setting -[**set_auto_repay**](MarginApi.md#set_auto_repay) | **POST** /margin/auto_repay | Update user's auto repayment setting -[**get_margin_transferable**](MarginApi.md#get_margin_transferable) | **GET** /margin/transferable | Get the max transferable amount for a specific margin currency -[**get_margin_borrowable**](MarginApi.md#get_margin_borrowable) | **GET** /margin/borrowable | Get the max borrowable amount for a specific margin currency -[**list_cross_margin_currencies**](MarginApi.md#list_cross_margin_currencies) | **GET** /margin/cross/currencies | Currencies supported by cross margin. -[**get_cross_margin_currency**](MarginApi.md#get_cross_margin_currency) | **GET** /margin/cross/currencies/{currency} | Retrieve detail of one single currency supported by cross margin -[**get_cross_margin_account**](MarginApi.md#get_cross_margin_account) | **GET** /margin/cross/accounts | Retrieve cross margin account -[**list_cross_margin_account_book**](MarginApi.md#list_cross_margin_account_book) | **GET** /margin/cross/account_book | Retrieve cross margin account change history -[**list_cross_margin_loans**](MarginApi.md#list_cross_margin_loans) | **GET** /margin/cross/loans | List cross margin borrow history -[**create_cross_margin_loan**](MarginApi.md#create_cross_margin_loan) | **POST** /margin/cross/loans | Create a cross margin borrow loan -[**get_cross_margin_loan**](MarginApi.md#get_cross_margin_loan) | **GET** /margin/cross/loans/{loan_id} | Retrieve single borrow loan detail -[**list_cross_margin_repayments**](MarginApi.md#list_cross_margin_repayments) | **GET** /margin/cross/repayments | Retrieve cross margin repayments -[**repay_cross_margin_loan**](MarginApi.md#repay_cross_margin_loan) | **POST** /margin/cross/repayments | Repay cross margin loan -[**get_cross_margin_transferable**](MarginApi.md#get_cross_margin_transferable) | **GET** /margin/cross/transferable | Get the max transferable amount for a specific cross margin currency -[**get_cross_margin_borrowable**](MarginApi.md#get_cross_margin_borrowable) | **GET** /margin/cross/borrowable | Get the max borrowable amount for a specific cross margin currency - - -# **list_margin_currency_pairs** -> list[MarginCurrencyPair] list_margin_currency_pairs() - -List all supported currency pairs supported in margin trading +[**get_auto_repay_status**](MarginApi.md#get_auto_repay_status) | **GET** /margin/auto_repay | Query user auto repayment settings +[**set_auto_repay**](MarginApi.md#set_auto_repay) | **POST** /margin/auto_repay | Update user auto repayment settings +[**get_margin_transferable**](MarginApi.md#get_margin_transferable) | **GET** /margin/transferable | Get maximum transferable amount for isolated margin +[**get_user_margin_tier**](MarginApi.md#get_user_margin_tier) | **GET** /margin/user/loan_margin_tiers | Query user's own leverage lending tiers in current market +[**get_market_margin_tier**](MarginApi.md#get_market_margin_tier) | **GET** /margin/loan_margin_tiers | Query current market leverage lending tiers +[**set_user_market_leverage**](MarginApi.md#set_user_market_leverage) | **POST** /margin/leverage/user_market_setting | Set user market leverage multiplier +[**list_margin_user_account**](MarginApi.md#list_margin_user_account) | **GET** /margin/user/account | Query user's isolated margin account list +[**list_cross_margin_loans**](MarginApi.md#list_cross_margin_loans) | **GET** /margin/cross/loans | Query cross margin borrow history (deprecated) +[**list_cross_margin_repayments**](MarginApi.md#list_cross_margin_repayments) | **GET** /margin/cross/repayments | Retrieve cross margin repayments. (deprecated) -### 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.MarginApi(api_client) - -try: - # List all supported currency pairs supported in margin trading - api_response = api_instance.list_margin_currency_pairs() - 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 MarginApi->list_margin_currency_pairs: %s\n" % e) -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**list[MarginCurrencyPair]**](MarginCurrencyPair.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 | - | - -[[Back to top]](#) [[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_margin_currency_pair** -> MarginCurrencyPair get_margin_currency_pair(currency_pair) - -Query one single margin currency pair - -### 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.MarginApi(api_client) -currency_pair = 'BTC_USDT' # str | Margin currency pair - -try: - # Query one single margin currency pair - api_response = api_instance.get_margin_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 MarginApi->get_margin_currency_pair: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **currency_pair** | **str**| Margin currency pair | - -### Return type - -[**MarginCurrencyPair**](MarginCurrencyPair.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 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_funding_book** -> list[FundingBookItem] list_funding_book(currency) - -Order book of lending loans - -### 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.MarginApi(api_client) -currency = 'BTC' # str | Retrieve data of the specified currency - -try: - # Order book of lending loans - api_response = api_instance.list_funding_book(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 MarginApi->list_funding_book: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **currency** | **str**| Retrieve data of the specified currency | - -### Return type - -[**list[FundingBookItem]**](FundingBookItem.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Order book 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_margin_accounts** > list[MarginAccount] list_margin_accounts(currency_pair=currency_pair) @@ -271,16 +81,16 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**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_margin_account_book** -> list[MarginAccountBook] list_margin_account_book(currency=currency, currency_pair=currency_pair, _from=_from, to=to, page=page, limit=limit) +> list[MarginAccountBook] list_margin_account_book(currency=currency, currency_pair=currency_pair, type=type, _from=_from, to=to, page=page, limit=limit) -List margin account balance change history +Query margin account balance change history -Only transferals from and to margin account are provided for now. Time range allows 30 days at most +Currently only provides transfer history to and from margin accounts. Query time range cannot exceed 30 days ### Example @@ -306,16 +116,17 @@ configuration = gate_api.Configuration( api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.MarginApi(api_client) -currency = 'currency_example' # str | List records related to specified currency only. If specified, `currency_pair` is also required. (optional) -currency_pair = 'currency_pair_example' # str | List records related to specified currency pair. Used in combination with `currency`. Ignored if `currency` is not provided (optional) -_from = 1627706330 # int | Start timestamp of the query (optional) -to = 1635329650 # int | Time range ending, default to current time (optional) +currency = 'currency_example' # str | Query history for specified currency. If `currency` is specified, `currency_pair` must also be specified. (optional) +currency_pair = 'currency_pair_example' # str | Specify margin account currency pair. Used in combination with `currency`. Ignored if `currency` is not specified (optional) +type = 'lend' # str | Query by specified account change type. If not specified, all change types will be included. (optional) +_from = 1627706330 # int | Start timestamp for the query (optional) +to = 1635329650 # int | End timestamp for the query, defaults to current time if not specified (optional) page = 1 # int | Page number (optional) (default to 1) -limit = 100 # int | Maximum number of records to be returned in a single list (optional) (default to 100) +limit = 100 # int | Maximum number of records returned in a single list (optional) (default to 100) try: - # List margin account balance change history - api_response = api_instance.list_margin_account_book(currency=currency, currency_pair=currency_pair, _from=_from, to=to, page=page, limit=limit) + # Query margin account balance change history + api_response = api_instance.list_margin_account_book(currency=currency, currency_pair=currency_pair, type=type, _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)) @@ -327,12 +138,13 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **currency** | **str**| List records related to specified currency only. If specified, `currency_pair` is also required. | [optional] - **currency_pair** | **str**| List records related to specified currency pair. Used in combination with `currency`. Ignored if `currency` is not provided | [optional] - **_from** | **int**| Start timestamp of the query | [optional] - **to** | **int**| Time range ending, default to current time | [optional] + **currency** | **str**| Query history for specified currency. If `currency` is specified, `currency_pair` must also be specified. | [optional] + **currency_pair** | **str**| Specify margin account currency pair. Used in combination with `currency`. Ignored if `currency` is not specified | [optional] + **type** | **str**| Query by specified account change type. If not specified, all change types will be included. | [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] [default to 1] - **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] + **limit** | **int**| Maximum number of records returned in a single list | [optional] [default to 100] ### Return type @@ -350,7 +162,7 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**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) @@ -383,7 +195,7 @@ configuration = gate_api.Configuration( api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.MarginApi(api_client) -currency = 'BTC' # str | Retrieve data of the specified currency (optional) +currency = 'BTC' # str | Query by specified currency name (optional) try: # Funding account list @@ -399,7 +211,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **currency** | **str**| Retrieve data of the specified currency | [optional] + **currency** | **str**| Query by specified currency name | [optional] ### Return type @@ -417,14 +229,14 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**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_loans** -> list[Loan] list_loans(status, side, currency=currency, currency_pair=currency_pair, sort_by=sort_by, reverse_sort=reverse_sort, page=page, limit=limit) +# **get_auto_repay_status** +> AutoRepaySetting get_auto_repay_status() -List all loans +Query user auto repayment settings ### Example @@ -450,41 +262,23 @@ configuration = gate_api.Configuration( api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.MarginApi(api_client) -status = 'open' # str | Loan status -side = 'lend' # str | Lend or borrow -currency = 'BTC' # str | Retrieve data of the specified currency (optional) -currency_pair = 'BTC_USDT' # str | Currency pair (optional) -sort_by = 'rate' # str | Specify which field is used to sort. `create_time` or `rate` is supported. Default to `create_time` (optional) -reverse_sort = false # bool | Whether to sort in descending order. Default to `true` (optional) -page = 1 # int | Page number (optional) (default to 1) -limit = 100 # int | Maximum number of records to be returned in a single list (optional) (default to 100) try: - # List all loans - api_response = api_instance.list_loans(status, side, currency=currency, currency_pair=currency_pair, sort_by=sort_by, reverse_sort=reverse_sort, page=page, limit=limit) + # Query user auto repayment settings + api_response = api_instance.get_auto_repay_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 MarginApi->list_loans: %s\n" % e) + print("Exception when calling MarginApi->get_auto_repay_status: %s\n" % e) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | **str**| Loan status | - **side** | **str**| Lend or borrow | - **currency** | **str**| Retrieve data of the specified currency | [optional] - **currency_pair** | **str**| Currency pair | [optional] - **sort_by** | **str**| Specify which field is used to sort. `create_time` or `rate` is supported. Default to `create_time` | [optional] - **reverse_sort** | **bool**| Whether to sort in descending order. Default to `true` | [optional] - **page** | **int**| Page number | [optional] [default to 1] - **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] +This endpoint does not need any parameter. ### Return type -[**list[Loan]**](Loan.md) +[**AutoRepaySetting**](AutoRepaySetting.md) ### Authorization @@ -498,14 +292,14 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**200** | User's current auto repayment settings | - | [[Back to top]](#) [[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_loan** -> Loan create_loan(loan) +# **set_auto_repay** +> AutoRepaySetting set_auto_repay(status) -Lend or borrow +Update user auto repayment settings ### Example @@ -531,27 +325,27 @@ configuration = gate_api.Configuration( api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.MarginApi(api_client) -loan = gate_api.Loan() # Loan | +status = 'on' # str | Whether to enable auto repayment: `on` - enabled, `off` - disabled try: - # Lend or borrow - api_response = api_instance.create_loan(loan) + # Update user auto repayment settings + api_response = api_instance.set_auto_repay(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 MarginApi->create_loan: %s\n" % e) + print("Exception when calling MarginApi->set_auto_repay: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **loan** | [**Loan**](Loan.md)| | + **status** | **str**| Whether to enable auto repayment: `on` - enabled, `off` - disabled | ### Return type -[**Loan**](Loan.md) +[**AutoRepaySetting**](AutoRepaySetting.md) ### Authorization @@ -559,20 +353,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** | Loan created | - | +**200** | User's current auto repayment settings | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **merge_loans** -> Loan merge_loans(currency, ids) +# **get_margin_transferable** +> MarginTransferable get_margin_transferable(currency, currency_pair=currency_pair) -Merge multiple lending loans +Get maximum transferable amount for isolated margin ### Example @@ -598,29 +392,29 @@ configuration = gate_api.Configuration( api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.MarginApi(api_client) -currency = 'BTC' # str | Retrieve data of the specified currency -ids = '123,234,345' # str | A comma-separated (,) list of IDs of the loans lent. Maximum of 20 IDs are allowed in a request +currency = 'BTC' # str | Query by specified currency name +currency_pair = 'BTC_USDT' # str | Currency pair (optional) try: - # Merge multiple lending loans - api_response = api_instance.merge_loans(currency, ids) + # Get maximum transferable amount for isolated margin + api_response = api_instance.get_margin_transferable(currency, 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 MarginApi->merge_loans: %s\n" % e) + print("Exception when calling MarginApi->get_margin_transferable: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **currency** | **str**| Retrieve data of the specified currency | - **ids** | **str**| A comma-separated (,) list of IDs of the loans lent. Maximum of 20 IDs are allowed in a request | + **currency** | **str**| Query by specified currency name | + **currency_pair** | **str**| Currency pair | [optional] ### Return type -[**Loan**](Loan.md) +[**MarginTransferable**](MarginTransferable.md) ### Authorization @@ -634,14 +428,14 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**201** | Loans merged | - | +**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_loan** -> Loan get_loan(loan_id, side) +# **get_user_margin_tier** +> list[MarginLeverageTier] get_user_margin_tier(currency_pair) -Retrieve one single loan detail +Query user's own leverage lending tiers in current market ### Example @@ -667,29 +461,27 @@ configuration = gate_api.Configuration( api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.MarginApi(api_client) -loan_id = '12345' # str | Loan ID -side = 'lend' # str | Lend or borrow +currency_pair = 'BTC_USDT' # str | Currency pair try: - # Retrieve one single loan detail - api_response = api_instance.get_loan(loan_id, side) + # Query user's own leverage lending tiers in current market + api_response = api_instance.get_user_margin_tier(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 MarginApi->get_loan: %s\n" % e) + print("Exception when calling MarginApi->get_user_margin_tier: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **loan_id** | **str**| Loan ID | - **side** | **str**| Lend or borrow | + **currency_pair** | **str**| Currency pair | ### Return type -[**Loan**](Loan.md) +[**list[MarginLeverageTier]**](MarginLeverageTier.md) ### Authorization @@ -703,68 +495,55 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**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_loan** -> Loan cancel_loan(loan_id, currency) +# **get_market_margin_tier** +> list[MarginLeverageTier] get_market_margin_tier(currency_pair) -Cancel lending loan - -Only lent loans can be cancelled +Query current market leverage lending tiers ### 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.MarginApi(api_client) -loan_id = '12345' # str | Loan ID -currency = 'BTC' # str | Retrieve data of the specified currency +currency_pair = 'BTC_USDT' # str | Currency pair try: - # Cancel lending loan - api_response = api_instance.cancel_loan(loan_id, currency) + # Query current market leverage lending tiers + api_response = api_instance.get_market_margin_tier(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 MarginApi->cancel_loan: %s\n" % e) + print("Exception when calling MarginApi->get_market_margin_tier: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **loan_id** | **str**| Loan ID | - **currency** | **str**| Retrieve data of the specified currency | + **currency_pair** | **str**| Currency pair | ### Return type -[**Loan**](Loan.md) +[**list[MarginLeverageTier]**](MarginLeverageTier.md) ### Authorization -[apiv4](../README.md#apiv4) +No authorization required ### HTTP request headers @@ -774,16 +553,14 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Order cancelled | - | +**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) -# **update_loan** -> Loan update_loan(loan_id, loan_patch) +# **set_user_market_leverage** +> set_user_market_leverage(margin_market_leverage) -Modify a loan - -Only `auto_renew` modification is supported currently +Set user market leverage multiplier ### Example @@ -809,29 +586,26 @@ configuration = gate_api.Configuration( api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.MarginApi(api_client) -loan_id = '12345' # str | Loan ID -loan_patch = gate_api.LoanPatch() # LoanPatch | +margin_market_leverage = gate_api.MarginMarketLeverage() # MarginMarketLeverage | try: - # Modify a loan - api_response = api_instance.update_loan(loan_id, loan_patch) - print(api_response) + # Set user market leverage multiplier + api_instance.set_user_market_leverage(margin_market_leverage) 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 MarginApi->update_loan: %s\n" % e) + print("Exception when calling MarginApi->set_user_market_leverage: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **loan_id** | **str**| Loan ID | - **loan_patch** | [**LoanPatch**](LoanPatch.md)| | + **margin_market_leverage** | [**MarginMarketLeverage**](MarginMarketLeverage.md)| | ### Return type -[**Loan**](Loan.md) +void (empty response body) ### Authorization @@ -840,19 +614,21 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: application/json - - **Accept**: application/json + - **Accept**: Not defined ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Updated | - | +**204** | 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) -# **list_loan_repayments** -> list[Repayment] list_loan_repayments(loan_id) +# **list_margin_user_account** +> list[MarginAccount] list_margin_user_account(currency_pair=currency_pair) + +Query user's isolated margin account list -List loan repayment records +Supports querying risk ratio isolated accounts and margin ratio isolated accounts ### Example @@ -878,27 +654,27 @@ configuration = gate_api.Configuration( api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.MarginApi(api_client) -loan_id = '12345' # str | Loan ID +currency_pair = 'BTC_USDT' # str | Currency pair (optional) try: - # List loan repayment records - api_response = api_instance.list_loan_repayments(loan_id) + # Query user's isolated margin account list + api_response = api_instance.list_margin_user_account(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 MarginApi->list_loan_repayments: %s\n" % e) + print("Exception when calling MarginApi->list_margin_user_account: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **loan_id** | **str**| Loan ID | + **currency_pair** | **str**| Currency pair | [optional] ### Return type -[**list[Repayment]**](Repayment.md) +[**list[MarginAccount]**](MarginAccount.md) ### Authorization @@ -912,14 +688,16 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**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) -# **repay_loan** -> Loan repay_loan(loan_id, repay_request) +# **list_cross_margin_loans** +> list[CrossMarginLoan] list_cross_margin_loans(status, currency=currency, limit=limit, offset=offset, reverse=reverse) + +Query cross margin borrow history (deprecated) -Repay a loan +Sorted by creation time in descending order by default. Set `reverse=false` for ascending order ### Example @@ -945,29 +723,35 @@ configuration = gate_api.Configuration( api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.MarginApi(api_client) -loan_id = '12345' # str | Loan ID -repay_request = gate_api.RepayRequest() # RepayRequest | +status = 56 # int | Filter by status. Supported values are 2 and 3. (deprecated.) +currency = 'currency_example' # str | Query by specified currency, includes all currencies 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) +reverse = True # bool | Whether to sort in descending order, which is the default. Set `reverse=false` to return ascending results (optional) (default to True) try: - # Repay a loan - api_response = api_instance.repay_loan(loan_id, repay_request) + # Query cross margin borrow history (deprecated) + api_response = api_instance.list_cross_margin_loans(status, currency=currency, limit=limit, offset=offset, reverse=reverse) 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 MarginApi->repay_loan: %s\n" % e) + print("Exception when calling MarginApi->list_cross_margin_loans: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **loan_id** | **str**| Loan ID | - **repay_request** | [**RepayRequest**](RepayRequest.md)| | + **status** | **int**| Filter by status. Supported values are 2 and 3. (deprecated.) | + **currency** | **str**| Query by specified currency, includes all currencies 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] + **reverse** | **bool**| Whether to sort in descending order, which is the default. Set `reverse=false` to return ascending results | [optional] [default to True] ### Return type -[**Loan**](Loan.md) +[**list[CrossMarginLoan]**](CrossMarginLoan.md) ### Authorization @@ -975,20 +759,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** | Loan repaid | - | +**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_loan_records** -> list[LoanRecord] list_loan_records(loan_id, status=status, page=page, limit=limit) +# **list_cross_margin_repayments** +> list[CrossMarginRepayment] list_cross_margin_repayments(currency=currency, loan_id=loan_id, limit=limit, offset=offset, reverse=reverse) + +Retrieve cross margin repayments. (deprecated) -List repayment records of a specific loan +Sorted by creation time in descending order by default. Set `reverse=false` for ascending order ### Example @@ -1014,981 +800,31 @@ configuration = gate_api.Configuration( api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.MarginApi(api_client) -loan_id = '12345' # str | Loan ID -status = 'loaned' # str | Loan record status (optional) -page = 1 # int | Page number (optional) (default to 1) -limit = 100 # int | Maximum number of records to be returned in a single list (optional) (default to 100) +currency = 'BTC' # str | (optional) +loan_id = '12345' # str | (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) +reverse = True # bool | Whether to sort in descending order, which is the default. Set `reverse=false` to return ascending results (optional) (default to True) try: - # List repayment records of a specific loan - api_response = api_instance.list_loan_records(loan_id, status=status, page=page, limit=limit) + # Retrieve cross margin repayments. (deprecated) + api_response = api_instance.list_cross_margin_repayments(currency=currency, loan_id=loan_id, limit=limit, offset=offset, reverse=reverse) 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 MarginApi->list_loan_records: %s\n" % e) + print("Exception when calling MarginApi->list_cross_margin_repayments: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **loan_id** | **str**| Loan ID | - **status** | **str**| Loan record status | [optional] - **page** | **int**| Page number | [optional] [default to 1] - **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] - -### Return type - -[**list[LoanRecord]**](LoanRecord.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 | - | - -[[Back to top]](#) [[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_loan_record** -> LoanRecord get_loan_record(loan_record_id, loan_id) - -Get one single loan record - -### 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.MarginApi(api_client) -loan_record_id = '12345' # str | Loan record ID -loan_id = '12345' # str | Loan ID - -try: - # Get one single loan record - api_response = api_instance.get_loan_record(loan_record_id, loan_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 MarginApi->get_loan_record: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **loan_record_id** | **str**| Loan record ID | - **loan_id** | **str**| Loan ID | - -### Return type - -[**LoanRecord**](LoanRecord.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) - -# **update_loan_record** -> LoanRecord update_loan_record(loan_record_id, loan_patch) - -Modify a loan record - -Only `auto_renew` modification is supported currently - -### 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.MarginApi(api_client) -loan_record_id = '12345' # str | Loan record ID -loan_patch = gate_api.LoanPatch() # LoanPatch | - -try: - # Modify a loan record - api_response = api_instance.update_loan_record(loan_record_id, loan_patch) - 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 MarginApi->update_loan_record: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **loan_record_id** | **str**| Loan record ID | - **loan_patch** | [**LoanPatch**](LoanPatch.md)| | - -### Return type - -[**LoanRecord**](LoanRecord.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** | Loan record updated | - | - -[[Back to top]](#) [[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_repay_status** -> AutoRepaySetting get_auto_repay_status() - -Retrieve user auto repayment 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.MarginApi(api_client) - -try: - # Retrieve user auto repayment setting - api_response = api_instance.get_auto_repay_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 MarginApi->get_auto_repay_status: %s\n" % e) -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**AutoRepaySetting**](AutoRepaySetting.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** | Current auto repayment setting | - | - -[[Back to top]](#) [[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_auto_repay** -> AutoRepaySetting set_auto_repay(status) - -Update user's auto repayment 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.MarginApi(api_client) -status = 'on' # str | New auto repayment status. `on` - enabled, `off` - disabled - -try: - # Update user's auto repayment setting - api_response = api_instance.set_auto_repay(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 MarginApi->set_auto_repay: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | **str**| New auto repayment status. `on` - enabled, `off` - disabled | - -### Return type - -[**AutoRepaySetting**](AutoRepaySetting.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** | Current auto repayment setting | - | - -[[Back to top]](#) [[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_margin_transferable** -> MarginTransferable get_margin_transferable(currency, currency_pair=currency_pair) - -Get the max transferable amount for a specific margin currency - -### 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.MarginApi(api_client) -currency = 'BTC' # str | Retrieve data of the specified currency -currency_pair = 'BTC_USDT' # str | Currency pair (optional) - -try: - # Get the max transferable amount for a specific margin currency - api_response = api_instance.get_margin_transferable(currency, 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 MarginApi->get_margin_transferable: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **currency** | **str**| Retrieve data of the specified currency | - **currency_pair** | **str**| Currency pair | [optional] - -### Return type - -[**MarginTransferable**](MarginTransferable.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_margin_borrowable** -> MarginBorrowable get_margin_borrowable(currency, currency_pair=currency_pair) - -Get the max borrowable amount for a specific margin currency - -### 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.MarginApi(api_client) -currency = 'BTC' # str | Retrieve data of the specified currency -currency_pair = 'BTC_USDT' # str | Currency pair (optional) - -try: - # Get the max borrowable amount for a specific margin currency - api_response = api_instance.get_margin_borrowable(currency, 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 MarginApi->get_margin_borrowable: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **currency** | **str**| Retrieve data of the specified currency | - **currency_pair** | **str**| Currency pair | [optional] - -### Return type - -[**MarginBorrowable**](MarginBorrowable.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_cross_margin_currencies** -> list[CrossMarginCurrency] list_cross_margin_currencies() - -Currencies supported by cross margin. - -### 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.MarginApi(api_client) - -try: - # Currencies supported by cross margin. - api_response = api_instance.list_cross_margin_currencies() - 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 MarginApi->list_cross_margin_currencies: %s\n" % e) -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**list[CrossMarginCurrency]**](CrossMarginCurrency.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 | - | - -[[Back to top]](#) [[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_cross_margin_currency** -> CrossMarginCurrency get_cross_margin_currency(currency) - -Retrieve detail of one single currency supported by cross margin - -### 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.MarginApi(api_client) -currency = 'BTC' # str | Currency name - -try: - # Retrieve detail of one single currency supported by cross margin - api_response = api_instance.get_cross_margin_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 MarginApi->get_cross_margin_currency: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **currency** | **str**| Currency name | - -### Return type - -[**CrossMarginCurrency**](CrossMarginCurrency.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 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_cross_margin_account** -> CrossMarginAccount get_cross_margin_account() - -Retrieve cross margin account - -### 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.MarginApi(api_client) - -try: - # Retrieve cross margin account - api_response = api_instance.get_cross_margin_account() - 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 MarginApi->get_cross_margin_account: %s\n" % e) -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**CrossMarginAccount**](CrossMarginAccount.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_cross_margin_account_book** -> list[CrossMarginAccountBook] list_cross_margin_account_book(currency=currency, _from=_from, to=to, page=page, limit=limit, type=type) - -Retrieve cross margin account change history - -Record time range cannot exceed 30 days - -### 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.MarginApi(api_client) -currency = 'currency_example' # str | Filter by currency (optional) -_from = 1627706330 # int | Start timestamp of the query (optional) -to = 1635329650 # int | Time range ending, default to current time (optional) -page = 1 # int | Page number (optional) (default to 1) -limit = 100 # int | Maximum number of records to be returned in a single list (optional) (default to 100) -type = 'borrow' # str | Only retrieve changes of the specified type. All types will be returned if not specified. (optional) - -try: - # Retrieve cross margin account change history - api_response = api_instance.list_cross_margin_account_book(currency=currency, _from=_from, to=to, page=page, limit=limit, 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 MarginApi->list_cross_margin_account_book: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **currency** | **str**| Filter by currency | [optional] - **_from** | **int**| Start timestamp of the query | [optional] - **to** | **int**| Time range ending, default to current time | [optional] - **page** | **int**| Page number | [optional] [default to 1] - **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] - **type** | **str**| Only retrieve changes of the specified type. All types will be returned if not specified. | [optional] - -### Return type - -[**list[CrossMarginAccountBook]**](CrossMarginAccountBook.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 | - | - -[[Back to top]](#) [[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_cross_margin_loans** -> list[CrossMarginLoan] list_cross_margin_loans(status, currency=currency, limit=limit, offset=offset, reverse=reverse) - -List cross margin borrow history - -Sort by creation time in descending order by default. Set `reverse=false` to return ascending results. - -### 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.MarginApi(api_client) -status = 56 # int | Filter by status. Supported values are 2 and 3. -currency = 'currency_example' # str | Filter by currency (optional) -limit = 100 # int | Maximum number of records to be returned in a single list (optional) (default to 100) -offset = 0 # int | List offset, starting from 0 (optional) (default to 0) -reverse = True # bool | Whether to sort in descending order, which is the default. Set `reverse=false` to return ascending results (optional) (default to True) - -try: - # List cross margin borrow history - api_response = api_instance.list_cross_margin_loans(status, currency=currency, limit=limit, offset=offset, reverse=reverse) - 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 MarginApi->list_cross_margin_loans: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | **int**| Filter by status. Supported values are 2 and 3. | - **currency** | **str**| Filter by currency | [optional] - **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] - **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] - **reverse** | **bool**| Whether to sort in descending order, which is the default. Set `reverse=false` to return ascending results | [optional] [default to True] - -### Return type - -[**list[CrossMarginLoan]**](CrossMarginLoan.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) - -# **create_cross_margin_loan** -> CrossMarginLoan create_cross_margin_loan(cross_margin_loan) - -Create a cross margin borrow loan - -Borrow amount cannot be less than currency minimum borrow 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.MarginApi(api_client) -cross_margin_loan = gate_api.CrossMarginLoan() # CrossMarginLoan | - -try: - # Create a cross margin borrow loan - api_response = api_instance.create_cross_margin_loan(cross_margin_loan) - 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 MarginApi->create_cross_margin_loan: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **cross_margin_loan** | [**CrossMarginLoan**](CrossMarginLoan.md)| | - -### Return type - -[**CrossMarginLoan**](CrossMarginLoan.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 borrowed | - | - -[[Back to top]](#) [[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_cross_margin_loan** -> CrossMarginLoan get_cross_margin_loan(loan_id) - -Retrieve single borrow loan detail - -### 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.MarginApi(api_client) -loan_id = '12345' # str | Borrow loan ID - -try: - # Retrieve single borrow loan detail - api_response = api_instance.get_cross_margin_loan(loan_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 MarginApi->get_cross_margin_loan: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **loan_id** | **str**| Borrow loan ID | - -### Return type - -[**CrossMarginLoan**](CrossMarginLoan.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_cross_margin_repayments** -> list[CrossMarginRepayment] list_cross_margin_repayments(currency=currency, loan_id=loan_id, limit=limit, offset=offset, reverse=reverse) - -Retrieve cross margin repayments - -Sort by creation time in descending order by default. Set `reverse=false` to return ascending results. - -### 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.MarginApi(api_client) -currency = 'BTC' # str | (optional) -loan_id = '12345' # str | (optional) -limit = 100 # int | Maximum number of records to be returned in a single list (optional) (default to 100) -offset = 0 # int | List offset, starting from 0 (optional) (default to 0) -reverse = True # bool | Whether to sort in descending order, which is the default. Set `reverse=false` to return ascending results (optional) (default to True) - -try: - # Retrieve cross margin repayments - api_response = api_instance.list_cross_margin_repayments(currency=currency, loan_id=loan_id, limit=limit, offset=offset, reverse=reverse) - 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 MarginApi->list_cross_margin_repayments: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **currency** | **str**| | [optional] - **loan_id** | **str**| | [optional] - **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] - **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] - **reverse** | **bool**| Whether to sort in descending order, which is the default. Set `reverse=false` to return ascending results | [optional] [default to True] + **currency** | **str**| | [optional] + **loan_id** | **str**| | [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] + **reverse** | **bool**| Whether to sort in descending order, which is the default. Set `reverse=false` to return ascending results | [optional] [default to True] ### Return type @@ -2006,208 +842,7 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List 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) - -# **repay_cross_margin_loan** -> list[CrossMarginLoan] repay_cross_margin_loan(cross_margin_repay_request) - -Repay cross margin loan - -### 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.MarginApi(api_client) -cross_margin_repay_request = gate_api.CrossMarginRepayRequest() # CrossMarginRepayRequest | - -try: - # Repay cross margin loan - api_response = api_instance.repay_cross_margin_loan(cross_margin_repay_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 MarginApi->repay_cross_margin_loan: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **cross_margin_repay_request** | [**CrossMarginRepayRequest**](CrossMarginRepayRequest.md)| | - -### Return type - -[**list[CrossMarginLoan]**](CrossMarginLoan.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** | Loan repaid | - | - -[[Back to top]](#) [[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_cross_margin_transferable** -> CrossMarginTransferable get_cross_margin_transferable(currency) - -Get the max transferable amount for a specific cross margin currency - -### 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.MarginApi(api_client) -currency = 'BTC' # str | Retrieve data of the specified currency - -try: - # Get the max transferable amount for a specific cross margin currency - api_response = api_instance.get_cross_margin_transferable(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 MarginApi->get_cross_margin_transferable: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **currency** | **str**| Retrieve data of the specified currency | - -### Return type - -[**CrossMarginTransferable**](CrossMarginTransferable.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_cross_margin_borrowable** -> CrossMarginBorrowable get_cross_margin_borrowable(currency) - -Get the max borrowable amount for a specific cross margin currency - -### 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.MarginApi(api_client) -currency = 'BTC' # str | Retrieve data of the specified currency - -try: - # Get the max borrowable amount for a specific cross margin currency - api_response = api_instance.get_cross_margin_borrowable(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 MarginApi->get_cross_margin_borrowable: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **currency** | **str**| Retrieve data of the specified currency | - -### Return type - -[**CrossMarginBorrowable**](CrossMarginBorrowable.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 | - | +**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) diff --git a/docs/MarginCurrencyPair.md b/docs/MarginCurrencyPair.md deleted file mode 100644 index 90ba0f5..0000000 --- a/docs/MarginCurrencyPair.md +++ /dev/null @@ -1,16 +0,0 @@ -# MarginCurrencyPair - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **str** | Currency pair | [optional] -**base** | **str** | Base currency | [optional] -**quote** | **str** | Quote currency | [optional] -**leverage** | **int** | Leverage | [optional] -**min_base_amount** | **str** | Minimum base currency to loan, `null` means no limit | [optional] -**min_quote_amount** | **str** | Minimum quote currency to loan, `null` means no limit | [optional] -**max_quote_amount** | **str** | Maximum borrowable amount for quote currency. Base currency limit is calculated by quote maximum and market price. `null` 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/MarginLeverageTier.md b/docs/MarginLeverageTier.md new file mode 100644 index 0000000..0a36030 --- /dev/null +++ b/docs/MarginLeverageTier.md @@ -0,0 +1,13 @@ +# MarginLeverageTier + +Market gradient information +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**upper_limit** | **str** | Maximum loan limit | [optional] +**mmr** | **str** | Maintenance margin rate | [optional] +**leverage** | **str** | Maximum leverage multiple | [optional] + +[[Back to Model list]](../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 new file mode 100644 index 0000000..63ce686 --- /dev/null +++ b/docs/MarginMarketLeverage.md @@ -0,0 +1,12 @@ +# MarginMarketLeverage + +Market leverage settings +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency_pair** | **str** | Market | [optional] +**leverage** | **str** | Position 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/MarginTiers.md b/docs/MarginTiers.md new file mode 100644 index 0000000..455092c --- /dev/null +++ b/docs/MarginTiers.md @@ -0,0 +1,14 @@ +# MarginTiers + +## Properties +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] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/MarginUniApi.md b/docs/MarginUniApi.md new file mode 100644 index 0000000..02afa4e --- /dev/null +++ b/docs/MarginUniApi.md @@ -0,0 +1,557 @@ +# gate_api.MarginUniApi + +All URIs are relative to *https://api.gateio.ws/api/v4* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**list_uni_currency_pairs**](MarginUniApi.md#list_uni_currency_pairs) | **GET** /margin/uni/currency_pairs | List lending markets +[**get_uni_currency_pair**](MarginUniApi.md#get_uni_currency_pair) | **GET** /margin/uni/currency_pairs/{currency_pair} | Get lending market details +[**get_margin_uni_estimate_rate**](MarginUniApi.md#get_margin_uni_estimate_rate) | **GET** /margin/uni/estimate_rate | Estimate interest rate for isolated margin currencies +[**list_uni_loans**](MarginUniApi.md#list_uni_loans) | **GET** /margin/uni/loans | Query loans +[**create_uni_loan**](MarginUniApi.md#create_uni_loan) | **POST** /margin/uni/loans | Borrow or repay +[**list_uni_loan_records**](MarginUniApi.md#list_uni_loan_records) | **GET** /margin/uni/loan_records | Query loan records +[**list_uni_loan_interest_records**](MarginUniApi.md#list_uni_loan_interest_records) | **GET** /margin/uni/interest_records | Query interest deduction records +[**get_uni_borrowable**](MarginUniApi.md#get_uni_borrowable) | **GET** /margin/uni/borrowable | Query maximum borrowable amount by currency + + +# **list_uni_currency_pairs** +> list[UniCurrencyPair] list_uni_currency_pairs() + +List lending markets + +### 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.MarginUniApi(api_client) + +try: + # List lending markets + api_response = api_instance.list_uni_currency_pairs() + 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 MarginUniApi->list_uni_currency_pairs: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**list[UniCurrencyPair]**](UniCurrencyPair.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) + +# **get_uni_currency_pair** +> UniCurrencyPair get_uni_currency_pair(currency_pair) + +Get lending market 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.MarginUniApi(api_client) +currency_pair = 'AE_USDT' # str | Currency pair + +try: + # Get lending market details + api_response = api_instance.get_uni_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 MarginUniApi->get_uni_currency_pair: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currency_pair** | **str**| Currency pair | + +### Return type + +[**UniCurrencyPair**](UniCurrencyPair.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) + +# **get_margin_uni_estimate_rate** +> dict(str, str) get_margin_uni_estimate_rate(currencies) + +Estimate interest rate for isolated margin currencies + +Interest rates change hourly based on lending depth, so completely accurate rates cannot be provided. + +### 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.MarginUniApi(api_client) +currencies = ['[\"BTC\",\"GT\"]'] # list[str] | Array of currency names to query, maximum 10 + +try: + # Estimate interest rate for isolated margin currencies + api_response = api_instance.get_margin_uni_estimate_rate(currencies) + 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 MarginUniApi->get_margin_uni_estimate_rate: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currencies** | [**list[str]**](str.md)| Array of currency names to query, maximum 10 | + +### 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** | 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_uni_loans** +> list[UniLoan] list_uni_loans(currency_pair=currency_pair, currency=currency, page=page, limit=limit) + +Query loans + +### 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.MarginUniApi(api_client) +currency_pair = 'BTC_USDT' # str | Currency pair (optional) +currency = 'BTC' # str | Query by specified currency name (optional) +page = 1 # int | Page number (optional) (default to 1) +limit = 100 # int | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 (optional) (default to 100) + +try: + # Query loans + api_response = api_instance.list_uni_loans(currency_pair=currency_pair, currency=currency, 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 MarginUniApi->list_uni_loans: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currency_pair** | **str**| Currency pair | [optional] + **currency** | **str**| Query by specified currency name | [optional] + **page** | **int**| Page number | [optional] [default to 1] + **limit** | **int**| Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 | [optional] [default to 100] + +### Return type + +[**list[UniLoan]**](UniLoan.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_uni_loan** +> create_uni_loan(create_uni_loan) + +Borrow or repay + +### 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.MarginUniApi(api_client) +create_uni_loan = gate_api.CreateUniLoan() # CreateUniLoan | + +try: + # Borrow or repay + api_instance.create_uni_loan(create_uni_loan) +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 MarginUniApi->create_uni_loan: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **create_uni_loan** | [**CreateUniLoan**](CreateUniLoan.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 | +|-------------|-------------|------------------| +**204** | Operation 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_uni_loan_records** +> list[UniLoanRecord] list_uni_loan_records(type=type, currency=currency, currency_pair=currency_pair, page=page, limit=limit) + +Query loan 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.MarginUniApi(api_client) +type = 'type_example' # str | Type: `borrow` - borrow, `repay` - repay (optional) +currency = 'BTC' # str | Query by specified currency name (optional) +currency_pair = 'BTC_USDT' # str | Currency pair (optional) +page = 1 # int | Page number (optional) (default to 1) +limit = 100 # int | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 (optional) (default to 100) + +try: + # Query loan records + api_response = api_instance.list_uni_loan_records(type=type, currency=currency, currency_pair=currency_pair, 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 MarginUniApi->list_uni_loan_records: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **type** | **str**| Type: `borrow` - borrow, `repay` - repay | [optional] + **currency** | **str**| Query by specified currency name | [optional] + **currency_pair** | **str**| Currency pair | [optional] + **page** | **int**| Page number | [optional] [default to 1] + **limit** | **int**| Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 | [optional] [default to 100] + +### Return type + +[**list[UniLoanRecord]**](UniLoanRecord.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_uni_loan_interest_records** +> list[UniLoanInterestRecord] list_uni_loan_interest_records(currency_pair=currency_pair, currency=currency, page=page, limit=limit, _from=_from, to=to) + +Query interest deduction 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.MarginUniApi(api_client) +currency_pair = 'BTC_USDT' # str | Currency pair (optional) +currency = 'BTC' # str | Query by specified currency name (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) +_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) + +try: + # Query interest deduction records + api_response = api_instance.list_uni_loan_interest_records(currency_pair=currency_pair, currency=currency, page=page, limit=limit, _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 MarginUniApi->list_uni_loan_interest_records: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currency_pair** | **str**| Currency pair | [optional] + **currency** | **str**| Query by specified currency name | [optional] + **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 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] + +### Return type + +[**list[UniLoanInterestRecord]**](UniLoanInterestRecord.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_uni_borrowable** +> MaxUniBorrowable get_uni_borrowable(currency, currency_pair) + +Query maximum borrowable amount by currency + +### 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.MarginUniApi(api_client) +currency = 'BTC' # str | Query by specified currency name +currency_pair = 'BTC_USDT' # str | Currency pair + +try: + # Query maximum borrowable amount by currency + api_response = api_instance.get_uni_borrowable(currency, 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 MarginUniApi->get_uni_borrowable: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currency** | **str**| Query by specified currency name | + **currency_pair** | **str**| Currency pair | + +### Return type + +[**MaxUniBorrowable**](MaxUniBorrowable.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/MaxUniBorrowable.md b/docs/MaxUniBorrowable.md new file mode 100644 index 0000000..107dbab --- /dev/null +++ b/docs/MaxUniBorrowable.md @@ -0,0 +1,12 @@ +# MaxUniBorrowable + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **str** | Currency | [readonly] +**currency_pair** | **str** | Currency pair | [optional] [readonly] +**borrowable** | **str** | Maximum borrowable | [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/MockFuturesOrder.md b/docs/MockFuturesOrder.md new file mode 100644 index 0000000..0d03d06 --- /dev/null +++ b/docs/MockFuturesOrder.md @@ -0,0 +1,13 @@ +# MockFuturesOrder + +Futures order +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**contract** | **str** | Futures name, currently only supports USDT perpetual contracts for BTC and ETH | +**size** | **str** | Contract quantity, representing the initial order quantity, not involved in actual settlement | +**left** | **str** | Unfilled contract quantity, involved in actual calculation | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/MockFuturesPosition.md b/docs/MockFuturesPosition.md new file mode 100644 index 0000000..f6eccc7 --- /dev/null +++ b/docs/MockFuturesPosition.md @@ -0,0 +1,12 @@ +# MockFuturesPosition + +Futures positions +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**contract** | **str** | Futures name, currently only supports USDT perpetual contracts for BTC and ETH | +**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/MockMarginResult.md b/docs/MockMarginResult.md new file mode 100644 index 0000000..0ea3b20 --- /dev/null +++ b/docs/MockMarginResult.md @@ -0,0 +1,17 @@ +# MockMarginResult + +Margin result +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | Position combination type `original_position` - Original position `long_delta_original_position` - Positive delta + Original position `short_delta_original_position` - Negative delta + Original position | [optional] +**profit_loss_ranges** | [**list[ProfitLossRange]**](ProfitLossRange.md) | Results of 33 stress scenarios for MR1 | [optional] +**max_loss** | [**ProfitLossRange**](.md) | 最大损失 | [optional] +**mr1** | **str** | Stress testing | [optional] +**mr2** | **str** | Basis spread risk | [optional] +**mr3** | **str** | Volatility spread risk | [optional] +**mr4** | **str** | Option short risk | [optional] + +[[Back to Model list]](../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 new file mode 100644 index 0000000..054d3f4 --- /dev/null +++ b/docs/MockOptionsOrder.md @@ -0,0 +1,13 @@ +# MockOptionsOrder + +Option orders +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**options_name** | **str** | Option name, currently only supports USDT options for BTC and ETH | +**size** | **str** | Initial order quantity, not involved in actual calculation | +**left** | **str** | Unfilled contract quantity, involved in actual calculation | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/MockOptionsPosition.md b/docs/MockOptionsPosition.md new file mode 100644 index 0000000..f7c0e53 --- /dev/null +++ b/docs/MockOptionsPosition.md @@ -0,0 +1,12 @@ +# MockOptionsPosition + +Options positions +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**options_name** | **str** | Option name, currently only supports USDT options for BTC and ETH | +**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/MockRiskUnit.md b/docs/MockRiskUnit.md new file mode 100644 index 0000000..cf6f234 --- /dev/null +++ b/docs/MockRiskUnit.md @@ -0,0 +1,19 @@ +# MockRiskUnit + +Risk unit +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**symbol** | **str** | Risk unit name | [optional] +**spot_in_use** | **str** | Spot hedge usage | [optional] +**maintain_margin** | **str** | Maintenance margin | [optional] +**initial_margin** | **str** | Initial margin | [optional] +**margin_result** | [**list[MockMarginResult]**](MockMarginResult.md) | Margin result | [optional] +**delta** | **str** | Total Delta of risk unit | [optional] +**gamma** | **str** | Total Gamma of risk unit | [optional] +**theta** | **str** | Total Theta of risk unit | [optional] +**vega** | **str** | Total Vega of risk unit | [optional] + +[[Back to Model list]](../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 new file mode 100644 index 0000000..54bb762 --- /dev/null +++ b/docs/MockSpotBalance.md @@ -0,0 +1,12 @@ +# MockSpotBalance + +Spot +## Properties +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 | + +[[Back to Model list]](../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 new file mode 100644 index 0000000..3b3d340 --- /dev/null +++ b/docs/MockSpotOrder.md @@ -0,0 +1,15 @@ +# MockSpotOrder + +Spot orders +## Properties +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] +**left** | **str** | Unfilled quantity, involved in actual calculation | +**type** | **str** | Order type, sell - sell order, buy - buy order | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/MultiCollateralCurrency.md b/docs/MultiCollateralCurrency.md new file mode 100644 index 0000000..f309656 --- /dev/null +++ b/docs/MultiCollateralCurrency.md @@ -0,0 +1,12 @@ +# MultiCollateralCurrency + +Borrowing and collateral currencies supported for Multi-Collateral +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**loan_currencies** | [**list[MultiLoanItem]**](MultiLoanItem.md) | List of supported borrowing currencies | [optional] +**collateral_currencies** | [**list[MultiCollateralItem]**](MultiCollateralItem.md) | List of supported collateral currencies | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/MultiCollateralItem.md b/docs/MultiCollateralItem.md new file mode 100644 index 0000000..3e9ba07 --- /dev/null +++ b/docs/MultiCollateralItem.md @@ -0,0 +1,12 @@ +# MultiCollateralItem + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **str** | Currency | [optional] +**index_price** | **str** | Currency Index Price | [optional] +**discount** | **str** | Discount | [optional] + +[[Back to Model list]](../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 new file mode 100644 index 0000000..ab66f2a --- /dev/null +++ b/docs/MultiCollateralLoanApi.md @@ -0,0 +1,808 @@ +# gate_api.MultiCollateralLoanApi + +All URIs are relative to *https://api.gateio.ws/api/v4* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**list_multi_collateral_orders**](MultiCollateralLoanApi.md#list_multi_collateral_orders) | **GET** /loan/multi_collateral/orders | Query multi-currency collateral order list +[**create_multi_collateral**](MultiCollateralLoanApi.md#create_multi_collateral) | **POST** /loan/multi_collateral/orders | Place multi-currency collateral order +[**get_multi_collateral_order_detail**](MultiCollateralLoanApi.md#get_multi_collateral_order_detail) | **GET** /loan/multi_collateral/orders/{order_id} | Query order details +[**list_multi_repay_records**](MultiCollateralLoanApi.md#list_multi_repay_records) | **GET** /loan/multi_collateral/repay | Query multi-currency collateral repayment records +[**repay_multi_collateral_loan**](MultiCollateralLoanApi.md#repay_multi_collateral_loan) | **POST** /loan/multi_collateral/repay | Multi-currency collateral repayment +[**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 +[**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 + + +# **list_multi_collateral_orders** +> list[MultiCollateralOrder] list_multi_collateral_orders(page=page, limit=limit, sort=sort, order_type=order_type) + +Query multi-currency collateral 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.MultiCollateralLoanApi(api_client) +page = 1 # int | Page number (optional) (default to 1) +limit = 10 # int | Maximum number of records returned in a single list (optional) (default to 10) +sort = 'ltv_asc' # str | Sort type: `time_desc` - Created time descending (default), `ltv_asc` - Collateral ratio ascending, `ltv_desc` - Collateral ratio descending. (optional) +order_type = 'current' # str | Order type: current - Query current orders, fixed - Query fixed orders, defaults to current orders if not specified (optional) + +try: + # Query multi-currency collateral order list + api_response = api_instance.list_multi_collateral_orders(page=page, limit=limit, sort=sort, order_type=order_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 MultiCollateralLoanApi->list_multi_collateral_orders: %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 10] + **sort** | **str**| Sort type: `time_desc` - Created time descending (default), `ltv_asc` - Collateral ratio ascending, `ltv_desc` - Collateral ratio descending. | [optional] + **order_type** | **str**| Order type: current - Query current orders, fixed - Query fixed orders, defaults to current orders if not specified | [optional] + +### Return type + +[**list[MultiCollateralOrder]**](MultiCollateralOrder.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) + +# **create_multi_collateral** +> OrderResp create_multi_collateral(create_multi_collateral_order) + +Place multi-currency collateral 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.MultiCollateralLoanApi(api_client) +create_multi_collateral_order = gate_api.CreateMultiCollateralOrder() # CreateMultiCollateralOrder | + +try: + # Place multi-currency collateral order + api_response = api_instance.create_multi_collateral(create_multi_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 MultiCollateralLoanApi->create_multi_collateral: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **create_multi_collateral_order** | [**CreateMultiCollateralOrder**](CreateMultiCollateralOrder.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) + +# **get_multi_collateral_order_detail** +> MultiCollateralOrder get_multi_collateral_order_detail(order_id) + +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.MultiCollateralLoanApi(api_client) +order_id = '12345' # str | Order ID returned when order is successfully created + +try: + # Query order details + api_response = api_instance.get_multi_collateral_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 MultiCollateralLoanApi->get_multi_collateral_order_detail: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order_id** | **str**| Order ID returned when order is successfully created | + +### Return type + +[**MultiCollateralOrder**](MultiCollateralOrder.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 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) + +# **list_multi_repay_records** +> list[MultiRepayRecord] list_multi_repay_records(type, borrow_currency=borrow_currency, page=page, limit=limit, _from=_from, to=to) + +Query multi-currency collateral repayment 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.MultiCollateralLoanApi(api_client) +type = 'repay' # str | Operation type: repay - Regular repayment, liquidate - Liquidation +borrow_currency = 'USDT' # str | Borrowed currency (optional) +page = 1 # int | Page number (optional) (default to 1) +limit = 10 # int | Maximum number of records returned in a single list (optional) (default to 10) +_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 multi-currency collateral repayment records + api_response = api_instance.list_multi_repay_records(type, borrow_currency=borrow_currency, page=page, limit=limit, _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 MultiCollateralLoanApi->list_multi_repay_records: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **type** | **str**| Operation type: repay - Regular repayment, liquidate - Liquidation | + **borrow_currency** | **str**| Borrowed currency | [optional] + **page** | **int**| Page number | [optional] [default to 1] + **limit** | **int**| Maximum number of records returned in a single list | [optional] [default to 10] + **_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[MultiRepayRecord]**](MultiRepayRecord.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) + +# **repay_multi_collateral_loan** +> MultiRepayResp repay_multi_collateral_loan(repay_multi_loan) + +Multi-currency collateral repayment + +### 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.MultiCollateralLoanApi(api_client) +repay_multi_loan = gate_api.RepayMultiLoan() # RepayMultiLoan | + +try: + # Multi-currency collateral repayment + api_response = api_instance.repay_multi_collateral_loan(repay_multi_loan) + 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 MultiCollateralLoanApi->repay_multi_collateral_loan: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repay_multi_loan** | [**RepayMultiLoan**](RepayMultiLoan.md)| | + +### Return type + +[**MultiRepayResp**](MultiRepayResp.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** | Operation 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_multi_collateral_records** +> list[MultiCollateralRecord] list_multi_collateral_records(page=page, limit=limit, _from=_from, to=to, collateral_currency=collateral_currency) + +Query collateral adjustment 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.MultiCollateralLoanApi(api_client) +page = 1 # int | Page number (optional) (default to 1) +limit = 10 # int | Maximum number of records returned in a single list (optional) (default to 10) +_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) +collateral_currency = 'BTC' # str | Collateral currency (optional) + +try: + # Query collateral adjustment records + api_response = api_instance.list_multi_collateral_records(page=page, limit=limit, _from=_from, to=to, collateral_currency=collateral_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 MultiCollateralLoanApi->list_multi_collateral_records: %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 10] + **_from** | **int**| Start timestamp for the query | [optional] + **to** | **int**| End timestamp for the query, defaults to current time if not specified | [optional] + **collateral_currency** | **str**| Collateral currency | [optional] + +### Return type + +[**list[MultiCollateralRecord]**](MultiCollateralRecord.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) + +# **operate_multi_collateral** +> CollateralAdjustRes operate_multi_collateral(collateral_adjust) + +Add or withdraw collateral + +### 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.MultiCollateralLoanApi(api_client) +collateral_adjust = gate_api.CollateralAdjust() # CollateralAdjust | + +try: + # Add or withdraw collateral + api_response = api_instance.operate_multi_collateral(collateral_adjust) + 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 MultiCollateralLoanApi->operate_multi_collateral: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **collateral_adjust** | [**CollateralAdjust**](CollateralAdjust.md)| | + +### Return type + +[**CollateralAdjustRes**](CollateralAdjustRes.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** | Operation 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_user_currency_quota** +> list[CurrencyQuota] list_user_currency_quota(type, currency) + +Query user's collateral and borrowing currency quota 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.MultiCollateralLoanApi(api_client) +type = 'collateral' # str | Currency type: collateral - Collateral currency, borrow - Borrowing currency +currency = 'BTC' # str | When it is a collateral currency, multiple currencies can be provided separated by commas; when it is a borrowing currency, only one currency can be provided. + +try: + # Query user's collateral and borrowing currency quota information + api_response = api_instance.list_user_currency_quota(type, 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 MultiCollateralLoanApi->list_user_currency_quota: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **type** | **str**| Currency type: collateral - Collateral currency, borrow - Borrowing currency | + **currency** | **str**| When it is a collateral currency, multiple currencies can be provided separated by commas; when it is a borrowing currency, only one currency can be provided. | + +### Return type + +[**list[CurrencyQuota]**](CurrencyQuota.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_multi_collateral_currencies** +> MultiCollateralCurrency list_multi_collateral_currencies() + +Query supported borrowing and collateral currencies for multi-currency collateral + +### 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.MultiCollateralLoanApi(api_client) + +try: + # Query supported borrowing and collateral currencies for multi-currency collateral + api_response = api_instance.list_multi_collateral_currencies() + 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 MultiCollateralLoanApi->list_multi_collateral_currencies: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**MultiCollateralCurrency**](MultiCollateralCurrency.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) + +# **get_multi_collateral_ltv** +> CollateralLtv get_multi_collateral_ltv() + +Query collateralization ratio information + +Multi-currency collateral ratio is fixed, independent of currency + +### 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.MultiCollateralLoanApi(api_client) + +try: + # Query collateralization ratio information + api_response = api_instance.get_multi_collateral_ltv() + 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 MultiCollateralLoanApi->get_multi_collateral_ltv: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**CollateralLtv**](CollateralLtv.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) + +# **get_multi_collateral_fix_rate** +> list[CollateralFixRate] get_multi_collateral_fix_rate() + +Query currency's 7-day and 30-day fixed interest 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.MultiCollateralLoanApi(api_client) + +try: + # Query currency's 7-day and 30-day fixed interest rates + api_response = api_instance.get_multi_collateral_fix_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 MultiCollateralLoanApi->get_multi_collateral_fix_rate: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**list[CollateralFixRate]**](CollateralFixRate.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) + +# **get_multi_collateral_current_rate** +> list[CollateralCurrentRate] get_multi_collateral_current_rate(currencies, vip_level=vip_level) + +Query currency's current interest rate + +Query currency's current interest rate for the previous hour, current interest rate updates hourly + +### 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.MultiCollateralLoanApi(api_client) +currencies = ['[\"BTC\",\"GT\"]'] # list[str] | Specify currency name query array, separated by commas, maximum 100 items +vip_level = '0' # str | VIP level, defaults to 0 if not specified (optional) (default to '0') + +try: + # Query currency's current interest rate + api_response = api_instance.get_multi_collateral_current_rate(currencies, vip_level=vip_level) + 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 MultiCollateralLoanApi->get_multi_collateral_current_rate: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currencies** | [**list[str]**](str.md)| Specify currency name query array, separated by commas, maximum 100 items | + **vip_level** | **str**| VIP level, defaults to 0 if not specified | [optional] [default to '0'] + +### Return type + +[**list[CollateralCurrentRate]**](CollateralCurrentRate.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) + diff --git a/docs/MultiCollateralOrder.md b/docs/MultiCollateralOrder.md new file mode 100644 index 0000000..3162049 --- /dev/null +++ b/docs/MultiCollateralOrder.md @@ -0,0 +1,24 @@ +# MultiCollateralOrder + +Multi-Collateral Order +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**order_id** | **str** | Order ID | [optional] +**order_type** | **str** | current - current, fixed - fixed | [optional] +**fixed_type** | **str** | Fixed interest rate loan periods: 7d - 7 days, 30d - 30 days | [optional] +**fixed_rate** | **str** | Fixed interest rate | [optional] +**expire_time** | **int** | Expiration time, timestamp, unit in seconds | [optional] +**auto_renew** | **bool** | Fixed interest rate, auto-renewal | [optional] +**auto_repay** | **bool** | Fixed interest rate, auto-repayment | [optional] +**current_ltv** | **str** | Current 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] +**total_left_repay_usdt** | **str** | Total outstanding value converted to USDT | [optional] +**total_left_collateral_usdt** | **str** | Total collateral value converted to USDT | [optional] +**borrow_currencies** | [**list[BorrowCurrencyInfo]**](BorrowCurrencyInfo.md) | Borrowing Currency List | [optional] +**collateral_currencies** | [**list[CollateralCurrencyInfo]**](CollateralCurrencyInfo.md) | Collateral Currency 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/MultiCollateralRecord.md b/docs/MultiCollateralRecord.md new file mode 100644 index 0000000..5f48cd6 --- /dev/null +++ b/docs/MultiCollateralRecord.md @@ -0,0 +1,17 @@ +# MultiCollateralRecord + +Multi-Collateral adjustment record +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**order_id** | **int** | Order ID | [optional] +**record_id** | **int** | Collateral record ID | [optional] +**before_ltv** | **str** | Collateral ratio before adjustment | [optional] +**after_ltv** | **str** | Collateral ratio before adjustment | [optional] +**operate_time** | **int** | Operation time, timestamp in seconds | [optional] +**borrow_currencies** | [**list[MultiCollateralRecordCurrency]**](MultiCollateralRecordCurrency.md) | Borrowing Currency List | [optional] +**collateral_currencies** | [**list[MultiCollateralRecordCurrency]**](MultiCollateralRecordCurrency.md) | Collateral Currency 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/MultiCollateralRecordCurrency.md b/docs/MultiCollateralRecordCurrency.md new file mode 100644 index 0000000..9e3f5e1 --- /dev/null +++ b/docs/MultiCollateralRecordCurrency.md @@ -0,0 +1,15 @@ +# MultiCollateralRecordCurrency + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **str** | Currency | [optional] +**index_price** | **str** | Currency Index Price | [optional] +**before_amount** | **str** | Amount before the operation | [optional] +**before_amount_usdt** | **str** | USDT Amount before the operation | [optional] +**after_amount** | **str** | Amount after the operation | [optional] +**after_amount_usdt** | **str** | USDT Amount after the operation | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/MultiLoanItem.md b/docs/MultiLoanItem.md new file mode 100644 index 0000000..3c45fc2 --- /dev/null +++ b/docs/MultiLoanItem.md @@ -0,0 +1,11 @@ +# MultiLoanItem + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **str** | Currency | [optional] +**price** | **str** | Latest price of the 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/MultiLoanRepayItem.md b/docs/MultiLoanRepayItem.md new file mode 100644 index 0000000..f381f48 --- /dev/null +++ b/docs/MultiLoanRepayItem.md @@ -0,0 +1,12 @@ +# MultiLoanRepayItem + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **str** | Repayment currency | [optional] +**amount** | **str** | Size | [optional] +**repaid_all** | **bool** | Repayment method, set to true for full repayment, false for partial 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/MultiRepayRecord.md b/docs/MultiRepayRecord.md new file mode 100644 index 0000000..93e37d8 --- /dev/null +++ b/docs/MultiRepayRecord.md @@ -0,0 +1,22 @@ +# MultiRepayRecord + +Multi-Collateral Repayment Record +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**order_id** | **int** | Order ID | [optional] +**record_id** | **int** | Repayment record ID | [optional] +**init_ltv** | **str** | Initial collateralization rate | [optional] +**before_ltv** | **str** | Ltv before the operation | [optional] +**after_ltv** | **str** | Ltv after the operation | [optional] +**borrow_time** | **int** | Borrowing time, timestamp in seconds | [optional] +**repay_time** | **int** | Repayment time, timestamp in seconds | [optional] +**borrow_currencies** | [**list[RepayRecordCurrency]**](RepayRecordCurrency.md) | List of borrowing information | [optional] +**collateral_currencies** | [**list[RepayRecordCurrency]**](RepayRecordCurrency.md) | List of collateral information | [optional] +**repaid_currencies** | [**list[RepayRecordRepaidCurrency]**](RepayRecordRepaidCurrency.md) | Repay Currency List | [optional] +**total_interest_list** | [**list[RepayRecordTotalInterest]**](RepayRecordTotalInterest.md) | Total Interest List | [optional] +**left_repay_interest_list** | [**list[RepayRecordLeftInterest]**](RepayRecordLeftInterest.md) | List of remaining interest to be repaid | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FundingBookItem.md b/docs/MultiRepayResp.md similarity index 56% rename from docs/FundingBookItem.md rename to docs/MultiRepayResp.md index a72cd26..2d7ebe0 100644 --- a/docs/FundingBookItem.md +++ b/docs/MultiRepayResp.md @@ -1,11 +1,11 @@ -# FundingBookItem +# MultiRepayResp +Multi-currency collateral repayment ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**rate** | **str** | Loan rate | [optional] -**amount** | **str** | Borrowable amount | [optional] -**days** | **int** | The number of days till the loan repayment's dateline | [optional] +**order_id** | **int** | Order ID | [optional] +**repaid_currencies** | [**list[RepayCurrencyRes]**](RepayCurrencyRes.md) | Repay Currency 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/MyFuturesTrade.md b/docs/MyFuturesTrade.md index cf3ad4b..34cc347 100644 --- a/docs/MyFuturesTrade.md +++ b/docs/MyFuturesTrade.md @@ -3,13 +3,17 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **int** | Trade ID | [optional] -**create_time** | **float** | Trading time | [optional] +**id** | **int** | Fill ID | [optional] +**create_time** | **float** | Fill Time | [optional] **contract** | **str** | Futures contract | [optional] -**order_id** | **str** | Order ID related | [optional] +**order_id** | **str** | Related order ID | [optional] **size** | **int** | Trading size | [optional] -**price** | **str** | Trading price | [optional] -**role** | **str** | Trade role. Available values are `taker` and `maker` | [optional] +**close_size** | **int** | Number of closed positions: close_size=0 && size>0 Open long position close_size=0 && size<0 Open short position close_size>0 && size>0 && size <= close_size Close short position close_size>0 && size>0 && size > close_size Close short position and open long position close_size<0 && size<0 && size >= close_size Close long position close_size<0 && size<0 && size < close_size Close long position and open short position | [optional] +**price** | **str** | Fill Price | [optional] +**role** | **str** | Trade role. taker - taker, maker - maker | [optional] +**text** | **str** | Order custom information | [optional] +**fee** | **str** | Trade fee | [optional] +**point_fee** | **str** | Points used to deduct trade 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/MyFuturesTradeTimeRange.md b/docs/MyFuturesTradeTimeRange.md new file mode 100644 index 0000000..ff9e786 --- /dev/null +++ b/docs/MyFuturesTradeTimeRange.md @@ -0,0 +1,20 @@ +# MyFuturesTradeTimeRange + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**trade_id** | **str** | Fill ID | [optional] +**create_time** | **float** | Fill Time | [optional] +**contract** | **str** | Futures contract | [optional] +**order_id** | **str** | Related order ID | [optional] +**size** | **int** | Trading size | [optional] +**close_size** | **int** | Number of closed positions: close_size=0 && size>0 Open long position close_size=0 && size<0 Open short position close_size>0 && size>0 && size <= close_size Close short position close_size>0 && size>0 && size > close_size Close short position and open long position close_size<0 && size<0 && size >= close_size Close long position close_size<0 && size<0 && size < close_size Close long position and open short position | [optional] +**price** | **str** | Fill Price | [optional] +**role** | **str** | Trade role. taker - taker, maker - maker | [optional] +**text** | **str** | Order custom information | [optional] +**fee** | **str** | Trade fee | [optional] +**point_fee** | **str** | Points used to deduct trade 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/OpenOrders.md b/docs/OpenOrders.md index e57cbf6..ec395b5 100644 --- a/docs/OpenOrders.md +++ b/docs/OpenOrders.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **currency_pair** | **str** | Currency pair | [optional] -**total** | **int** | Total open orders in this currency pair | [optional] +**total** | **int** | Total number of open orders for this trading pair on the current page | [optional] **orders** | [**list[Order]**](Order.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/OptionsAccount.md b/docs/OptionsAccount.md new file mode 100644 index 0000000..d9a6eec --- /dev/null +++ b/docs/OptionsAccount.md @@ -0,0 +1,28 @@ +# OptionsAccount + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user** | **int** | User ID | [optional] +**total** | **str** | Account Balance | [optional] +**position_value** | **str** | Position value, long position value is positive, short position value is negative | [optional] +**equity** | **str** | Account equity, the sum of account balance and position value | [optional] +**short_enabled** | **bool** | If the account is allowed to short | [optional] +**mmp_enabled** | **bool** | Whether to enable MMP | [optional] +**liq_triggered** | **bool** | Whether to trigger position liquidation | [optional] +**margin_mode** | **int** | | 保证金模式: - 0:经典现货保证金模式 - 1:跨币种保证金模式 - 2:组合保证金模式 | [optional] +**unrealised_pnl** | **str** | Unrealized PNL | [optional] +**init_margin** | **str** | Initial position margin | [optional] +**maint_margin** | **str** | Position maintenance margin | [optional] +**order_margin** | **str** | Order margin of unfinished orders | [optional] +**ask_order_margin** | **str** | Margin for outstanding sell orders | [optional] +**bid_order_margin** | **str** | Margin for outstanding buy orders | [optional] +**available** | **str** | Available balance to transfer out or trade | [optional] +**point** | **str** | Point card amount | [optional] +**currency** | **str** | Settlement currency | [optional] +**orders_limit** | **int** | Maximum number of outstanding orders | [optional] +**position_notional_limit** | **int** | Notional value upper limit, including the nominal value of positions and outstanding 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/OptionsAccountBook.md b/docs/OptionsAccountBook.md new file mode 100644 index 0000000..8ae81ce --- /dev/null +++ b/docs/OptionsAccountBook.md @@ -0,0 +1,14 @@ +# OptionsAccountBook + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**time** | **float** | Change time | [optional] +**change** | **str** | Amount changed (USDT) | [optional] +**balance** | **str** | Account total balance after change (USDT) | [optional] +**type** | **str** | Changing Type: - dnw: Deposit & Withdraw - prem: Trading premium - fee: Trading fee - refr: Referrer rebate - point_dnw: point_fee: POINT Trading fee - point_refr: POINT Referrer rebate | [optional] +**text** | **str** | Remark | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OptionsApi.md b/docs/OptionsApi.md new file mode 100644 index 0000000..de8bf8b --- /dev/null +++ b/docs/OptionsApi.md @@ -0,0 +1,1892 @@ +# gate_api.OptionsApi + +All URIs are relative to *https://api.gateio.ws/api/v4* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**list_options_underlyings**](OptionsApi.md#list_options_underlyings) | **GET** /options/underlyings | List all underlying assets +[**list_options_expirations**](OptionsApi.md#list_options_expirations) | **GET** /options/expirations | List all expiration dates +[**list_options_contracts**](OptionsApi.md#list_options_contracts) | **GET** /options/contracts | List all contracts for specified underlying and expiration date +[**get_options_contract**](OptionsApi.md#get_options_contract) | **GET** /options/contracts/{contract} | Query specified contract details +[**list_options_settlements**](OptionsApi.md#list_options_settlements) | **GET** /options/settlements | List settlement history +[**get_options_settlement**](OptionsApi.md#get_options_settlement) | **GET** /options/settlements/{contract} | Get specified contract settlement information +[**list_my_options_settlements**](OptionsApi.md#list_my_options_settlements) | **GET** /options/my_settlements | Query personal settlement records +[**list_options_order_book**](OptionsApi.md#list_options_order_book) | **GET** /options/order_book | Query options contract order book +[**list_options_tickers**](OptionsApi.md#list_options_tickers) | **GET** /options/tickers | Query options market ticker information +[**list_options_underlying_tickers**](OptionsApi.md#list_options_underlying_tickers) | **GET** /options/underlying/tickers/{underlying} | Query underlying ticker information +[**list_options_candlesticks**](OptionsApi.md#list_options_candlesticks) | **GET** /options/candlesticks | Options contract market candlestick chart +[**list_options_underlying_candlesticks**](OptionsApi.md#list_options_underlying_candlesticks) | **GET** /options/underlying/candlesticks | Underlying index price candlestick chart +[**list_options_trades**](OptionsApi.md#list_options_trades) | **GET** /options/trades | Market trade records +[**list_options_account**](OptionsApi.md#list_options_account) | **GET** /options/accounts | Query account information +[**list_options_account_book**](OptionsApi.md#list_options_account_book) | **GET** /options/account_book | Query account change history +[**list_options_positions**](OptionsApi.md#list_options_positions) | **GET** /options/positions | List user's positions of specified underlying +[**get_options_position**](OptionsApi.md#get_options_position) | **GET** /options/positions/{contract} | Get specified contract position +[**list_options_position_close**](OptionsApi.md#list_options_position_close) | **GET** /options/position_close | List user's liquidation history of specified underlying +[**list_options_orders**](OptionsApi.md#list_options_orders) | **GET** /options/orders | List options orders +[**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 +[**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 +[**get_options_mmp**](OptionsApi.md#get_options_mmp) | **GET** /options/mmp | MMP Query. +[**set_options_mmp**](OptionsApi.md#set_options_mmp) | **POST** /options/mmp | MMP Settings +[**reset_options_mmp**](OptionsApi.md#reset_options_mmp) | **POST** /options/mmp/reset | MMP Reset + + +# **list_options_underlyings** +> list[OptionsUnderlying] list_options_underlyings() + +List all underlying assets + +### 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.OptionsApi(api_client) + +try: + # List all underlying assets + api_response = api_instance.list_options_underlyings() + 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->list_options_underlyings: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**list[OptionsUnderlying]**](OptionsUnderlying.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) + +# **list_options_expirations** +> list[int] list_options_expirations(underlying) + +List all expiration dates + +### 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.OptionsApi(api_client) +underlying = 'BTC_USDT' # str | Underlying (Obtained by listing underlying endpoint) + +try: + # List all expiration dates + api_response = api_instance.list_options_expirations(underlying) + 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->list_options_expirations: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **underlying** | **str**| Underlying (Obtained by listing underlying endpoint) | + +### Return type + +**list[int]** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | List expiration dates for specified underlying | - | + +[[Back to top]](#) [[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_options_contracts** +> list[OptionsContract] list_options_contracts(underlying, expiration=expiration) + +List all contracts for specified underlying and expiration date + +### 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.OptionsApi(api_client) +underlying = 'BTC_USDT' # str | Underlying (Obtained by listing underlying endpoint) +expiration = 1636588800 # int | Unix timestamp of expiration date (optional) + +try: + # List all contracts for specified underlying and expiration date + api_response = api_instance.list_options_contracts(underlying, expiration=expiration) + 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->list_options_contracts: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **underlying** | **str**| Underlying (Obtained by listing underlying endpoint) | + **expiration** | **int**| Unix timestamp of expiration date | [optional] + +### Return type + +[**list[OptionsContract]**](OptionsContract.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_options_contract** +> OptionsContract get_options_contract(contract) + +Query specified contract 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.OptionsApi(api_client) +contract = 'BTC_USDT-20211130-65000-C' # str | + +try: + # Query specified contract details + api_response = api_instance.get_options_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 OptionsApi->get_options_contract: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **contract** | **str**| | + +### Return type + +[**OptionsContract**](OptionsContract.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) + +# **list_options_settlements** +> list[OptionsSettlement] list_options_settlements(underlying, limit=limit, offset=offset, _from=_from, to=to) + +List settlement history + +### 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.OptionsApi(api_client) +underlying = 'BTC_USDT' # str | Underlying (Obtained by listing underlying endpoint) +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) + +try: + # List settlement history + api_response = api_instance.list_options_settlements(underlying, limit=limit, offset=offset, _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 OptionsApi->list_options_settlements: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **underlying** | **str**| Underlying (Obtained by listing underlying endpoint) | + **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] + +### Return type + +[**list[OptionsSettlement]**](OptionsSettlement.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_options_settlement** +> OptionsSettlement get_options_settlement(contract, underlying, at) + +Get specified contract settlement 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.OptionsApi(api_client) +contract = 'BTC_USDT-20211130-65000-C' # str | +underlying = 'BTC_USDT' # str | Underlying (Obtained by listing underlying endpoint) +at = 56 # int | + +try: + # Get specified contract settlement information + api_response = api_instance.get_options_settlement(contract, underlying, 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 OptionsApi->get_options_settlement: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **contract** | **str**| | + **underlying** | **str**| Underlying (Obtained by listing underlying endpoint) | + **at** | **int**| | + +### Return type + +[**OptionsSettlement**](OptionsSettlement.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) + +# **list_my_options_settlements** +> list[OptionsMySettlements] list_my_options_settlements(underlying, contract=contract, limit=limit, offset=offset, _from=_from, to=to) + +Query personal settlement 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.OptionsApi(api_client) +underlying = 'BTC_USDT' # str | Underlying (Obtained by listing underlying endpoint) +contract = 'BTC_USDT-20210916-5000-C' # str | Options contract name (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) + +try: + # Query personal settlement records + api_response = api_instance.list_my_options_settlements(underlying, contract=contract, limit=limit, offset=offset, _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 OptionsApi->list_my_options_settlements: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **underlying** | **str**| Underlying (Obtained by listing underlying endpoint) | + **contract** | **str**| Options contract name | [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] + +### Return type + +[**list[OptionsMySettlements]**](OptionsMySettlements.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_options_order_book** +> FuturesOrderBook list_options_order_book(contract, interval=interval, limit=limit, with_id=with_id) + +Query options contract order book + +Bids will be sorted by price from high to low, while asks sorted reversely + +### 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.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') +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 depth changes (optional) (default to False) + +try: + # Query options contract order book + api_response = api_instance.list_options_order_book(contract, interval=interval, limit=limit, with_id=with_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 OptionsApi->list_options_order_book: %s\n" % e) +``` + +### Parameters + +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'] + **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 depth changes | [optional] [default to False] + +### Return type + +[**FuturesOrderBook**](FuturesOrderBook.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Depth 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_options_tickers** +> list[OptionsTicker] list_options_tickers(underlying) + +Query options market ticker 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.OptionsApi(api_client) +underlying = 'BTC_USDT' # str | Underlying (Obtained by listing underlying endpoint) + +try: + # Query options market ticker information + api_response = api_instance.list_options_tickers(underlying) + 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->list_options_tickers: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **underlying** | **str**| Underlying (Obtained by listing underlying endpoint) | + +### Return type + +[**list[OptionsTicker]**](OptionsTicker.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) + +# **list_options_underlying_tickers** +> OptionsUnderlyingTicker list_options_underlying_tickers(underlying) + +Query underlying ticker 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.OptionsApi(api_client) +underlying = 'BTC_USDT' # str | Underlying + +try: + # Query underlying ticker information + api_response = api_instance.list_options_underlying_tickers(underlying) + 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->list_options_underlying_tickers: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **underlying** | **str**| Underlying | + +### Return type + +[**OptionsUnderlyingTicker**](OptionsUnderlyingTicker.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) + +# **list_options_candlesticks** +> list[OptionsCandlestick] list_options_candlesticks(contract, limit=limit, _from=_from, to=to, interval=interval) + +Options contract market candlestick chart + +### 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.OptionsApi(api_client) +contract = 'BTC_USDT-20210916-5000-C' # str | Options contract name +limit = 100 # int | Maximum number of records returned in a single list (optional) (default to 100) +_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) +interval = '5m' # str | Time interval between data points (optional) (default to '5m') + +try: + # Options contract market candlestick chart + api_response = api_instance.list_options_candlesticks(contract, limit=limit, _from=_from, to=to, interval=interval) + 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->list_options_candlesticks: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **contract** | **str**| Options contract name | + **limit** | **int**| Maximum number of records returned in a single list | [optional] [default to 100] + **_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] + **interval** | **str**| Time interval between data points | [optional] [default to '5m'] + +### Return type + +[**list[OptionsCandlestick]**](OptionsCandlestick.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) + +# **list_options_underlying_candlesticks** +> list[FuturesCandlestick] list_options_underlying_candlesticks(underlying, limit=limit, _from=_from, to=to, interval=interval) + +Underlying index price candlestick chart + +### 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.OptionsApi(api_client) +underlying = 'BTC_USDT' # str | Underlying (Obtained by listing underlying endpoint) +limit = 100 # int | Maximum number of records returned in a single list (optional) (default to 100) +_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) +interval = '5m' # str | Time interval between data points (optional) (default to '5m') + +try: + # Underlying index price candlestick chart + api_response = api_instance.list_options_underlying_candlesticks(underlying, limit=limit, _from=_from, to=to, interval=interval) + 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->list_options_underlying_candlesticks: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **underlying** | **str**| Underlying (Obtained by listing underlying endpoint) | + **limit** | **int**| Maximum number of records returned in a single list | [optional] [default to 100] + **_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] + **interval** | **str**| Time interval between data points | [optional] [default to '5m'] + +### Return type + +[**list[FuturesCandlestick]**](FuturesCandlestick.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) + +# **list_options_trades** +> list[FuturesTrade] list_options_trades(contract=contract, type=type, limit=limit, offset=offset, _from=_from, to=to) + +Market trade records + +### 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.OptionsApi(api_client) +contract = 'BTC_USDT-20210916-5000-C' # str | Options contract name (optional) +type = '1546935600' # str | `C` for call, `P` for put (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) + +try: + # Market trade records + api_response = api_instance.list_options_trades(contract=contract, type=type, limit=limit, offset=offset, _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 OptionsApi->list_options_trades: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **contract** | **str**| Options contract name | [optional] + **type** | **str**| `C` for call, `P` for put | [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] + +### Return type + +[**list[FuturesTrade]**](FuturesTrade.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) + +# **list_options_account** +> OptionsAccount list_options_account() + +Query 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.OptionsApi(api_client) + +try: + # Query account information + api_response = api_instance.list_options_account() + 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->list_options_account: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**OptionsAccount**](OptionsAccount.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_options_account_book** +> list[OptionsAccountBook] list_options_account_book(limit=limit, offset=offset, _from=_from, to=to, type=type) + +Query account change 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.OptionsApi(api_client) +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) +type = 'dnw' # str | Change types: - dnw: Deposit & Withdrawal - prem: Trading premium - fee: Trading fee - refr: Referrer rebate - set: Settlement P&L (optional) + +try: + # Query account change history + api_response = api_instance.list_options_account_book(limit=limit, offset=offset, _from=_from, to=to, 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 OptionsApi->list_options_account_book: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **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] + **type** | **str**| Change types: - dnw: Deposit & Withdrawal - prem: Trading premium - fee: Trading fee - refr: Referrer rebate - set: Settlement P&L | [optional] + +### Return type + +[**list[OptionsAccountBook]**](OptionsAccountBook.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_options_positions** +> list[OptionsPosition] list_options_positions(underlying=underlying) + +List user's positions of specified underlying + +### 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) +underlying = 'BTC_USDT' # str | Underlying (optional) + +try: + # List user's positions of specified underlying + api_response = api_instance.list_options_positions(underlying=underlying) + 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->list_options_positions: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **underlying** | **str**| Underlying | [optional] + +### Return type + +[**list[OptionsPosition]**](OptionsPosition.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) + +# **get_options_position** +> OptionsPosition get_options_position(contract) + +Get specified contract 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.OptionsApi(api_client) +contract = 'BTC_USDT-20211130-65000-C' # str | + +try: + # Get specified contract position + api_response = api_instance.get_options_position(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 OptionsApi->get_options_position: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **contract** | **str**| | + +### Return type + +[**OptionsPosition**](OptionsPosition.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_options_position_close** +> list[OptionsPositionClose] list_options_position_close(underlying, contract=contract) + +List user's liquidation history of specified underlying + +### 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) +underlying = 'BTC_USDT' # str | Underlying (Obtained by listing underlying endpoint) +contract = 'BTC_USDT-20210916-5000-C' # str | Options contract name (optional) + +try: + # List user's liquidation history of specified underlying + api_response = api_instance.list_options_position_close(underlying, 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 OptionsApi->list_options_position_close: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **underlying** | **str**| Underlying (Obtained by listing underlying endpoint) | + **contract** | **str**| Options contract name | [optional] + +### Return type + +[**list[OptionsPositionClose]**](OptionsPositionClose.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_options_orders** +> list[OptionsOrder] list_options_orders(status, contract=contract, underlying=underlying, limit=limit, offset=offset, _from=_from, to=to) + +List options 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.OptionsApi(api_client) +status = 'open' # str | Query order list based on status +contract = 'BTC_USDT-20210916-5000-C' # str | Options contract name (optional) +underlying = 'BTC_USDT' # str | Underlying (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) + +try: + # List options orders + api_response = api_instance.list_options_orders(status, contract=contract, underlying=underlying, limit=limit, offset=offset, _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 OptionsApi->list_options_orders: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | **str**| Query order list based on status | + **contract** | **str**| Options contract name | [optional] + **underlying** | **str**| Underlying | [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] + +### Return type + +[**list[OptionsOrder]**](OptionsOrder.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) + +# **create_options_order** +> OptionsOrder create_options_order(options_order) + +Create an options 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.OptionsApi(api_client) +options_order = gate_api.OptionsOrder() # OptionsOrder | + +try: + # Create an options order + api_response = api_instance.create_options_order(options_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 OptionsApi->create_options_order: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **options_order** | [**OptionsOrder**](OptionsOrder.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 | +|-------------|-------------|------------------| +**201** | 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_orders** +> list[OptionsOrder] cancel_options_orders(contract=contract, underlying=underlying, side=side) + +Cancel all orders with 'open' 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.OptionsApi(api_client) +contract = 'BTC_USDT-20210916-5000-C' # str | Options contract name (optional) +underlying = 'BTC_USDT' # str | Underlying (optional) +side = 'ask' # str | Specify all bids or all asks, both included if not specified (optional) + +try: + # Cancel all orders with 'open' status + api_response = api_instance.cancel_options_orders(contract=contract, underlying=underlying, 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 OptionsApi->cancel_options_orders: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **contract** | **str**| Options contract name | [optional] + **underlying** | **str**| Underlying | [optional] + **side** | **str**| Specify all bids or all asks, both included if not specified | [optional] + +### Return type + +[**list[OptionsOrder]**](OptionsOrder.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_options_order** +> OptionsOrder get_options_order(order_id) + +Query single 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.OptionsApi(api_client) +order_id = 12345 # int | Order ID returned when order is successfully created + +try: + # Query single order details + api_response = api_instance.get_options_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 OptionsApi->get_options_order: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order_id** | **int**| Order ID returned when order is successfully created | + +### Return type + +[**OptionsOrder**](OptionsOrder.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 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) + +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.OptionsApi(api_client) +order_id = 12345 # int | Order ID returned when order is successfully created + +try: + # Cancel single order + api_response = api_instance.cancel_options_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 OptionsApi->cancel_options_order: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order_id** | **int**| Order ID returned when order is successfully created | + +### Return type + +[**OptionsOrder**](OptionsOrder.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 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) + +# **countdown_cancel_all_options** +> TriggerTime countdown_cancel_all_options(countdown_cancel_all_options_task) + +Countdown cancel orders + +Option order heartbeat detection, when the `timeout` time set by the user is reached, if the existing countdown is not canceled or a new countdown is set, the related `option pending order` will be automatically canceled. This interface can be called repeatedly to set a new countdown or cancel the countdown. Usage example: Repeat this interface at intervals of 30 seconds, with each countdown `timeout` set to 30 (seconds). If this interface is not called again within 30 seconds, all pending orders on the `underlying` `contract` you specified will be automatically cancelled. If `underlying` `contract` is not specified, user will be automatically cancelled If `timeout` is set to 0 within 30 seconds, the countdown timer will expire and the automatic order cancellation function will be cancelled. + +### 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) +countdown_cancel_all_options_task = gate_api.CountdownCancelAllOptionsTask() # CountdownCancelAllOptionsTask | + +try: + # Countdown cancel orders + api_response = api_instance.countdown_cancel_all_options(countdown_cancel_all_options_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 OptionsApi->countdown_cancel_all_options: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **countdown_cancel_all_options_task** | [**CountdownCancelAllOptionsTask**](CountdownCancelAllOptionsTask.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) + +# **list_my_options_trades** +> list[OptionsMyTrade] list_my_options_trades(underlying, contract=contract, limit=limit, offset=offset, _from=_from, to=to) + +Query personal trading 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.OptionsApi(api_client) +underlying = 'BTC_USDT' # str | Underlying (Obtained by listing underlying endpoint) +contract = 'BTC_USDT-20210916-5000-C' # str | Options contract name (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) + +try: + # Query personal trading records + api_response = api_instance.list_my_options_trades(underlying, contract=contract, limit=limit, offset=offset, _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 OptionsApi->list_my_options_trades: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **underlying** | **str**| Underlying (Obtained by listing underlying endpoint) | + **contract** | **str**| Options contract name | [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] + +### Return type + +[**list[OptionsMyTrade]**](OptionsMyTrade.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) + +# **get_options_mmp** +> list[OptionsMMP] get_options_mmp(underlying=underlying) + +MMP Query. + +### 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) +underlying = 'BTC_USDT' # str | Underlying (optional) + +try: + # MMP Query. + api_response = api_instance.get_options_mmp(underlying=underlying) + 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->get_options_mmp: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **underlying** | **str**| Underlying | [optional] + +### Return type + +[**list[OptionsMMP]**](OptionsMMP.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) + +# **set_options_mmp** +> OptionsMMP set_options_mmp(options_mmp) + +MMP Settings + +### 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) +options_mmp = gate_api.OptionsMMP() # OptionsMMP | + +try: + # MMP Settings + api_response = api_instance.set_options_mmp(options_mmp) + 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->set_options_mmp: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **options_mmp** | [**OptionsMMP**](OptionsMMP.md)| | + +### Return type + +[**OptionsMMP**](OptionsMMP.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** | MMP 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) + +# **reset_options_mmp** +> OptionsMMP reset_options_mmp(options_mmp_reset) + +MMP Reset + +### 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) +options_mmp_reset = gate_api.OptionsMMPReset() # OptionsMMPReset | + +try: + # MMP Reset + api_response = api_instance.reset_options_mmp(options_mmp_reset) + 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->reset_options_mmp: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **options_mmp_reset** | [**OptionsMMPReset**](OptionsMMPReset.md)| | + +### Return type + +[**OptionsMMP**](OptionsMMP.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** | MMP 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) + diff --git a/docs/OptionsCandlestick.md b/docs/OptionsCandlestick.md new file mode 100644 index 0000000..963ccda --- /dev/null +++ b/docs/OptionsCandlestick.md @@ -0,0 +1,16 @@ +# OptionsCandlestick + +data point in every timestamp +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**t** | **float** | Unix timestamp in seconds | [optional] +**v** | **int** | size volume (contract size). Only returned if `contract` is not prefixed | [optional] +**c** | **str** | Close price (quote currency, unit: underlying corresponding option price) | [optional] +**h** | **str** | Highest price (quote currency, unit: underlying corresponding option price) | [optional] +**l** | **str** | Lowest price (quote currency, unit: underlying corresponding option price) | [optional] +**o** | **str** | Open price (quote currency, unit: underlying corresponding option 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/OptionsContract.md b/docs/OptionsContract.md new file mode 100644 index 0000000..ea9845a --- /dev/null +++ b/docs/OptionsContract.md @@ -0,0 +1,35 @@ +# OptionsContract + +Options contract details +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Options contract name | [optional] +**tag** | **str** | Tag | [optional] +**create_time** | **float** | Created time | [optional] +**expiration_time** | **float** | Expiration time | [optional] +**is_call** | **bool** | `true` means call options, `false` means put options | [optional] +**multiplier** | **str** | Multiplier used in converting from invoicing to settlement currency | [optional] +**underlying** | **str** | Underlying | [optional] +**underlying_price** | **str** | Underlying price (quote currency) | [optional] +**last_price** | **str** | Last trading price | [optional] +**mark_price** | **str** | Current mark price (quote currency) | [optional] +**index_price** | **str** | Current index price (quote currency) | [optional] +**maker_fee_rate** | **str** | Maker fee rate, negative values indicate rebates | [optional] +**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_price_deviate** | **str** | The positive and negative offset allowed between the order price and the current mark price, that `order_price` must meet the following conditions: order_price is within the range of mark_price +/- order_price_deviate * underlying_price and does not distinguish between buy and sell orders | [optional] +**ref_discount_rate** | **str** | Trading fee discount for referred users | [optional] +**ref_rebate_rate** | **str** | Commission rate for referrers | [optional] +**orderbook_id** | **int** | Orderbook update ID | [optional] +**trade_id** | **int** | Current trade ID | [optional] +**trade_size** | **int** | Historical cumulative trading volume | [optional] +**position_size** | **int** | Current total long position size | [optional] +**orders_limit** | **int** | Maximum number of pending 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/OptionsMMP.md b/docs/OptionsMMP.md new file mode 100644 index 0000000..2e8b73f --- /dev/null +++ b/docs/OptionsMMP.md @@ -0,0 +1,17 @@ +# OptionsMMP + +MMP Settings +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**underlying** | **str** | Underlying | +**window** | **int** | Time window (milliseconds), between 1-5000, 0 means disable MMP | +**frozen_period** | **int** | Freeze duration (milliseconds), 0 means always frozen, need to call reset API to unfreeze | +**qty_limit** | **str** | Trading volume upper limit (positive number, up to 2 decimal places) | +**delta_limit** | **str** | Upper limit of net delta value (positive number, up to 2 decimal places) | +**trigger_time_ms** | **int** | Trigger freeze time (milliseconds), 0 means no freeze is triggered | [optional] [readonly] +**frozen_until_ms** | **int** | Unfreeze time (milliseconds). If the freeze duration is not configured, there will be no unfreeze time after the freeze is triggered | [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/OptionsMMPReset.md b/docs/OptionsMMPReset.md new file mode 100644 index 0000000..1244357 --- /dev/null +++ b/docs/OptionsMMPReset.md @@ -0,0 +1,17 @@ +# OptionsMMPReset + +MMP Reset +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**underlying** | **str** | Underlying | +**window** | **int** | Time window (milliseconds), between 1-5000, 0 means disable MMP | [optional] [readonly] +**frozen_period** | **int** | Freeze duration (milliseconds), 0 means always frozen, need to call reset API to unfreeze | [optional] [readonly] +**qty_limit** | **str** | Trading volume upper limit (positive number, up to 2 decimal places) | [optional] [readonly] +**delta_limit** | **str** | Upper limit of net delta value (positive number, up to 2 decimal places) | [optional] [readonly] +**trigger_time_ms** | **int** | Trigger freeze time (milliseconds), 0 means no freeze is triggered | [optional] [readonly] +**frozen_until_ms** | **int** | Unfreeze time (milliseconds). If the freeze duration is not configured, there will be no unfreeze time after the freeze is triggered | [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/OptionsMySettlements.md b/docs/OptionsMySettlements.md new file mode 100644 index 0000000..c6df4a3 --- /dev/null +++ b/docs/OptionsMySettlements.md @@ -0,0 +1,18 @@ +# OptionsMySettlements + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**time** | **float** | Settlement time | [optional] +**underlying** | **str** | Underlying | [optional] +**contract** | **str** | Options contract name | [optional] +**strike_price** | **str** | Strike price (quote currency) | [optional] +**settle_price** | **str** | Settlement price (quote currency) | [optional] +**size** | **int** | Settlement size | [optional] +**settle_profit** | **str** | Settlement profit (quote currency) | [optional] +**fee** | **str** | Settlement fee (quote currency) | [optional] +**realised_pnl** | **str** | Accumulated profit and loss from opening positions, including premium, fees, settlement profit, etc. (quote 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/OptionsMyTrade.md b/docs/OptionsMyTrade.md new file mode 100644 index 0000000..115f8ca --- /dev/null +++ b/docs/OptionsMyTrade.md @@ -0,0 +1,17 @@ +# OptionsMyTrade + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Fill ID | [optional] +**create_time** | **float** | Fill Time | [optional] +**contract** | **str** | Options contract name | [optional] +**order_id** | **int** | Related order ID | [optional] +**size** | **int** | Trading size | [optional] +**price** | **str** | Trade price (quote currency) | [optional] +**underlying_price** | **str** | Underlying price (quote currency) | [optional] +**role** | **str** | Trade role. taker - taker, maker - maker | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OptionsOrder.md b/docs/OptionsOrder.md new file mode 100644 index 0000000..484b6e0 --- /dev/null +++ b/docs/OptionsOrder.md @@ -0,0 +1,35 @@ +# OptionsOrder + +Options order details +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Options order ID | [optional] [readonly] +**user** | **int** | User ID | [optional] [readonly] +**create_time** | **float** | Creation time of order | [optional] [readonly] +**finish_time** | **float** | Order finished time. Not returned if order is open | [optional] [readonly] +**finish_as** | **str** | Order finish reason: - filled: Fully filled - cancelled: User cancelled - liquidated: Cancelled due to liquidation - ioc: Not immediately fully filled due to IOC time-in-force setting - auto_deleveraged: Cancelled due to auto-deleveraging - reduce_only: Cancelled due to position increase while reduce-only is set - position_closed: Cancelled because the position was closed - reduce_out: Only reduce positions by excluding hard-to-fill orders - mmp_cancelled: Cancelled by MMP | [optional] [readonly] +**status** | **str** | Order status - `open`: Pending - `finished`: Completed | [optional] [readonly] +**contract** | **str** | Options identifier | +**size** | **int** | Required. Trading quantity. Positive for buy, negative for sell. Set to 0 for close position orders. | +**iceberg** | **int** | Display size for iceberg orders. 0 for non-iceberg orders. Note that hidden portions are charged taker fees. | [optional] +**price** | **str** | Order price. Price of 0 with `tif` set as `ioc` represents market order (quote currency) | [optional] +**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] +**mmp** | **bool** | When set to true, it is an MMP order | [optional] [default to False] +**is_mmp** | **bool** | Whether it is an MMP order. Corresponds to `mmp` in the request | [optional] [readonly] +**tif** | **str** | Time in force strategy. Market orders currently only support IOC mode - gtc: Good Till Cancelled - ioc: Immediate Or Cancelled, execute immediately or cancel, taker only - poc: Pending Or Cancelled, passive order, maker only | [optional] [default to 'gtc'] +**left** | **int** | Unfilled quantity | [optional] [readonly] +**fill_price** | **str** | Fill price | [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: - web: from web - api: from API - app: from mobile phones - auto_deleveraging: from ADL - liquidation: from liquidation - insurance: from insurance | [optional] +**tkfr** | **str** | Taker fee | [optional] [readonly] +**mkfr** | **str** | Maker fee | [optional] [readonly] +**refu** | **int** | Referrer user ID | [optional] [readonly] +**refr** | **str** | Referrer rebate | [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/OptionsPosition.md b/docs/OptionsPosition.md new file mode 100644 index 0000000..b6dbefe --- /dev/null +++ b/docs/OptionsPosition.md @@ -0,0 +1,26 @@ +# OptionsPosition + +Options contract position details +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user** | **int** | User ID | [optional] [readonly] +**underlying** | **str** | Underlying | [optional] [readonly] +**underlying_price** | **str** | Underlying price (quote currency) | [optional] [readonly] +**contract** | **str** | Options contract name | [optional] [readonly] +**size** | **int** | Position size (contract quantity) | [optional] [readonly] +**entry_price** | **str** | Entry size (quote currency) | [optional] [readonly] +**mark_price** | **str** | Current mark price (quote currency) | [optional] [readonly] +**mark_iv** | **str** | Implied volatility | [optional] [readonly] +**realised_pnl** | **str** | Realized PnL | [optional] [readonly] +**unrealised_pnl** | **str** | Unrealized PNL | [optional] [readonly] +**pending_orders** | **int** | Current pending order quantity | [optional] [readonly] +**close_order** | [**OptionsPositionCloseOrder**](OptionsPositionCloseOrder.md) | | [optional] +**delta** | **str** | Greek letter delta | [optional] [readonly] +**gamma** | **str** | Greek letter gamma | [optional] [readonly] +**vega** | **str** | Greek letter vega | [optional] [readonly] +**theta** | **str** | Greek letter theta | [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/OptionsPositionClose.md b/docs/OptionsPositionClose.md new file mode 100644 index 0000000..ea97971 --- /dev/null +++ b/docs/OptionsPositionClose.md @@ -0,0 +1,15 @@ +# OptionsPositionClose + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**time** | **float** | Position close time | [optional] [readonly] +**contract** | **str** | Options contract name | [optional] [readonly] +**side** | **str** | Position side - `long`: Long position - `short`: Short position | [optional] [readonly] +**pnl** | **str** | PnL | [optional] [readonly] +**text** | **str** | Source of close order. See `order.text` field for specific values | [optional] [readonly] +**settle_size** | **str** | Settlement size | [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/OptionsPositionCloseOrder.md b/docs/OptionsPositionCloseOrder.md new file mode 100644 index 0000000..77d345c --- /dev/null +++ b/docs/OptionsPositionCloseOrder.md @@ -0,0 +1,13 @@ +# OptionsPositionCloseOrder + +Current close order information, or `null` if no close order +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Order ID | [optional] +**price** | **str** | Order price (quote currency) | [optional] +**is_liq** | **bool** | Whether the close order is from liquidation | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OptionsSettlement.md b/docs/OptionsSettlement.md new file mode 100644 index 0000000..651d917 --- /dev/null +++ b/docs/OptionsSettlement.md @@ -0,0 +1,15 @@ +# OptionsSettlement + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**time** | **float** | Last configuration update time | [optional] +**contract** | **str** | Options contract name | [optional] +**profit** | **str** | Settlement profit per contract (quote currency) | [optional] +**fee** | **str** | Settlement fee per contract (quote currency) | [optional] +**strike_price** | **str** | Strike price (quote currency) | [optional] +**settle_price** | **str** | Settlement price (quote 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/OptionsTicker.md b/docs/OptionsTicker.md new file mode 100644 index 0000000..1fef6d8 --- /dev/null +++ b/docs/OptionsTicker.md @@ -0,0 +1,28 @@ +# OptionsTicker + +Options contract details +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Options contract name | [optional] +**last_price** | **str** | Last trade price (quote currency) | [optional] +**mark_price** | **str** | Current mark price (quote currency) | [optional] +**index_price** | **str** | Current index price (quote currency) | [optional] +**ask1_size** | **int** | Best ask size | [optional] +**ask1_price** | **str** | Best ask price | [optional] +**bid1_size** | **int** | Best bid size | [optional] +**bid1_price** | **str** | Best bid price | [optional] +**position_size** | **int** | Current total long position size | [optional] +**mark_iv** | **str** | Implied volatility | [optional] +**bid_iv** | **str** | Bid side implied volatility | [optional] +**ask_iv** | **str** | Ask side implied volatility | [optional] +**leverage** | **str** | Current leverage. Formula: underlying_price / mark_price * delta | [optional] +**delta** | **str** | Greek letter delta | [optional] +**gamma** | **str** | Greek letter gamma | [optional] +**vega** | **str** | Greek letter vega | [optional] +**theta** | **str** | Greek letter theta | [optional] +**rho** | **str** | Rho | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OptionsUnderlying.md b/docs/OptionsUnderlying.md new file mode 100644 index 0000000..30897a6 --- /dev/null +++ b/docs/OptionsUnderlying.md @@ -0,0 +1,11 @@ +# OptionsUnderlying + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Underlying name | [optional] +**index_price** | **str** | Spot index price (quote 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/OptionsUnderlyingTicker.md b/docs/OptionsUnderlyingTicker.md new file mode 100644 index 0000000..07be739 --- /dev/null +++ b/docs/OptionsUnderlyingTicker.md @@ -0,0 +1,13 @@ +# OptionsUnderlyingTicker + +Options underlying detail +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**trade_put** | **int** | Total put options trades amount in last 24h | [optional] +**trade_call** | **int** | Total call options trades amount in last 24h | [optional] +**index_price** | **str** | Index price (quote 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/Order.md b/docs/Order.md index 6c47952..7eb5f0a 100644 --- a/docs/Order.md +++ b/docs/Order.md @@ -5,32 +5,41 @@ 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(.) | [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] **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] **currency_pair** | **str** | Currency pair | -**type** | **str** | Order type. limit - limit order | [optional] [default to 'limit'] -**account** | **str** | Account type. spot - use spot account; margin - use margin account; cross_margin - use cross margin account | [optional] [default to 'spot'] -**side** | **str** | Order side | -**amount** | **str** | Trade amount | -**price** | **str** | Order price | -**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 | [optional] [default to 'gtc'] -**iceberg** | **str** | Amount to display for the iceberg order. Null or 0 for normal orders. Set to -1 to hide the order completely | [optional] -**auto_borrow** | **bool** | Used in margin or cross margin trading to allow automatic loan of insufficient amount if balance is not enough. | [optional] -**auto_repay** | **bool** | Enable or disable automatic repayment for automatic borrow loan generated by cross margin order. Default is disabled. Note that: 1. This field is only effective for cross margin orders. Margin account does not support setting auto repayment for orders. 2. `auto_borrow` and `auto_repay` cannot be both set to true in one order. | [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'] +**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` | +**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] +**auto_borrow** | **bool** | Used in margin or cross margin trading to allow automatic loan of insufficient amount if balance is not enough | [optional] +**auto_repay** | **bool** | Enable or disable automatic repayment for automatic borrow loan generated by cross margin order. Default is disabled. Note that: 1. This field is only effective for cross margin orders. Margin account does not support setting auto repayment for orders. 2. `auto_borrow` and `auto_repay` can be both set to true in one order | [optional] **left** | **str** | Amount left to fill | [optional] [readonly] +**filled_amount** | **str** | Amount filled | [optional] [readonly] **fill_price** | **str** | Total filled in quote currency. Deprecated in favor of `filled_total` | [optional] [readonly] **filled_total** | **str** | Total filled in quote currency | [optional] [readonly] +**avg_deal_price** | **str** | Average fill price | [optional] [readonly] **fee** | **str** | Fee deducted | [optional] [readonly] **fee_currency** | **str** | Fee currency unit | [optional] [readonly] **point_fee** | **str** | Points used to deduct fee | [optional] [readonly] **gt_fee** | **str** | GT used to deduct fee | [optional] [readonly] -**gt_discount** | **bool** | Whether GT fee discount is used | [optional] [readonly] +**gt_maker_fee** | **str** | GT amount used to deduct maker fee | [optional] [readonly] +**gt_taker_fee** | **str** | GT amount used to deduct taker fee | [optional] [readonly] +**gt_discount** | **bool** | Whether GT fee deduction is enabled | [optional] [readonly] **rebated_fee** | **str** | Rebated fee | [optional] [readonly] **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] +**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] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/OrderBook.md b/docs/OrderBook.md index 1cd4f55..2bfae72 100644 --- a/docs/OrderBook.md +++ b/docs/OrderBook.md @@ -6,8 +6,8 @@ Name | Type | Description | Notes **id** | **int** | Order book ID, which is updated whenever the order book is changed. Valid only when `with_id` is set to `true` | [optional] **current** | **int** | The timestamp of the response data being generated (in milliseconds) | [optional] **update** | **int** | The timestamp of when the orderbook last changed (in milliseconds) | [optional] -**asks** | **list[list[str]]** | Asks order depth | -**bids** | **list[list[str]]** | Bids order depth | +**asks** | **list[list[str]]** | Ask Depth | +**bids** | **list[list[str]]** | 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/OrderCancel.md b/docs/OrderCancel.md new file mode 100644 index 0000000..0a14fe2 --- /dev/null +++ b/docs/OrderCancel.md @@ -0,0 +1,49 @@ +# OrderCancel + +Spot order details +## Properties +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] +**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] +**message** | **str** | Detailed error message, if any, otherwise an empty string | [optional] +**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] +**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` | +**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] +**auto_borrow** | **bool** | Used in margin or cross margin trading to allow automatic loan of insufficient amount if balance is not enough | [optional] +**auto_repay** | **bool** | Enable or disable automatic repayment for automatic borrow loan generated by cross margin order. Default is disabled. Note that: 1. This field is only effective for cross margin orders. Margin account does not support setting auto repayment for orders. 2. `auto_borrow` and `auto_repay` can be both set to true in one order | [optional] +**left** | **str** | Amount left to fill | [optional] [readonly] +**filled_amount** | **str** | Amount filled | [optional] [readonly] +**fill_price** | **str** | Total filled in quote currency. Deprecated in favor of `filled_total` | [optional] [readonly] +**filled_total** | **str** | Total filled in quote currency | [optional] [readonly] +**avg_deal_price** | **str** | Average fill price | [optional] [readonly] +**fee** | **str** | Fee deducted | [optional] [readonly] +**fee_currency** | **str** | Fee currency unit | [optional] [readonly] +**point_fee** | **str** | Points used to deduct fee | [optional] [readonly] +**gt_fee** | **str** | GT used to deduct fee | [optional] [readonly] +**gt_maker_fee** | **str** | GT amount used to deduct maker fee | [optional] [readonly] +**gt_taker_fee** | **str** | GT amount used to deduct taker fee | [optional] [readonly] +**gt_discount** | **bool** | Whether GT fee deduction is enabled | [optional] [readonly] +**rebated_fee** | **str** | Rebated fee | [optional] [readonly] +**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** | 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] +**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] + +[[Back to Model list]](../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 new file mode 100644 index 0000000..f5c838e --- /dev/null +++ b/docs/OrderPatch.md @@ -0,0 +1,16 @@ +# OrderPatch + +Spot order details +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency_pair** | **str** | Currency pair | [optional] +**account** | **str** | Specify query account | [optional] +**amount** | **str** | Trading quantity. Either `amount` or `price` must be specified | [optional] +**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] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OrderResp.md b/docs/OrderResp.md new file mode 100644 index 0000000..c89354c --- /dev/null +++ b/docs/OrderResp.md @@ -0,0 +1,10 @@ +# OrderResp + +## 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/PartnerCommissionHistory.md b/docs/PartnerCommissionHistory.md new file mode 100644 index 0000000..057575b --- /dev/null +++ b/docs/PartnerCommissionHistory.md @@ -0,0 +1,11 @@ +# PartnerCommissionHistory + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total** | **int** | Total | [optional] +**list** | [**list[AgencyCommission]**](AgencyCommission.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/PartnerSub.md b/docs/PartnerSub.md new file mode 100644 index 0000000..9337d3a --- /dev/null +++ b/docs/PartnerSub.md @@ -0,0 +1,12 @@ +# PartnerSub + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_id** | **int** | User ID | [optional] +**user_join_time** | **int** | Time when user joined the system, Unix timestamp in seconds | [optional] +**type** | **int** | Type (1-Sub-agent 2-Indirect direct customer 3-Direct direct customer) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PartnerSubList.md b/docs/PartnerSubList.md new file mode 100644 index 0000000..c77bc6f --- /dev/null +++ b/docs/PartnerSubList.md @@ -0,0 +1,11 @@ +# PartnerSubList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total** | **int** | Total | [optional] +**list** | [**list[PartnerSub]**](PartnerSub.md) | Subordinate 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/PartnerTransactionHistory.md b/docs/PartnerTransactionHistory.md new file mode 100644 index 0000000..707f40b --- /dev/null +++ b/docs/PartnerTransactionHistory.md @@ -0,0 +1,11 @@ +# PartnerTransactionHistory + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total** | **int** | Total | [optional] +**list** | [**list[AgencyTransaction]**](AgencyTransaction.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/PatchUniLend.md b/docs/PatchUniLend.md new file mode 100644 index 0000000..b622196 --- /dev/null +++ b/docs/PatchUniLend.md @@ -0,0 +1,11 @@ +# PatchUniLend + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **str** | Currency name | [optional] +**min_rate** | **str** | Minimum 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/PlaceDualInvestmentOrder.md b/docs/PlaceDualInvestmentOrder.md new file mode 100644 index 0000000..f957b47 --- /dev/null +++ b/docs/PlaceDualInvestmentOrder.md @@ -0,0 +1,13 @@ +# 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] + +[[Back to Model list]](../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 531c399..5c4065b 100644 --- a/docs/Position.md +++ b/docs/Position.md @@ -16,17 +16,28 @@ Name | Type | Description | Notes **entry_price** | **str** | Entry price | [optional] [readonly] **liq_price** | **str** | Liquidation price | [optional] [readonly] **mark_price** | **str** | Current mark price | [optional] [readonly] +**initial_margin** | **str** | The initial margin occupied by the position, applicable to the portfolio margin account | [optional] [readonly] +**maintenance_margin** | **str** | Maintenance margin required for the position, applicable to portfolio margin account | [optional] [readonly] **unrealised_pnl** | **str** | Unrealized PNL | [optional] [readonly] -**realised_pnl** | **str** | Realized PNL | [optional] [readonly] -**history_pnl** | **str** | History realized PNL | [optional] [readonly] +**realised_pnl** | **str** | Realized PnL | [optional] [readonly] +**pnl_pnl** | **str** | Realized PNL - Position P/L | [optional] [readonly] +**pnl_fund** | **str** | Realized PNL - Funding Fees | [optional] [readonly] +**pnl_fee** | **str** | Realized PNL - Transaction Fees | [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] -**adl_ranking** | **int** | ADL ranking, ranging from 1 to 5 | [optional] [readonly] -**pending_orders** | **int** | Current open orders | [optional] [readonly] +**adl_ranking** | **int** | Ranking of auto deleveraging, a total of 1-5 grades, `1` is the highest, `5` is the lowest, and `6` is the special case when there is no position held or in liquidation | [optional] [readonly] +**pending_orders** | **int** | Current pending order quantity | [optional] [readonly] **close_order** | [**PositionCloseOrder**](PositionCloseOrder.md) | | [optional] -**mode** | **str** | Position mode, including: - `single`: dual mode is not enabled- `dual_long`: long position in dual mode- `dual_short`: short position in dual mode | [optional] -**cross_leverage_limit** | **str** | Cross margin leverage(valid only when `leverage` is 0) | [optional] +**mode** | **str** | Position mode, including: - `single`: Single position mode - `dual_long`: Long position in dual position mode - `dual_short`: Short position in dual position mode | [optional] +**cross_leverage_limit** | **str** | Cross margin leverage (valid only when `leverage` is 0) | [optional] +**update_time** | **int** | Last update time | [optional] [readonly] +**update_id** | **int** | Update ID. The value increments by 1 each time the position is updated | [optional] [readonly] +**open_time** | **int** | First Open Time | [optional] +**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] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/PositionClose.md b/docs/PositionClose.md index 2573f6b..93bf9cf 100644 --- a/docs/PositionClose.md +++ b/docs/PositionClose.md @@ -5,9 +5,17 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **time** | **float** | Position close time | [optional] [readonly] **contract** | **str** | Futures contract | [optional] [readonly] -**side** | **str** | Position side, long or short | [optional] [readonly] -**pnl** | **str** | PNL | [optional] [readonly] -**text** | **str** | Text of close order | [optional] [readonly] +**side** | **str** | Position side - `long`: Long position - `short`: Short position | [optional] [readonly] +**pnl** | **str** | PnL | [optional] [readonly] +**pnl_pnl** | **str** | PNL - Position P/L | [optional] [readonly] +**pnl_fund** | **str** | PNL - Funding Fees | [optional] [readonly] +**pnl_fee** | **str** | PNL - Transaction Fees | [optional] [readonly] +**text** | **str** | Source of close order. See `order.text` field for specific values | [optional] [readonly] +**max_size** | **str** | Max Trade Size | [optional] [readonly] +**accum_size** | **str** | Cumulative closed position volume | [optional] [readonly] +**first_open_time** | **int** | First Open Time | [optional] [readonly] +**long_price** | **str** | When side is 'long', it indicates the opening average price; when side is 'short', it indicates the closing average price | [optional] [readonly] +**short_price** | **str** | When side is 'long', it indicates the closing average price; when side is 'short', it indicates the opening average price | [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/PositionCloseOrder.md b/docs/PositionCloseOrder.md index 6f5540d..20d1088 100644 --- a/docs/PositionCloseOrder.md +++ b/docs/PositionCloseOrder.md @@ -1,12 +1,12 @@ # PositionCloseOrder -Current close order if any, or `null` +Current close order information, or `null` if no close order ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **int** | Close order ID | [optional] -**price** | **str** | Close order price | [optional] -**is_liq** | **bool** | Is the close order from liquidation | [optional] +**id** | **int** | Order ID | [optional] +**price** | **str** | Order price | [optional] +**is_liq** | **bool** | Whether the close order is from liquidation | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ProfitLossRange.md b/docs/ProfitLossRange.md new file mode 100644 index 0000000..963c54a --- /dev/null +++ b/docs/ProfitLossRange.md @@ -0,0 +1,13 @@ +# ProfitLossRange + +Profit and loss range +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**price_percentage** | **str** | Percentage change in price | [optional] +**implied_volatility_percentage** | **str** | Percentage change in implied volatility | [optional] +**profit_loss** | **str** | 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/RebateApi.md b/docs/RebateApi.md new file mode 100644 index 0000000..f7e8f50 --- /dev/null +++ b/docs/RebateApi.md @@ -0,0 +1,694 @@ +# gate_api.RebateApi + +All URIs are relative to *https://api.gateio.ws/api/v4* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**agency_transaction_history**](RebateApi.md#agency_transaction_history) | **GET** /rebate/agency/transaction_history | Broker obtains transaction history of recommended users +[**agency_commissions_history**](RebateApi.md#agency_commissions_history) | **GET** /rebate/agency/commission_history | Broker obtains rebate history of recommended users +[**partner_transaction_history**](RebateApi.md#partner_transaction_history) | **GET** /rebate/partner/transaction_history | Partner obtains transaction history of recommended users +[**partner_commissions_history**](RebateApi.md#partner_commissions_history) | **GET** /rebate/partner/commission_history | Partner obtains rebate records of recommended users +[**partner_sub_list**](RebateApi.md#partner_sub_list) | **GET** /rebate/partner/sub_list | Partner subordinate list +[**rebate_broker_commission_history**](RebateApi.md#rebate_broker_commission_history) | **GET** /rebate/broker/commission_history | Broker obtains user's rebate records +[**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 + + +# **agency_transaction_history** +> list[AgencyTransactionHistory] agency_transaction_history(currency_pair=currency_pair, user_id=user_id, _from=_from, to=to, limit=limit, offset=offset) + +Broker obtains transaction history of recommended users + +Record query time range cannot exceed 30 days + +### 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) +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) +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) + +try: + # Broker obtains transaction history of recommended users + api_response = api_instance.agency_transaction_history(currency_pair=currency_pair, user_id=user_id, _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 RebateApi->agency_transaction_history: %s\n" % e) +``` + +### Parameters + +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] + **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] + +### Return type + +[**list[AgencyTransactionHistory]**](AgencyTransactionHistory.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) + +# **agency_commissions_history** +> list[AgencyCommissionHistory] agency_commissions_history(currency=currency, commission_type=commission_type, user_id=user_id, _from=_from, to=to, limit=limit, offset=offset) + +Broker obtains rebate history of recommended users + +Record query time range cannot exceed 30 days + +### 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) +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) +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) + +try: + # Broker obtains rebate history of recommended users + api_response = api_instance.agency_commissions_history(currency=currency, commission_type=commission_type, user_id=user_id, _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 RebateApi->agency_commissions_history: %s\n" % e) +``` + +### Parameters + +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] + **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] + +### Return type + +[**list[AgencyCommissionHistory]**](AgencyCommissionHistory.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) + +# **partner_transaction_history** +> PartnerTransactionHistory partner_transaction_history(currency_pair=currency_pair, user_id=user_id, _from=_from, to=to, limit=limit, offset=offset) + +Partner obtains transaction history of recommended users + +Record query time range cannot exceed 30 days + +### 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) +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) +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) + +try: + # Partner obtains transaction history of recommended users + api_response = api_instance.partner_transaction_history(currency_pair=currency_pair, user_id=user_id, _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 RebateApi->partner_transaction_history: %s\n" % e) +``` + +### Parameters + +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] + **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] + +### Return type + +[**PartnerTransactionHistory**](PartnerTransactionHistory.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) + +# **partner_commissions_history** +> PartnerCommissionHistory partner_commissions_history(currency=currency, user_id=user_id, _from=_from, to=to, limit=limit, offset=offset) + +Partner obtains rebate records of recommended users + +Record query time range cannot exceed 30 days + +### 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) +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) +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) + +try: + # Partner obtains rebate records of recommended users + api_response = api_instance.partner_commissions_history(currency=currency, user_id=user_id, _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 RebateApi->partner_commissions_history: %s\n" % e) +``` + +### Parameters + +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] + **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] + +### Return type + +[**PartnerCommissionHistory**](PartnerCommissionHistory.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) + +# **partner_sub_list** +> PartnerSubList partner_sub_list(user_id=user_id, limit=limit, offset=offset) + +Partner subordinate list + +Including sub-agents, direct customers, and indirect customers + +### 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) +user_id = 10003 # int | User ID. If not specified, all user records will be returned (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: + # Partner subordinate list + api_response = api_instance.partner_sub_list(user_id=user_id, 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 RebateApi->partner_sub_list: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user_id** | **int**| User ID. If not specified, all user records will be returned | [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 + +[**PartnerSubList**](PartnerSubList.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) + +# **rebate_broker_commission_history** +> list[BrokerCommission] rebate_broker_commission_history(limit=limit, offset=offset, user_id=user_id, _from=_from, to=to) + +Broker obtains user's rebate records + +Record query time range cannot exceed 30 days + +### 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) +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) +user_id = 10003 # int | User ID. If not specified, all user records will be returned (optional) +_from = 1711929600 # int | Start time of the query record. If not specified, defaults to 30 days before the current time (optional) +to = 1714521600 # int | End timestamp for the query, defaults to current time if not specified (optional) + +try: + # Broker obtains user's rebate records + api_response = api_instance.rebate_broker_commission_history(limit=limit, offset=offset, user_id=user_id, _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 RebateApi->rebate_broker_commission_history: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **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] + **user_id** | **int**| User ID. If not specified, all user records will be returned | [optional] + **_from** | **int**| Start time of the query record. If not specified, defaults to 30 days before the current time | [optional] + **to** | **int**| End timestamp for the query, defaults to current time if not specified | [optional] + +### Return type + +[**list[BrokerCommission]**](BrokerCommission.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) + +# **rebate_broker_transaction_history** +> list[BrokerTransaction] rebate_broker_transaction_history(limit=limit, offset=offset, user_id=user_id, _from=_from, to=to) + +Broker obtains user's trading history + +Record query time range cannot exceed 30 days + +### 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) +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) +user_id = 10003 # int | User ID. If not specified, all user records will be returned (optional) +_from = 1711929600 # int | Start time of the query record. If not specified, defaults to 30 days before the current time (optional) +to = 1714521600 # int | End timestamp for the query, defaults to current time if not specified (optional) + +try: + # Broker obtains user's trading history + api_response = api_instance.rebate_broker_transaction_history(limit=limit, offset=offset, user_id=user_id, _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 RebateApi->rebate_broker_transaction_history: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **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] + **user_id** | **int**| User ID. If not specified, all user records will be returned | [optional] + **_from** | **int**| Start time of the query record. If not specified, defaults to 30 days before the current time | [optional] + **to** | **int**| End timestamp for the query, defaults to current time if not specified | [optional] + +### Return type + +[**list[BrokerTransaction]**](BrokerTransaction.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) + +# **rebate_user_info** +> list[RebateUserInfo] rebate_user_info() + +User obtains rebate 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.RebateApi(api_client) + +try: + # User obtains rebate information + api_response = api_instance.rebate_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 RebateApi->rebate_user_info: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**list[RebateUserInfo]**](RebateUserInfo.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) + +# **user_sub_relation** +> UserSubRelation user_sub_relation(user_id_list) + +User subordinate relationship + +Query whether the specified user is within the system + +### 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) +user_id_list = '1, 2, 3' # str | Query user ID list, separated by commas. If more than 100, only 100 will be returned + +try: + # User subordinate relationship + api_response = api_instance.user_sub_relation(user_id_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 RebateApi->user_sub_relation: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user_id_list** | **str**| Query user ID list, separated by commas. If more than 100, only 100 will be returned | + +### Return type + +[**UserSubRelation**](UserSubRelation.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) + diff --git a/docs/RebateUserInfo.md b/docs/RebateUserInfo.md new file mode 100644 index 0000000..0f97b11 --- /dev/null +++ b/docs/RebateUserInfo.md @@ -0,0 +1,11 @@ +# RebateUserInfo + +Retrieve user rebate information +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**invite_uid** | **int** | My inviter's UID | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RepayCurrencyRes.md b/docs/RepayCurrencyRes.md new file mode 100644 index 0000000..9715d48 --- /dev/null +++ b/docs/RepayCurrencyRes.md @@ -0,0 +1,15 @@ +# RepayCurrencyRes + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**succeeded** | **bool** | Whether the repayment was successful | [optional] +**label** | **str** | Error identifier for failed operations; empty when successful | [optional] +**message** | **str** | Error description for failed operations; empty when successful | [optional] +**currency** | **str** | Repayment currency | [optional] +**repaid_principal** | **str** | Principal | [optional] +**repaid_interest** | **str** | Principal | [optional] + +[[Back to Model list]](../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 new file mode 100644 index 0000000..92c8463 --- /dev/null +++ b/docs/RepayLoan.md @@ -0,0 +1,13 @@ +# 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/RepayMultiLoan.md b/docs/RepayMultiLoan.md new file mode 100644 index 0000000..eb1c0ab --- /dev/null +++ b/docs/RepayMultiLoan.md @@ -0,0 +1,12 @@ +# RepayMultiLoan + +Multi-currency collateral repayment +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**order_id** | **int** | Order ID | +**repay_items** | [**list[MultiLoanRepayItem]**](MultiLoanRepayItem.md) | Repay Currency Item | + +[[Back to Model list]](../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 new file mode 100644 index 0000000..a9cf6cf --- /dev/null +++ b/docs/RepayRecord.md @@ -0,0 +1,23 @@ +# 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/RepayRecordCurrency.md b/docs/RepayRecordCurrency.md new file mode 100644 index 0000000..d8a1c90 --- /dev/null +++ b/docs/RepayRecordCurrency.md @@ -0,0 +1,15 @@ +# RepayRecordCurrency + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **str** | Currency | [optional] +**index_price** | **str** | Currency Index Price | [optional] +**before_amount** | **str** | Amount before the operation | [optional] +**before_amount_usdt** | **str** | USDT Amount before the operation | [optional] +**after_amount** | **str** | Amount after the operation | [optional] +**after_amount_usdt** | **str** | USDT Amount after the operation | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RepayRecordLeftInterest.md b/docs/RepayRecordLeftInterest.md new file mode 100644 index 0000000..79ca1d9 --- /dev/null +++ b/docs/RepayRecordLeftInterest.md @@ -0,0 +1,15 @@ +# RepayRecordLeftInterest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **str** | Currency | [optional] +**index_price** | **str** | Currency Index Price | [optional] +**before_amount** | **str** | Interest amount before repayment | [optional] +**before_amount_usdt** | **str** | Converted value of interest before repayment in USDT | [optional] +**after_amount** | **str** | Interest amount after repayment | [optional] +**after_amount_usdt** | **str** | Converted value of interest after repayment 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/RepayRecordRepaidCurrency.md b/docs/RepayRecordRepaidCurrency.md new file mode 100644 index 0000000..b49320d --- /dev/null +++ b/docs/RepayRecordRepaidCurrency.md @@ -0,0 +1,15 @@ +# RepayRecordRepaidCurrency + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **str** | Repayment currency | [optional] +**index_price** | **str** | Currency Index Price | [optional] +**repaid_amount** | **str** | Repayment amount | [optional] +**repaid_principal** | **str** | Principal | [optional] +**repaid_interest** | **str** | Interest | [optional] +**repaid_amount_usdt** | **str** | Repayment amount 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/RepayRecordTotalInterest.md b/docs/RepayRecordTotalInterest.md new file mode 100644 index 0000000..8c7a2cc --- /dev/null +++ b/docs/RepayRecordTotalInterest.md @@ -0,0 +1,13 @@ +# RepayRecordTotalInterest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **str** | Currency | [optional] +**index_price** | **str** | Currency Index Price | [optional] +**amount** | **str** | Interest Amount | [optional] +**amount_usdt** | **str** | Interest amount 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/RepayRequest.md b/docs/RepayRequest.md deleted file mode 100644 index 6663e18..0000000 --- a/docs/RepayRequest.md +++ /dev/null @@ -1,13 +0,0 @@ -# RepayRequest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**currency_pair** | **str** | Currency pair | -**currency** | **str** | Loan currency | -**mode** | **str** | Repay mode. all - repay all; partial - repay only some portion | -**amount** | **str** | Repay amount. Required in `partial` 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/RepayResp.md b/docs/RepayResp.md new file mode 100644 index 0000000..f7124e3 --- /dev/null +++ b/docs/RepayResp.md @@ -0,0 +1,12 @@ +# RepayResp + +Repay +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**repaid_principal** | **str** | Principal | [optional] +**repaid_interest** | **str** | 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/Repayment.md b/docs/Repayment.md deleted file mode 100644 index a46c5c5..0000000 --- a/docs/Repayment.md +++ /dev/null @@ -1,13 +0,0 @@ -# Repayment - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **str** | Loan record ID | [optional] -**create_time** | **str** | Repayment time | [optional] -**principal** | **str** | Repaid principal | [optional] -**interest** | **str** | Repaid 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/RiskUnits.md b/docs/RiskUnits.md new file mode 100644 index 0000000..dcff46e --- /dev/null +++ b/docs/RiskUnits.md @@ -0,0 +1,17 @@ +# RiskUnits + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**symbol** | **str** | Risk unit flag | [optional] +**spot_in_use** | **str** | Spot hedging occupied amount | [optional] +**maintain_margin** | **str** | Maintenance margin for risk unit | [optional] +**initial_margin** | **str** | Initial margin for risk unit | [optional] +**delta** | **str** | Total Delta of risk unit | [optional] +**gamma** | **str** | Total Gamma of risk unit | [optional] +**theta** | **str** | Total Theta of risk unit | [optional] +**vega** | **str** | Total Vega of risk unit | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SavedAddress.md b/docs/SavedAddress.md new file mode 100644 index 0000000..117d52d --- /dev/null +++ b/docs/SavedAddress.md @@ -0,0 +1,15 @@ +# SavedAddress + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **str** | Currency | [optional] +**chain** | **str** | Chain name | [optional] +**address** | **str** | Address | [optional] +**name** | **str** | Name | [optional] +**tag** | **str** | Tag | [optional] +**verified** | **str** | Whether to pass the verification 0-unverified, 1-verified | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SmallBalance.md b/docs/SmallBalance.md new file mode 100644 index 0000000..7302d38 --- /dev/null +++ b/docs/SmallBalance.md @@ -0,0 +1,14 @@ +# SmallBalance + +Small Balance Conversion +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **str** | Currency | [optional] +**available_balance** | **str** | Available balance | [optional] +**estimated_as_btc** | **str** | Estimated as BTC | [optional] +**convertible_to_gt** | **str** | Estimated conversion to GT | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SmallBalanceHistory.md b/docs/SmallBalanceHistory.md new file mode 100644 index 0000000..5a5f5b0 --- /dev/null +++ b/docs/SmallBalanceHistory.md @@ -0,0 +1,15 @@ +# SmallBalanceHistory + +Small Balance Conversion +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Order ID | [optional] [readonly] +**currency** | **str** | Currency | [optional] [readonly] +**amount** | **str** | Swap Amount | [optional] [readonly] +**gt_amount** | **str** | GT amount | [optional] [readonly] +**create_time** | **int** | Exchange time (in seconds) | [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/SpotAccount.md b/docs/SpotAccount.md index c6c6a66..6bb761e 100644 --- a/docs/SpotAccount.md +++ b/docs/SpotAccount.md @@ -6,6 +6,7 @@ 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/CrossMarginAccountBook.md b/docs/SpotAccountBook.md similarity index 61% rename from docs/CrossMarginAccountBook.md rename to docs/SpotAccountBook.md index 18aa316..80d34cb 100644 --- a/docs/CrossMarginAccountBook.md +++ b/docs/SpotAccountBook.md @@ -1,4 +1,4 @@ -# CrossMarginAccountBook +# SpotAccountBook ## Properties Name | Type | Description | Notes @@ -8,7 +8,9 @@ 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 change type, including: - in: transferals into cross margin account - out: transferals out from cross margin account - repay: loan repayment - borrow: borrowed loan - new_order: new order locked - order_fill: order fills - referral_fee: fee refund from referrals - order_fee: order fee generated from fills - unknown: unknown type | [optional] +**type** | **str** | Account book type. Please refer to [account book type](#accountbook-type) for more detail | [optional] +**code** | **str** | Account change code, see [Asset Record Code] (Asset Record Code) | [optional] +**text** | **str** | Additional 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/SpotApi.md b/docs/SpotApi.md index f8afc34..9b2c765 100644 --- a/docs/SpotApi.md +++ b/docs/SpotApi.md @@ -4,36 +4,46 @@ All URIs are relative to *https://api.gateio.ws/api/v4* Method | HTTP request | Description ------------- | ------------- | ------------- -[**list_currencies**](SpotApi.md#list_currencies) | **GET** /spot/currencies | List all currencies' details -[**get_currency**](SpotApi.md#get_currency) | **GET** /spot/currencies/{currency} | Get details of a specific currency -[**list_currency_pairs**](SpotApi.md#list_currency_pairs) | **GET** /spot/currency_pairs | List all currency pairs supported -[**get_currency_pair**](SpotApi.md#get_currency_pair) | **GET** /spot/currency_pairs/{currency_pair} | Get details of a specifc order -[**list_tickers**](SpotApi.md#list_tickers) | **GET** /spot/tickers | Retrieve ticker information -[**list_order_book**](SpotApi.md#list_order_book) | **GET** /spot/order_book | Retrieve order book -[**list_trades**](SpotApi.md#list_trades) | **GET** /spot/trades | Retrieve market trades -[**list_candlesticks**](SpotApi.md#list_candlesticks) | **GET** /spot/candlesticks | Market candlesticks -[**get_fee**](SpotApi.md#get_fee) | **GET** /spot/fee | Query user trading fee rates -[**list_spot_accounts**](SpotApi.md#list_spot_accounts) | **GET** /spot/accounts | List spot accounts -[**create_batch_orders**](SpotApi.md#create_batch_orders) | **POST** /spot/batch_orders | Create a batch of orders +[**list_currencies**](SpotApi.md#list_currencies) | **GET** /spot/currencies | Query all currency information +[**get_currency**](SpotApi.md#get_currency) | **GET** /spot/currencies/{currency} | Query single currency information +[**list_currency_pairs**](SpotApi.md#list_currency_pairs) | **GET** /spot/currency_pairs | Query all supported currency pairs +[**get_currency_pair**](SpotApi.md#get_currency_pair) | **GET** /spot/currency_pairs/{currency_pair} | Query single currency pair details +[**list_tickers**](SpotApi.md#list_tickers) | **GET** /spot/tickers | Get currency pair ticker information +[**list_order_book**](SpotApi.md#list_order_book) | **GET** /spot/order_book | Get market depth information +[**list_trades**](SpotApi.md#list_trades) | **GET** /spot/trades | Query market transaction records +[**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 [**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 a batch of orders with an ID list -[**get_order**](SpotApi.md#get_order) | **GET** /spot/orders/{order_id} | Get a single order -[**cancel_order**](SpotApi.md#cancel_order) | **DELETE** /spot/orders/{order_id} | Cancel a single order -[**list_my_trades**](SpotApi.md#list_my_trades) | **GET** /spot/my_trades | List personal trading history -[**list_spot_price_triggered_orders**](SpotApi.md#list_spot_price_triggered_orders) | **GET** /spot/price_orders | Retrieve running auto order list -[**create_spot_price_triggered_order**](SpotApi.md#create_spot_price_triggered_order) | **POST** /spot/price_orders | Create a price-triggered order -[**cancel_spot_price_triggered_order_list**](SpotApi.md#cancel_spot_price_triggered_order_list) | **DELETE** /spot/price_orders | Cancel all open orders -[**get_spot_price_triggered_order**](SpotApi.md#get_spot_price_triggered_order) | **GET** /spot/price_orders/{order_id} | Get a single order -[**cancel_spot_price_triggered_order**](SpotApi.md#cancel_spot_price_triggered_order) | **DELETE** /spot/price_orders/{order_id} | Cancel a single order +[**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 +[**cancel_order**](SpotApi.md#cancel_order) | **DELETE** /spot/orders/{order_id} | Cancel single order +[**amend_order**](SpotApi.md#amend_order) | **PATCH** /spot/orders/{order_id} | Amend single order +[**list_my_trades**](SpotApi.md#list_my_trades) | **GET** /spot/my_trades | Query personal trading records +[**get_system_time**](SpotApi.md#get_system_time) | **GET** /spot/time | Get server current time +[**countdown_cancel_all_spot**](SpotApi.md#countdown_cancel_all_spot) | **POST** /spot/countdown_cancel_all | Countdown cancel orders +[**amend_batch_orders**](SpotApi.md#amend_batch_orders) | **POST** /spot/amend_batch_orders | Batch modification of orders +[**get_spot_insurance_history**](SpotApi.md#get_spot_insurance_history) | **GET** /spot/insurance_history | Query spot insurance fund historical data +[**list_spot_price_triggered_orders**](SpotApi.md#list_spot_price_triggered_orders) | **GET** /spot/price_orders | Query running auto order list +[**create_spot_price_triggered_order**](SpotApi.md#create_spot_price_triggered_order) | **POST** /spot/price_orders | Create price-triggered order +[**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_currencies** > list[Currency] list_currencies() -List all currencies' details +Query all currency information + +When a currency corresponds to multiple chains, you can query the information of multiple chains through the `chains` field, such as the charging and recharge status, identification, etc. of the chain ### Example @@ -52,7 +62,7 @@ api_client = gate_api.ApiClient(configuration) api_instance = gate_api.SpotApi(api_client) try: - # List all currencies' details + # Query all currency information api_response = api_instance.list_currencies() print(api_response) except GateApiException as ex: @@ -80,14 +90,14 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**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_currency** > Currency get_currency(currency) -Get details of a specific currency +Query single currency information ### Example @@ -107,7 +117,7 @@ api_instance = gate_api.SpotApi(api_client) currency = 'GT' # str | Currency name try: - # Get details of a specific currency + # Query single currency information api_response = api_instance.get_currency(currency) print(api_response) except GateApiException as ex: @@ -138,14 +148,14 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**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_currency_pairs** > list[CurrencyPair] list_currency_pairs() -List all currency pairs supported +Query all supported currency pairs ### Example @@ -164,7 +174,7 @@ api_client = gate_api.ApiClient(configuration) api_instance = gate_api.SpotApi(api_client) try: - # List all currency pairs supported + # Query all supported currency pairs api_response = api_instance.list_currency_pairs() print(api_response) except GateApiException as ex: @@ -199,7 +209,7 @@ No authorization required # **get_currency_pair** > CurrencyPair get_currency_pair(currency_pair) -Get details of a specifc order +Query single currency pair details ### Example @@ -219,7 +229,7 @@ api_instance = gate_api.SpotApi(api_client) currency_pair = 'ETH_BTC' # str | Currency pair try: - # Get details of a specifc order + # Query single currency pair details api_response = api_instance.get_currency_pair(currency_pair) print(api_response) except GateApiException as ex: @@ -250,16 +260,16 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**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_tickers** -> list[Ticker] list_tickers(currency_pair=currency_pair) +> list[Ticker] list_tickers(currency_pair=currency_pair, timezone=timezone) -Retrieve ticker information +Get currency pair ticker information -Return only related data if `currency_pair` is specified; otherwise return all of them +If `currency_pair` is specified, only query that currency pair; otherwise return all information ### Example @@ -277,10 +287,11 @@ 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) +timezone = 'utc0' # str | Timezone (optional) try: - # Retrieve ticker information - api_response = api_instance.list_tickers(currency_pair=currency_pair) + # Get currency pair ticker information + api_response = api_instance.list_tickers(currency_pair=currency_pair, timezone=timezone) print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) @@ -293,6 +304,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **currency_pair** | **str**| Currency pair | [optional] + **timezone** | **str**| Timezone | [optional] ### Return type @@ -310,16 +322,16 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**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_order_book** > OrderBook list_order_book(currency_pair, interval=interval, limit=limit, with_id=with_id) -Retrieve order book +Get market depth information -Order book will be sorted by price from high to low on bids; low to high on asks +Market depth buy orders are sorted by price from high to low, sell orders are sorted from low to high ### Example @@ -337,12 +349,12 @@ 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 | Order depth. 0 means no aggregation is applied. default to 0 (optional) (default to '0') -limit = 10 # int | Maximum number of order depth data in asks or bids (optional) (default to 10) -with_id = False # bool | Return order book ID (optional) (default to False) +interval = '0' # str | Price precision for depth aggregation, 0 means no aggregation, defaults to 0 if not specified (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) try: - # Retrieve order book + # Get market depth information api_response = api_instance.list_order_book(currency_pair, interval=interval, limit=limit, with_id=with_id) print(api_response) except GateApiException as ex: @@ -356,9 +368,9 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **currency_pair** | **str**| Currency pair | - **interval** | **str**| Order depth. 0 means no aggregation is applied. default to 0 | [optional] [default to '0'] - **limit** | **int**| Maximum number of order depth data in asks or bids | [optional] [default to 10] - **with_id** | **bool**| Return order book ID | [optional] [default to False] + **interval** | **str**| Price precision for depth aggregation, 0 means no aggregation, defaults to 0 if not specified | [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] ### Return type @@ -376,16 +388,16 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**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_trades** > list[Trade] list_trades(currency_pair, limit=limit, last_id=last_id, reverse=reverse, _from=_from, to=to, page=page) -Retrieve market trades +Query market transaction records -You can use `from` and `to` to query by time range, or use `last_id` by scrolling page. The default behavior is by time range. Scrolling query using `last_id` is not recommended any more. If `last_id` is specified, time range query parameters will be ignored. +Supports querying by time range using `from` and `to` parameters or pagination based on `last_id`. By default, queries the last 30 days. Pagination based on `last_id` is no longer recommended. If `last_id` is specified, the time range query parameters will be ignored. When using limit&page pagination to retrieve data, the maximum number of pages is 100,000, that is, limit * (page - 1) <= 100,000. ### Example @@ -403,15 +415,15 @@ 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 -limit = 100 # int | Maximum number of records to be returned in a single list (optional) (default to 100) -last_id = '12345' # str | Specify list staring point using the `id` of last record in previous list-query results (optional) -reverse = False # bool | Whether the id of records to be retrieved should be smaller than the last_id specified- true: Retrieve records where id is smaller than the specified last_id- false: Retrieve records where id is larger than the specified last_idDefault to false. When `last_id` is specified. Set `reverse` to `true` to trace back trading history; `false` to retrieve latest tradings. No effect if `last_id` is not specified. (optional) (default to False) -_from = 1627706330 # int | Start timestamp of the query (optional) -to = 1635329650 # int | Time range ending, default to current time (optional) +limit = 100 # int | Maximum number of items returned in list. Default: 100, minimum: 1, maximum: 1000 (optional) (default to 100) +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) +reverse = False # bool | Whether to retrieve data less than `last_id`. Default returns records greater than `last_id`. Set to `true` to trace back market trade records, `false` to get latest trades. No effect when `last_id` is not set. (optional) (default to False) +_from = 1627706330 # int | Start timestamp for the query (optional) +to = 1635329650 # int | End timestamp for the query, defaults to current time if not specified (optional) page = 1 # int | Page number (optional) (default to 1) try: - # Retrieve market trades + # Query market transaction records api_response = api_instance.list_trades(currency_pair, limit=limit, last_id=last_id, reverse=reverse, _from=_from, to=to, page=page) print(api_response) except GateApiException as ex: @@ -425,11 +437,11 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **currency_pair** | **str**| Currency pair | - **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] - **last_id** | **str**| Specify list staring point using the `id` of last record in previous list-query results | [optional] - **reverse** | **bool**| Whether the id of records to be retrieved should be smaller than the last_id specified- true: Retrieve records where id is smaller than the specified last_id- false: Retrieve records where id is larger than the specified last_idDefault to false. When `last_id` is specified. Set `reverse` to `true` to trace back trading history; `false` to retrieve latest tradings. No effect if `last_id` is not specified. | [optional] [default to False] - **_from** | **int**| Start timestamp of the query | [optional] - **to** | **int**| Time range ending, default to current time | [optional] + **limit** | **int**| Maximum number of items returned in list. Default: 100, minimum: 1, maximum: 1000 | [optional] [default to 100] + **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] + **reverse** | **bool**| Whether to retrieve data less than `last_id`. Default returns records greater than `last_id`. Set to `true` to trace back market trade records, `false` to get latest trades. No effect when `last_id` is not set. | [optional] [default to False] + **_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] [default to 1] ### Return type @@ -448,14 +460,14 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**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_candlesticks** > list[list[str]] list_candlesticks(currency_pair, limit=limit, _from=_from, to=to, interval=interval) -Market candlesticks +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 @@ -475,13 +487,13 @@ 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 -limit = 100 # int | Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional) (default to 100) +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) _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 | End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time (optional) -interval = '30m' # str | Interval time between data points (optional) (default to '30m') +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) +interval = '30m' # str | Time interval between data points. Note that `30d` represents a calendar month, not aligned to 30 days (optional) (default to '30m') try: - # Market candlesticks + # Market K-line chart api_response = api_instance.list_candlesticks(currency_pair, limit=limit, _from=_from, to=to, interval=interval) print(api_response) except GateApiException as ex: @@ -495,10 +507,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **currency_pair** | **str**| Currency pair | - **limit** | **int**| Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. | [optional] [default to 100] + **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] **_from** | **int**| Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified | [optional] - **to** | **int**| End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time | [optional] - **interval** | **str**| Interval time between data points | [optional] [default to '30m'] + **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] + **interval** | **str**| Time interval between data points. Note that `30d` represents a calendar month, not aligned to 30 days | [optional] [default to '30m'] ### Return type @@ -516,16 +528,16 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**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_fee** -> TradeFee get_fee(currency_pair=currency_pair) +> SpotFee get_fee(currency_pair=currency_pair) -Query user trading fee rates +Query account fee rates -This API is deprecated in favour of new fee retrieving API `/wallet/fee`. +This API is deprecated. The new fee query API is `/wallet/fee` ### Example @@ -551,10 +563,10 @@ configuration = gate_api.Configuration( 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 | Specify a currency pair to retrieve precise fee rate This field is optional. In most cases, the fee rate is identical among all currency pairs (optional) +currency_pair = 'BTC_USDT' # str | Specify currency pair to get more accurate fee settings. This field is optional. Usually fee settings are the same for all currency pairs. (optional) try: - # Query user trading fee rates + # Query account fee rates api_response = api_instance.get_fee(currency_pair=currency_pair) print(api_response) except GateApiException as ex: @@ -567,11 +579,78 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **currency_pair** | **str**| Specify a currency pair to retrieve precise fee rate This field is optional. In most cases, the fee rate is identical among all currency pairs | [optional] + **currency_pair** | **str**| Specify currency pair to get more accurate fee settings. This field is optional. Usually fee settings are the same for all currency pairs. | [optional] + +### Return type + +[**SpotFee**](SpotFee.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_batch_spot_fee** +> dict(str, SpotFee) get_batch_spot_fee(currency_pairs) + +Batch query account 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.SpotApi(api_client) +currency_pairs = 'BTC_USDT,ETH_USDT' # str | Maximum 50 currency pairs per request + +try: + # Batch query account fee rates + api_response = api_instance.get_batch_spot_fee(currency_pairs) + 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_batch_spot_fee: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currency_pairs** | **str**| Maximum 50 currency pairs per request | ### Return type -[**TradeFee**](TradeFee.md) +[**dict(str, SpotFee)**](SpotFee.md) ### Authorization @@ -585,14 +664,14 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**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_spot_accounts** > list[SpotAccount] list_spot_accounts(currency=currency) -List spot accounts +List spot trading accounts ### Example @@ -618,10 +697,10 @@ configuration = gate_api.Configuration( api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.SpotApi(api_client) -currency = 'BTC' # str | Retrieve data of the specified currency (optional) +currency = 'BTC' # str | Query by specified currency name (optional) try: - # List spot accounts + # List spot trading accounts api_response = api_instance.list_spot_accounts(currency=currency) print(api_response) except GateApiException as ex: @@ -634,7 +713,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **currency** | **str**| Retrieve data of the specified currency | [optional] + **currency** | **str**| Query by specified currency name | [optional] ### Return type @@ -652,16 +731,97 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**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) + +Query spot account transaction history + +Record query time range cannot exceed 30 days. When using limit&page pagination to retrieve data, the maximum number of pages is 100,000, that is, limit * (page - 1) <= 100,000. + +### 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) +_from = 1627706330 # int | Start timestamp for the query (optional) +to = 1635329650 # int | End timestamp for the query, defaults to current time if not specified (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) +type = 'lend' # str | Query by specified account change type. If not specified, all change types will be included. (optional) +code = 'code_example' # str | Specify account change code for query. If not specified, all change types are included. This parameter has higher priority than `type` (optional) + +try: + # Query spot account transaction history + api_response = api_instance.list_spot_account_book(currency=currency, _from=_from, to=to, page=page, limit=limit, type=type, code=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 SpotApi->list_spot_account_book: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currency** | **str**| Query by specified currency name | [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] [default to 1] + **limit** | **int**| Maximum number of records returned in a single list | [optional] [default to 100] + **type** | **str**| Query by specified account change type. If not specified, all change types will be included. | [optional] + **code** | **str**| Specify account change code for query. If not specified, all change types are included. This parameter has higher priority than `type` | [optional] + +### Return type + +[**list[SpotAccountBook]**](SpotAccountBook.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) # **create_batch_orders** -> list[BatchOrder] create_batch_orders(order) +> list[BatchOrder] create_batch_orders(order, x_gate_exptime=x_gate_exptime) -Create a batch of orders +Batch place orders -Batch orders requirements: 1. custom order field `text` is required 2. At most 4 currency pairs, maximum 10 orders each, are allowed in one request 3. No mixture of spot orders and margin orders, i.e. `account` must be identical for all orders +Batch order requirements: 1. Custom order field `text` must be specified 2. Up to 4 currency pairs per request, with up to 10 orders per currency pair 3. Spot orders and margin orders cannot be mixed; all `account` fields in the same request must be identical ### Example @@ -688,10 +848,11 @@ api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.SpotApi(api_client) order = [gate_api.Order()] # list[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 a batch of orders - api_response = api_instance.create_batch_orders(order) + # Batch place orders + api_response = api_instance.create_batch_orders(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)) @@ -704,6 +865,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **order** | [**list[Order]**](Order.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 @@ -721,7 +883,7 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Request is completed | - | +**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) @@ -730,7 +892,7 @@ Name | Type | Description | Notes List all open orders -List open orders in all currency pairs. Note that pagination parameters affect record number in each currency pair's open order list. No pagination is applied to the number of currency pairs returned. All currency pairs with open orders will be returned. Spot and margin orders are returned by default. To list cross margin orders, `account` must be set to `cross_margin` +Query the current order list of all trading pairs. Please note that the paging parameter controls the number of pending orders in each trading pair. There is no paging control trading pairs. All trading pairs with pending orders will be returned. ### Example @@ -758,7 +920,7 @@ api_client = gate_api.ApiClient(configuration) api_instance = gate_api.SpotApi(api_client) page = 1 # int | Page number (optional) (default to 1) limit = 100 # int | Maximum number of records returned in one page in each currency pair (optional) (default to 100) -account = 'cross_margin' # str | Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) +account = 'spot' # str | Specify query account (optional) try: # List all open orders @@ -776,7 +938,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **page** | **int**| Page number | [optional] [default to 1] **limit** | **int**| Maximum number of records returned in one page in each currency pair | [optional] [default to 100] - **account** | **str**| Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account | [optional] + **account** | **str**| Specify query account | [optional] ### Return type @@ -794,7 +956,76 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**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) + +# **create_cross_liquidate_order** +> Order create_cross_liquidate_order(liquidate_order) + +Close position when cross-currency is disabled + +Currently, only cross-margin accounts are supported to place buy orders for disabled currencies. Maximum buy quantity = (unpaid principal and interest - currency balance - the amount of the currency in pending orders) / 0.998 + +### 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) +liquidate_order = gate_api.LiquidateOrder() # LiquidateOrder | + +try: + # Close position when cross-currency is disabled + api_response = api_instance.create_cross_liquidate_order(liquidate_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 SpotApi->create_cross_liquidate_order: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **liquidate_order** | [**LiquidateOrder**](LiquidateOrder.md)| | + +### Return type + +[**Order**](Order.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) @@ -803,7 +1034,7 @@ Name | Type | Description | Notes List orders -Spot and margin orders are returned by default. If cross margin orders are needed, `account` must be set to `cross_margin` When `status` is `open`, i.e., listing open orders, only pagination parameters `page` and `limit` are supported and `limit` cannot be larger than 100. Query by `side` and time range parameters `from` and `to` are not supported. When `status` is `finished`, i.e., listing finished orders, pagination parameters, time range parameters `from` and `to`, and `side` parameters are all supported. Time range parameters are handled as order finish time. +Note that query results default to spot order lists for spot, unified account, and isolated margin accounts. When `status` is set to `open` (i.e., when querying pending order lists), only `page` and `limit` pagination controls are supported. `limit` can only be set to a maximum of 100. The `side` parameter and time range query parameters `from` and `to` are not supported. When `status` is set to `finished` (i.e., when querying historical orders), in addition to pagination queries, `from` and `to` time range queries are also supported. Additionally, the `side` parameter can be set to filter one-sided history. Time range filter parameters are processed according to the order end time. ### Example @@ -829,14 +1060,14 @@ configuration = gate_api.Configuration( 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 | Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones. +currency_pair = 'BTC_USDT' # str | Query by specified currency pair. Required for open orders, optional for filled orders status = 'open' # str | List orders based on status `open` - order is waiting to be filled `finished` - order has been filled or cancelled page = 1 # int | Page number (optional) (default to 1) limit = 100 # int | Maximum number of records to be returned. If `status` is `open`, maximum of `limit` is 100 (optional) (default to 100) -account = 'cross_margin' # str | Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) -_from = 1627706330 # int | Start timestamp of the query (optional) -to = 1635329650 # int | Time range ending, default to current time (optional) -side = 'sell' # str | All bids or asks. Both included if not specified (optional) +account = 'spot' # str | Specify query account (optional) +_from = 1627706330 # int | Start timestamp for the query (optional) +to = 1635329650 # int | End timestamp for the query, defaults to current time if not specified (optional) +side = 'sell' # str | Specify all bids or all asks, both included if not specified (optional) try: # List orders @@ -852,14 +1083,14 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **currency_pair** | **str**| Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones. | + **currency_pair** | **str**| Query by specified currency pair. Required for open orders, optional for filled orders | **status** | **str**| List orders based on status `open` - order is waiting to be filled `finished` - order has been filled or cancelled | **page** | **int**| Page number | [optional] [default to 1] **limit** | **int**| Maximum number of records to be returned. If `status` is `open`, maximum of `limit` is 100 | [optional] [default to 100] - **account** | **str**| Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account | [optional] - **_from** | **int**| Start timestamp of the query | [optional] - **to** | **int**| Time range ending, default to current time | [optional] - **side** | **str**| All bids or asks. Both included if not specified | [optional] + **account** | **str**| Specify query account | [optional] + **_from** | **int**| Start timestamp for the query | [optional] + **to** | **int**| End timestamp for the query, defaults to current time if not specified | [optional] + **side** | **str**| Specify all bids or all asks, both included if not specified | [optional] ### Return type @@ -877,16 +1108,16 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**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) # **create_order** -> Order create_order(order) +> Order create_order(order, x_gate_exptime=x_gate_exptime) Create an order -You can place orders with spot, margin or cross margin account through setting the `account `field. It defaults to `spot`, which means spot account is used to place orders. When margin account is used, i.e., `account` is `margin`, `auto_borrow` field can be set to `true` to enable the server to borrow the amount lacked using `POST /margin/loans` when your account's balance is not enough. Whether margin orders' fill will be used to repay margin loans automatically is determined by the auto repayment setting in your **margin account**, which can be updated or queried using `/margin/auto_repay` API. When cross margin account is used, i.e., `account` is `cross_margin`, `auto_borrow` can also be enabled to achieve borrowing the insufficient amount automatically if cross account's balance is not enough. But it differs from margin account that automatic repayment is determined by order's `auto_repay` field and only current order's fill will be used to repay cross margin loans. Automatic repayment will be triggered when the order is finished, i.e., its status is either `cancelled` or `closed`. **Order status** An order waiting to be filled is `open`, and it stays `open` until it is filled totally. If fully filled, order is finished and its status turns to `closed`.If the order is cancelled before it is totally filled, whether or not partially filled, its status is `cancelled`. **Iceberg order** `iceberg` field can be used to set the amount shown. Set to `-1` to hide the order completely. Note that the hidden part's fee will be charged using taker's fee rate. +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 ### Example @@ -913,10 +1144,11 @@ api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.SpotApi(api_client) 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 - api_response = api_instance.create_order(order) + api_response = api_instance.create_order(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)) @@ -929,6 +1161,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **order** | [**Order**](Order.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 @@ -946,16 +1179,16 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**201** | Order created. | - | +**201** | Order created | - | [[Back to top]](#) [[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_orders** -> list[Order] cancel_orders(currency_pair, side=side, account=account) +> list[OrderCancel] cancel_orders(currency_pair=currency_pair, side=side, account=account, action_mode=action_mode, x_gate_exptime=x_gate_exptime) Cancel all `open` orders in specified currency pair -If `account` is not set, all open orders, including spot, margin and cross margin ones, will be cancelled. You can set `account` to cancel only orders within the specified account +When the `account` parameter is not specified, all pending orders including spot, unified account, and isolated margin will be cancelled. When `currency_pair` is not specified, all trading pair pending orders will be cancelled. You can specify a particular account to cancel all pending orders under that account ### Example @@ -981,13 +1214,15 @@ configuration = gate_api.Configuration( 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 -side = 'sell' # str | All bids or asks. Both included if not specified (optional) -account = 'spot' # str | Specify account type. Default to all account types being included (optional) +currency_pair = 'BTC_USDT' # str | Currency pair (optional) +side = 'sell' # str | Specify all bids or all asks, both included if not specified (optional) +account = 'spot' # str | Specify account type Classic account: All are included if not specified Unified account: Specify `unified` (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) +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 all `open` orders in specified currency pair - api_response = api_instance.cancel_orders(currency_pair, side=side, account=account) + api_response = api_instance.cancel_orders(currency_pair=currency_pair, side=side, account=account, action_mode=action_mode, 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)) @@ -999,13 +1234,15 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **currency_pair** | **str**| Currency pair | - **side** | **str**| All bids or asks. Both included if not specified | [optional] - **account** | **str**| Specify account type. Default to all account types being included | [optional] + **currency_pair** | **str**| Currency pair | [optional] + **side** | **str**| Specify all bids or all asks, both included if not specified | [optional] + **account** | **str**| Specify account type Classic account: All are included if not specified Unified account: Specify `unified` | [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] + **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[Order]**](Order.md) +[**list[OrderCancel]**](OrderCancel.md) ### Authorization @@ -1019,14 +1256,14 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Batch cancellation request accepted. Query order status by listing orders | - | +**200** | Batch cancellation request accepted and processed, success determined by 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) # **cancel_batch_orders** -> list[CancelOrderResult] cancel_batch_orders(cancel_order) +> list[CancelOrderResult] cancel_batch_orders(cancel_batch_order, x_gate_exptime=x_gate_exptime) -Cancel a batch of orders with an ID list +Cancel batch orders by specified ID list Multiple currency pairs can be specified, but maximum 20 orders are allowed per request @@ -1054,11 +1291,12 @@ configuration = gate_api.Configuration( api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.SpotApi(api_client) -cancel_order = [gate_api.CancelOrder()] # list[CancelOrder] | +cancel_batch_order = [gate_api.CancelBatchOrder()] # list[CancelBatchOrder] | +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 a batch of orders with an ID list - api_response = api_instance.cancel_batch_orders(cancel_order) + # Cancel batch orders by specified ID list + api_response = api_instance.cancel_batch_orders(cancel_batch_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)) @@ -1070,7 +1308,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **cancel_order** | [**list[CancelOrder]**](CancelOrder.md)| | + **cancel_batch_order** | [**list[CancelBatchOrder]**](CancelBatchOrder.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 @@ -1095,9 +1334,9 @@ Name | Type | Description | Notes # **get_order** > Order get_order(order_id, currency_pair, account=account) -Get a single order +Query single order details -Spot and margin orders are queried by default. If cross margin orders are needed, `account` must be set to `cross_margin` +By default, queries orders for spot, unified account, and isolated margin accounts. ### Example @@ -1123,12 +1362,12 @@ configuration = gate_api.Configuration( api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.SpotApi(api_client) -order_id = '12345' # str | Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. -currency_pair = 'BTC_USDT' # str | Currency pair -account = 'cross_margin' # str | Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) +order_id = '12345' # str | The order ID returned when the order was successfully created or the custom ID specified by the user's creation (i.e. the `text` field). Operations based on custom IDs can only be checked in pending orders. Only order ID can be used after the order is finished (transaction/cancel) +currency_pair = 'BTC_USDT' # str | Specify the trading pair to query. This field is required when querying pending order records. This field can be omitted when querying filled order records. +account = 'spot' # str | Specify query account (optional) try: - # Get a single order + # Query single order details api_response = api_instance.get_order(order_id, currency_pair, account=account) print(api_response) except GateApiException as ex: @@ -1141,9 +1380,9 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **order_id** | **str**| Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. | - **currency_pair** | **str**| Currency pair | - **account** | **str**| Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account | [optional] + **order_id** | **str**| The order ID returned when the order was successfully created or the custom ID specified by the user's creation (i.e. the `text` field). Operations based on custom IDs can only be checked in pending orders. Only order ID can be used after the order is finished (transaction/cancel) | + **currency_pair** | **str**| Specify the trading pair to query. This field is required when querying pending order records. This field can be omitted when querying filled order records. | + **account** | **str**| Specify query account | [optional] ### Return type @@ -1166,11 +1405,11 @@ 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) # **cancel_order** -> Order cancel_order(order_id, currency_pair, account=account) +> Order cancel_order(order_id, currency_pair, account=account, action_mode=action_mode, x_gate_exptime=x_gate_exptime) -Cancel a single order +Cancel single order -Spot and margin orders are cancelled by default. If trying to cancel cross margin orders, `account` must be set to `cross_margin` +By default, orders for spot, unified accounts and leveraged accounts are revoked. ### Example @@ -1196,13 +1435,15 @@ configuration = gate_api.Configuration( api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.SpotApi(api_client) -order_id = '12345' # str | Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. +order_id = '12345' # str | The order ID returned when the order was successfully created or the custom ID specified by the user's creation (i.e. the `text` field). Operations based on custom IDs can only be checked in pending orders. Only order ID can be used after the order is finished (transaction/cancel) currency_pair = 'BTC_USDT' # str | Currency pair -account = 'cross_margin' # str | Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) +account = 'spot' # str | Specify query account (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) +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 a single order - api_response = api_instance.cancel_order(order_id, currency_pair, account=account) + # Cancel single order + api_response = api_instance.cancel_order(order_id, currency_pair, account=account, action_mode=action_mode, 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)) @@ -1214,9 +1455,11 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **order_id** | **str**| Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. | + **order_id** | **str**| The order ID returned when the order was successfully created or the custom ID specified by the user's creation (i.e. the `text` field). Operations based on custom IDs can only be checked in pending orders. Only order ID can be used after the order is finished (transaction/cancel) | **currency_pair** | **str**| Currency pair | - **account** | **str**| Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account | [optional] + **account** | **str**| Specify query account | [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] + **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 @@ -1238,12 +1481,89 @@ 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_order** +> Order amend_order(order_id, order_patch, currency_pair=currency_pair, account=account, x_gate_exptime=x_gate_exptime) + +Amend single order + +Modify orders in spot, unified account and isolated margin account by default. Currently both request body and query support currency_pair and account parameters, but request body has higher priority. currency_pair must be filled in one of the request body or query parameters. About rate limit: Order modification and order creation share the same rate limit rules. About matching priority: Only reducing the quantity does not affect the matching priority. Modifying the price or increasing the quantity will adjust the priority to the end of the new price level. Note: Modifying the quantity to be less than the filled quantity will trigger a cancellation and isolated margin account by default. Currently both request body and query support currency_pair and account parameters, but request body has higher priority. currency_pair must be filled in one of the request body or query parameters. About rate limit: Order modification and order creation share the same rate limit rules. About matching priority: Only reducing the quantity does not affect the matching priority. Modifying the price or increasing the quantity will adjust the priority to the end of the new price level. Note: Modifying the quantity to be less than the filled quantity will trigger a cancellation operation. + +### 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 when the order was successfully created or the custom ID specified by the user's creation (i.e. the `text` field). Operations based on custom IDs can only be checked in pending orders. Only order ID can be used after the order is finished (transaction/cancel) +order_patch = gate_api.OrderPatch() # OrderPatch | +currency_pair = 'BTC_USDT' # str | Currency pair (optional) +account = 'spot' # str | Specify query account (optional) +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: + # Amend single order + api_response = api_instance.amend_order(order_id, order_patch, currency_pair=currency_pair, account=account, 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 SpotApi->amend_order: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order_id** | **str**| The order ID returned when the order was successfully created or the custom ID specified by the user's creation (i.e. the `text` field). Operations based on custom IDs can only be checked in pending orders. Only order ID can be used after the order is finished (transaction/cancel) | + **order_patch** | [**OrderPatch**](OrderPatch.md)| | + **currency_pair** | **str**| Currency pair | [optional] + **account** | **str**| Specify query account | [optional] + **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 + +[**Order**](Order.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** | 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_my_trades** -> list[Trade] list_my_trades(currency_pair, limit=limit, page=page, order_id=order_id, account=account, _from=_from, to=to) +> list[Trade] list_my_trades(currency_pair=currency_pair, limit=limit, page=page, order_id=order_id, account=account, _from=_from, to=to) -List personal trading history +Query personal trading records -Spot and margin trades are queried by default. If cross margin trades are needed, `account` must be set to `cross_margin` You can also set `from` and(or) `to` to query by time range Time range parameters are handled as order finish time. +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. ### Example @@ -1269,17 +1589,17 @@ configuration = gate_api.Configuration( 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 | Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones. -limit = 100 # int | Maximum number of records to be returned in a single list (optional) (default to 100) +currency_pair = 'BTC_USDT' # str | Retrieve results with specified currency pair (optional) +limit = 100 # int | Maximum number of items returned in list. Default: 100, minimum: 1, maximum: 1000 (optional) (default to 100) page = 1 # int | Page number (optional) (default to 1) order_id = '12345' # str | Filter trades with specified order ID. `currency_pair` is also required if this field is present (optional) -account = 'cross_margin' # str | Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional) -_from = 1627706330 # int | Start timestamp of the query (optional) -to = 1635329650 # int | Time range ending, default to current time (optional) +account = 'spot' # str | Specify query account (optional) +_from = 1627706330 # int | Start timestamp for the query (optional) +to = 1635329650 # int | End timestamp for the query, defaults to current time if not specified (optional) try: - # List personal trading history - api_response = api_instance.list_my_trades(currency_pair, limit=limit, page=page, order_id=order_id, account=account, _from=_from, to=to) + # Query personal trading records + api_response = api_instance.list_my_trades(currency_pair=currency_pair, limit=limit, page=page, order_id=order_id, account=account, _from=_from, to=to) print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) @@ -1291,13 +1611,13 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **currency_pair** | **str**| Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones. | - **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] + **currency_pair** | **str**| Retrieve results with specified currency pair | [optional] + **limit** | **int**| Maximum number of items returned in list. Default: 100, minimum: 1, maximum: 1000 | [optional] [default to 100] **page** | **int**| Page number | [optional] [default to 1] **order_id** | **str**| Filter trades with specified order ID. `currency_pair` is also required if this field is present | [optional] - **account** | **str**| Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account | [optional] - **_from** | **int**| Start timestamp of the query | [optional] - **to** | **int**| Time range ending, default to current time | [optional] + **account** | **str**| Specify query account | [optional] + **_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 @@ -1315,14 +1635,276 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**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_system_time** +> SystemTime get_system_time() + +Get server current time + +### 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.SpotApi(api_client) + +try: + # Get server current time + api_response = api_instance.get_system_time() + 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_system_time: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**SystemTime**](SystemTime.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) + +# **countdown_cancel_all_spot** +> TriggerTime countdown_cancel_all_spot(countdown_cancel_all_spot_task) + +Countdown cancel orders + +Spot order heartbeat detection. If there is no \"cancel existing countdown\" or \"set new countdown\" when the user-set `timeout` time is reached, the related `spot pending orders` will be automatically cancelled. This interface can be called repeatedly to set a new countdown or cancel the countdown. Usage example: Repeat this interface at 30s intervals, setting the countdown `timeout` to `30 (seconds)` each time. If this interface is not called again within 30 seconds, all pending orders on the `market` you specified will be automatically cancelled. If no `market` is specified, all market cancelled. If the `timeout` is set to 0 within 30 seconds, the countdown timer will be terminated and the automatic order cancellation function will be cancelled. + +### 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) +countdown_cancel_all_spot_task = gate_api.CountdownCancelAllSpotTask() # CountdownCancelAllSpotTask | + +try: + # Countdown cancel orders + api_response = api_instance.countdown_cancel_all_spot(countdown_cancel_all_spot_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 SpotApi->countdown_cancel_all_spot: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **countdown_cancel_all_spot_task** | [**CountdownCancelAllSpotTask**](CountdownCancelAllSpotTask.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) + +# **amend_batch_orders** +> list[BatchOrder] amend_batch_orders(batch_amend_item, x_gate_exptime=x_gate_exptime) + +Batch modification of orders + +Modify orders in spot, unified account and isolated margin account by default. Modify uncompleted orders, up to 5 orders can be modified at a time. Request parameters should be passed in array format. If there are order modification failures during the batch modification process, the modification of the next order will continue to be executed, and the execution will return with the corresponding order failure information. The call order of batch modification orders is consistent with the order list order. The return content order of batch modification orders is consistent with the order list 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) +batch_amend_item = [gate_api.BatchAmendItem()] # list[BatchAmendItem] | +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 modification of orders + api_response = api_instance.amend_batch_orders(batch_amend_item, 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 SpotApi->amend_batch_orders: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **batch_amend_item** | [**list[BatchAmendItem]**](BatchAmendItem.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[BatchOrder]**](BatchOrder.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 modification executed 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_spot_insurance_history** +> list[SpotInsuranceHistory] get_spot_insurance_history(business, currency, _from, to, page=page, limit=limit) + +Query spot insurance fund historical data + +### 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.SpotApi(api_client) +business = 'margin' # str | Leverage business, margin - position by position; unified - unified account +currency = 'BTC' # str | Currency +_from = 1547706332 # int | Start timestamp in seconds +to = 1547706332 # int | End timestamp in seconds +page = 1 # int | Page number (optional) (default to 1) +limit = 30 # int | The maximum number of items returned in the list, the default value is 30 (optional) (default to 30) + +try: + # Query spot insurance fund historical data + api_response = api_instance.get_spot_insurance_history(business, currency, _from, 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 SpotApi->get_spot_insurance_history: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **business** | **str**| Leverage business, margin - position by position; unified - unified account | + **currency** | **str**| Currency | + **_from** | **int**| Start timestamp in seconds | + **to** | **int**| End timestamp in seconds | + **page** | **int**| Page number | [optional] [default to 1] + **limit** | **int**| The maximum number of items returned in the list, the default value is 30 | [optional] [default to 30] + +### Return type + +[**list[SpotInsuranceHistory]**](SpotInsuranceHistory.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) # **list_spot_price_triggered_orders** > list[SpotPriceTriggeredOrder] list_spot_price_triggered_orders(status, market=market, account=account, limit=limit, offset=offset) -Retrieve running auto order list +Query running auto order list ### Example @@ -1348,14 +1930,14 @@ configuration = gate_api.Configuration( api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.SpotApi(api_client) -status = 'status_example' # str | Only list the orders with this status -market = 'BTC_USDT' # str | Currency pair (optional) -account = 'account_example' # str | Trading account (optional) -limit = 100 # int | Maximum number of records to be returned in a single list (optional) (default to 100) +status = 'status_example' # str | Query order list based on status +market = 'BTC_USDT' # str | Trading market (optional) +account = 'account_example' # str | Trading account type. Unified account must be set to `unified` (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: - # Retrieve running auto order list + # Query running auto order list api_response = api_instance.list_spot_price_triggered_orders(status, market=market, account=account, limit=limit, offset=offset) print(api_response) except GateApiException as ex: @@ -1368,10 +1950,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **status** | **str**| Only list the orders with this status | - **market** | **str**| Currency pair | [optional] - **account** | **str**| Trading account | [optional] - **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] + **status** | **str**| Query order list based on status | + **market** | **str**| Trading market | [optional] + **account** | **str**| Trading account type. Unified account must be set to `unified` | [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 @@ -1390,14 +1972,14 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**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) # **create_spot_price_triggered_order** > TriggerOrderResponse create_spot_price_triggered_order(spot_price_triggered_order) -Create a price-triggered order +Create price-triggered order ### Example @@ -1426,7 +2008,7 @@ api_instance = gate_api.SpotApi(api_client) spot_price_triggered_order = gate_api.SpotPriceTriggeredOrder() # SpotPriceTriggeredOrder | try: - # Create a price-triggered order + # Create price-triggered order api_response = api_instance.create_spot_price_triggered_order(spot_price_triggered_order) print(api_response) except GateApiException as ex: @@ -1457,14 +2039,14 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**201** | Order created | - | +**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_price_triggered_order_list** > list[SpotPriceTriggeredOrder] cancel_spot_price_triggered_order_list(market=market, account=account) -Cancel all open orders +Cancel all auto orders ### Example @@ -1490,11 +2072,11 @@ configuration = gate_api.Configuration( api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.SpotApi(api_client) -market = 'BTC_USDT' # str | Currency pair (optional) -account = 'account_example' # str | Trading account (optional) +market = 'BTC_USDT' # str | Trading market (optional) +account = 'account_example' # str | Trading account type. Unified account must be set to `unified` (optional) try: - # Cancel all open orders + # Cancel all auto orders api_response = api_instance.cancel_spot_price_triggered_order_list(market=market, account=account) print(api_response) except GateApiException as ex: @@ -1507,8 +2089,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **market** | **str**| Currency pair | [optional] - **account** | **str**| Trading account | [optional] + **market** | **str**| Trading market | [optional] + **account** | **str**| Trading account type. Unified account must be set to `unified` | [optional] ### Return type @@ -1526,14 +2108,14 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Batch cancellation request accepted. Query order status by listing orders | - | +**200** | Batch cancellation request accepted and processed, success determined by 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_price_triggered_order** > SpotPriceTriggeredOrder get_spot_price_triggered_order(order_id) -Get a single order +Query single auto order details ### Example @@ -1559,10 +2141,10 @@ configuration = gate_api.Configuration( api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.SpotApi(api_client) -order_id = 'order_id_example' # str | Retrieve the data of the order with the specified ID +order_id = 'order_id_example' # str | ID returned when order is successfully created try: - # Get a single order + # Query single auto order details api_response = api_instance.get_spot_price_triggered_order(order_id) print(api_response) except GateApiException as ex: @@ -1575,7 +2157,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **order_id** | **str**| Retrieve the data of the order with the specified ID | + **order_id** | **str**| ID returned when order is successfully created | ### Return type @@ -1593,14 +2175,14 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Auto order detail | - | +**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_spot_price_triggered_order** > SpotPriceTriggeredOrder cancel_spot_price_triggered_order(order_id) -Cancel a single order +Cancel single auto order ### Example @@ -1626,10 +2208,10 @@ configuration = gate_api.Configuration( api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.SpotApi(api_client) -order_id = 'order_id_example' # str | Retrieve the data of the order with the specified ID +order_id = 'order_id_example' # str | ID returned when order is successfully created try: - # Cancel a single order + # Cancel single auto order api_response = api_instance.cancel_spot_price_triggered_order(order_id) print(api_response) except GateApiException as ex: @@ -1642,7 +2224,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **order_id** | **str**| Retrieve the data of the order with the specified ID | + **order_id** | **str**| ID returned when order is successfully created | ### Return type @@ -1660,7 +2242,7 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Auto order detail | - | +**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) diff --git a/docs/SpotCurrencyChain.md b/docs/SpotCurrencyChain.md new file mode 100644 index 0000000..d461e15 --- /dev/null +++ b/docs/SpotCurrencyChain.md @@ -0,0 +1,14 @@ +# SpotCurrencyChain + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Blockchain name | [optional] +**addr** | **str** | token address | [optional] +**withdraw_disabled** | **bool** | Whether currency's withdrawal is disabled | [optional] +**withdraw_delayed** | **bool** | Whether currency's withdrawal is delayed | [optional] +**deposit_disabled** | **bool** | Whether currency's deposit is disabled | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SpotFee.md b/docs/SpotFee.md new file mode 100644 index 0000000..e007cf0 --- /dev/null +++ b/docs/SpotFee.md @@ -0,0 +1,19 @@ +# SpotFee + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_id** | **int** | User ID | [optional] +**taker_fee** | **str** | taker fee rate | [optional] +**maker_fee** | **str** | maker fee rate | [optional] +**gt_discount** | **bool** | Whether GT deduction discount is enabled | [optional] +**gt_taker_fee** | **str** | Taker fee rate if using GT deduction. It will be 0 if GT deduction is disabled | [optional] +**gt_maker_fee** | **str** | Maker fee rate with GT deduction. Returns 0 if GT deduction is disabled | [optional] +**loan_fee** | **str** | Loan fee rate of margin lending | [optional] +**point_type** | **str** | Point card type: 0 - Original version, 1 - New version since 202009 | [optional] +**currency_pair** | **str** | Currency pair | [optional] +**debit_fee** | **int** | Deduction types for rates, 1 - GT deduction, 2 - Point card deduction, 3 - VIP 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/SpotInsuranceHistory.md b/docs/SpotInsuranceHistory.md new file mode 100644 index 0000000..3d1f006 --- /dev/null +++ b/docs/SpotInsuranceHistory.md @@ -0,0 +1,12 @@ +# SpotInsuranceHistory + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **str** | Currency | [optional] +**balance** | **str** | Balance | [optional] +**time** | **int** | Creation time, 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/SpotPricePutOrder.md b/docs/SpotPricePutOrder.md index e9e905f..899f6d7 100644 --- a/docs/SpotPricePutOrder.md +++ b/docs/SpotPricePutOrder.md @@ -3,12 +3,15 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**type** | **str** | Order type, default to `limit` | [optional] [default to 'limit'] +**type** | **str** | Order type,default to `limit` - limit : Limit Order - market : Market Order | [optional] [default to 'limit'] **side** | **str** | Order side - buy: buy side - sell: sell side | **price** | **str** | Order price | -**amount** | **str** | Order amount | -**account** | **str** | Trading type - normal: spot trading - margin: margin trading | [default to 'normal'] +**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` | +**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'] +**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] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/SpotPriceTrigger.md b/docs/SpotPriceTrigger.md index 7ee5505..0208586 100644 --- a/docs/SpotPriceTrigger.md +++ b/docs/SpotPriceTrigger.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **price** | **str** | Trigger price | -**rule** | **str** | Price trigger condition - >=: triggered when market price larger than or equal to `price` field - <=: triggered when market price less than or equal to `price` field | -**expiration** | **int** | How long (in seconds) to wait for the condition to be triggered before cancelling the order. | +**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 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/SpotPriceTriggeredOrder.md b/docs/SpotPriceTriggeredOrder.md index 4291cb2..5c524ae 100644 --- a/docs/SpotPriceTriggeredOrder.md +++ b/docs/SpotPriceTriggeredOrder.md @@ -1,6 +1,6 @@ # SpotPriceTriggeredOrder -Spot order detail +Spot price order details ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- @@ -8,12 +8,12 @@ Name | Type | Description | Notes **put** | [**SpotPricePutOrder**](SpotPricePutOrder.md) | | **id** | **int** | Auto order ID | [optional] [readonly] **user** | **int** | User ID | [optional] [readonly] -**market** | **str** | Currency pair | -**ctime** | **int** | Creation time | [optional] [readonly] -**ftime** | **int** | Finished time | [optional] [readonly] -**fired_order_id** | **int** | ID of the newly created order on condition triggered | [optional] [readonly] -**status** | **str** | Status - open: open - cancelled: being manually cancelled - finish: successfully executed - failed: failed to execute - expired - expired | [optional] [readonly] -**reason** | **str** | Additional remarks on how the order was finished | [optional] [readonly] +**market** | **str** | Market | +**ctime** | **int** | Created time | [optional] [readonly] +**ftime** | **int** | End time | [optional] [readonly] +**fired_order_id** | **int** | ID of the order created after trigger | [optional] [readonly] +**status** | **str** | Status - open: Running - cancelled: Manually cancelled - finish: Successfully completed - failed: Failed to execute - expired: Expired | [optional] [readonly] +**reason** | **str** | Additional description of how the order was completed | [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/StpGroup.md b/docs/StpGroup.md new file mode 100644 index 0000000..8a02186 --- /dev/null +++ b/docs/StpGroup.md @@ -0,0 +1,13 @@ +# StpGroup + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | STP Group ID | [optional] +**name** | **str** | STP Group name | +**creator_id** | **int** | Creator ID | [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/StpGroupUser.md b/docs/StpGroupUser.md new file mode 100644 index 0000000..2e05e1a --- /dev/null +++ b/docs/StpGroupUser.md @@ -0,0 +1,12 @@ +# StpGroupUser + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_id** | **int** | User ID | [optional] +**stp_id** | **int** | STP Group ID | [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/StructuredBuy.md b/docs/StructuredBuy.md new file mode 100644 index 0000000..2c5428f --- /dev/null +++ b/docs/StructuredBuy.md @@ -0,0 +1,12 @@ +# StructuredBuy + +Dual Investment Buy +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pid** | **str** | Product ID | [optional] +**amount** | **str** | Buy Quantity | [optional] + +[[Back to Model list]](../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 new file mode 100644 index 0000000..a98f1a4 --- /dev/null +++ b/docs/StructuredGetProjectList.md @@ -0,0 +1,22 @@ +# 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 new file mode 100644 index 0000000..3f52c75 --- /dev/null +++ b/docs/StructuredOrderList.md @@ -0,0 +1,17 @@ +# 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/SubAccount.md b/docs/SubAccount.md new file mode 100644 index 0000000..4778a33 --- /dev/null +++ b/docs/SubAccount.md @@ -0,0 +1,17 @@ +# SubAccount + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**remark** | **str** | Remark | [optional] +**login_name** | **str** | Sub-account login name: Only letters, numbers and underscores are supported, cannot contain other invalid characters | +**password** | **str** | The sub-account's password. (Default: the same as main account's password) | [optional] +**email** | **str** | The sub-account's email address. (Default: the same as main account's email address) | [optional] +**state** | **int** | Sub-account status: 1-normal, 2-locked | [optional] [readonly] +**type** | **int** | Sub-account type: 1-Regular sub-account, 3-Cross margin sub-account | [optional] [readonly] +**user_id** | **int** | Sub-account user ID | [optional] [readonly] +**create_time** | **int** | Created time | [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/SubAccountApi.md b/docs/SubAccountApi.md new file mode 100644 index 0000000..dfae02b --- /dev/null +++ b/docs/SubAccountApi.md @@ -0,0 +1,760 @@ +# gate_api.SubAccountApi + +All URIs are relative to *https://api.gateio.ws/api/v4* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**list_sub_accounts**](SubAccountApi.md#list_sub_accounts) | **GET** /sub_accounts | List sub-accounts +[**create_sub_accounts**](SubAccountApi.md#create_sub_accounts) | **POST** /sub_accounts | Create a new sub-account +[**get_sub_account**](SubAccountApi.md#get_sub_account) | **GET** /sub_accounts/{user_id} | Get sub-account +[**list_sub_account_keys**](SubAccountApi.md#list_sub_account_keys) | **GET** /sub_accounts/{user_id}/keys | List all API key pairs of the sub-account +[**create_sub_account_keys**](SubAccountApi.md#create_sub_account_keys) | **POST** /sub_accounts/{user_id}/keys | Create new sub-account API key pair +[**get_sub_account_key**](SubAccountApi.md#get_sub_account_key) | **GET** /sub_accounts/{user_id}/keys/{key} | Get specific API key pair of the sub-account +[**update_sub_account_keys**](SubAccountApi.md#update_sub_account_keys) | **PUT** /sub_accounts/{user_id}/keys/{key} | Update sub-account API key pair +[**delete_sub_account_keys**](SubAccountApi.md#delete_sub_account_keys) | **DELETE** /sub_accounts/{user_id}/keys/{key} | Delete sub-account API key pair +[**lock_sub_account**](SubAccountApi.md#lock_sub_account) | **POST** /sub_accounts/{user_id}/lock | Lock sub-account +[**unlock_sub_account**](SubAccountApi.md#unlock_sub_account) | **POST** /sub_accounts/{user_id}/unlock | Unlock sub-account +[**list_unified_mode**](SubAccountApi.md#list_unified_mode) | **GET** /sub_accounts/unified_mode | Get sub-account mode + + +# **list_sub_accounts** +> list[SubAccount] list_sub_accounts(type=type) + +List sub-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.SubAccountApi(api_client) +type = '0' # str | Enter `0` to list all types of sub-accounts (currently supporting cross-margin sub-accounts and regular sub-accounts). Enter `1` to query regular sub-accounts only. If no parameter is passed, only regular sub-accounts will be queried by default. (optional) + +try: + # List sub-accounts + api_response = api_instance.list_sub_accounts(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 SubAccountApi->list_sub_accounts: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **type** | **str**| Enter `0` to list all types of sub-accounts (currently supporting cross-margin sub-accounts and regular sub-accounts). Enter `1` to query regular sub-accounts only. If no parameter is passed, only regular sub-accounts will be queried by default. | [optional] + +### Return type + +[**list[SubAccount]**](SubAccount.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) + +# **create_sub_accounts** +> SubAccount create_sub_accounts(sub_account) + +Create a new sub-account + +### 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.SubAccountApi(api_client) +sub_account = gate_api.SubAccount() # SubAccount | + +try: + # Create a new sub-account + api_response = api_instance.create_sub_accounts(sub_account) + 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 SubAccountApi->create_sub_accounts: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **sub_account** | [**SubAccount**](SubAccount.md)| | + +### Return type + +[**SubAccount**](SubAccount.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** | 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_sub_account** +> SubAccount get_sub_account(user_id) + +Get sub-account + +### 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.SubAccountApi(api_client) +user_id = 56 # int | Sub-account user ID + +try: + # Get sub-account + api_response = api_instance.get_sub_account(user_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 SubAccountApi->get_sub_account: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user_id** | **int**| Sub-account user ID | + +### Return type + +[**SubAccount**](SubAccount.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_sub_account_keys** +> list[SubAccountKey] list_sub_account_keys(user_id) + +List all API key pairs of the sub-account + +### 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.SubAccountApi(api_client) +user_id = 56 # int | Sub-account user ID + +try: + # List all API key pairs of the sub-account + api_response = api_instance.list_sub_account_keys(user_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 SubAccountApi->list_sub_account_keys: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user_id** | **int**| Sub-account user ID | + +### Return type + +[**list[SubAccountKey]**](SubAccountKey.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) + +# **create_sub_account_keys** +> SubAccountKey create_sub_account_keys(user_id, sub_account_key) + +Create new sub-account API key pair + +### 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.SubAccountApi(api_client) +user_id = 56 # int | Sub-account user ID +sub_account_key = gate_api.SubAccountKey() # SubAccountKey | + +try: + # Create new sub-account API key pair + api_response = api_instance.create_sub_account_keys(user_id, sub_account_key) + 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 SubAccountApi->create_sub_account_keys: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user_id** | **int**| Sub-account user ID | + **sub_account_key** | [**SubAccountKey**](SubAccountKey.md)| | + +### Return type + +[**SubAccountKey**](SubAccountKey.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) + +# **get_sub_account_key** +> SubAccountKey get_sub_account_key(user_id, key) + +Get specific API key pair of the sub-account + +### 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.SubAccountApi(api_client) +user_id = 56 # int | Sub-account user ID +key = 'key_example' # str | Sub-account API key + +try: + # Get specific API key pair of the sub-account + api_response = api_instance.get_sub_account_key(user_id, key) + 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 SubAccountApi->get_sub_account_key: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user_id** | **int**| Sub-account user ID | + **key** | **str**| Sub-account API key | + +### Return type + +[**SubAccountKey**](SubAccountKey.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) + +# **update_sub_account_keys** +> update_sub_account_keys(user_id, key, sub_account_key) + +Update sub-account API key pair + +### 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.SubAccountApi(api_client) +user_id = 56 # int | Sub-account user ID +key = 'key_example' # str | Sub-account API key +sub_account_key = gate_api.SubAccountKey() # SubAccountKey | + +try: + # Update sub-account API key pair + api_instance.update_sub_account_keys(user_id, key, sub_account_key) +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 SubAccountApi->update_sub_account_keys: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user_id** | **int**| Sub-account user ID | + **key** | **str**| Sub-account API key | + **sub_account_key** | [**SubAccountKey**](SubAccountKey.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 | +|-------------|-------------|------------------| +**204** | 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) + +# **delete_sub_account_keys** +> delete_sub_account_keys(user_id, key) + +Delete sub-account API key pair + +### 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.SubAccountApi(api_client) +user_id = 56 # int | Sub-account user ID +key = 'key_example' # str | Sub-account API key + +try: + # Delete sub-account API key pair + api_instance.delete_sub_account_keys(user_id, key) +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 SubAccountApi->delete_sub_account_keys: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user_id** | **int**| Sub-account user ID | + **key** | **str**| Sub-account API key | + +### 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 | +|-------------|-------------|------------------| +**204** | 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) + +# **lock_sub_account** +> lock_sub_account(user_id) + +Lock sub-account + +### 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.SubAccountApi(api_client) +user_id = 56 # int | Sub-account user ID + +try: + # Lock sub-account + api_instance.lock_sub_account(user_id) +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 SubAccountApi->lock_sub_account: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user_id** | **int**| Sub-account user ID | + +### 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 | +|-------------|-------------|------------------| +**204** | Locked 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) + +# **unlock_sub_account** +> unlock_sub_account(user_id) + +Unlock sub-account + +### 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.SubAccountApi(api_client) +user_id = 56 # int | Sub-account user ID + +try: + # Unlock sub-account + api_instance.unlock_sub_account(user_id) +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 SubAccountApi->unlock_sub_account: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user_id** | **int**| Sub-account user ID | + +### 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 | +|-------------|-------------|------------------| +**204** | Unlocked 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_unified_mode** +> list[SubUserMode] list_unified_mode() + +Get sub-account mode + +Unified account mode: - `classic`: Classic account mode - `multi_currency`: Multi-currency margin mode - `portfolio`: 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.SubAccountApi(api_client) + +try: + # Get sub-account mode + api_response = api_instance.list_unified_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 SubAccountApi->list_unified_mode: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**list[SubUserMode]**](SubUserMode.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/SubAccountCrossMarginBalance.md b/docs/SubAccountCrossMarginBalance.md new file mode 100644 index 0000000..ebb3791 --- /dev/null +++ b/docs/SubAccountCrossMarginBalance.md @@ -0,0 +1,11 @@ +# SubAccountCrossMarginBalance + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uid** | **str** | User ID | [optional] +**available** | [**SubCrossMarginAccount**](.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/SubAccountFuturesBalance.md b/docs/SubAccountFuturesBalance.md new file mode 100644 index 0000000..d5ddf25 --- /dev/null +++ b/docs/SubAccountFuturesBalance.md @@ -0,0 +1,11 @@ +# SubAccountFuturesBalance + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uid** | **str** | User ID | [optional] +**available** | [**dict(str, FuturesAccount)**](FuturesAccount.md) | Futures account balances | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SubAccountKey.md b/docs/SubAccountKey.md new file mode 100644 index 0000000..54fbdc5 --- /dev/null +++ b/docs/SubAccountKey.md @@ -0,0 +1,19 @@ +# SubAccountKey + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_id** | **int** | User ID | [optional] [readonly] +**mode** | **int** | Mode: 1 - classic 2 - portfolio account | [optional] +**name** | **str** | API Key Name | [optional] +**perms** | [**list[SubAccountKeyPerms]**](SubAccountKeyPerms.md) | | [optional] +**ip_whitelist** | **list[str]** | IP whitelist (list will be cleared if no value is passed) | [optional] +**key** | **str** | API Key | [optional] [readonly] +**state** | **int** | Status: 1-Normal 2-Frozen 3-Locked | [optional] [readonly] +**created_at** | **int** | Created time | [optional] [readonly] +**updated_at** | **int** | Last Update Time | [optional] [readonly] +**last_access** | **int** | Last Access Time | [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/SubAccountKeyPerms.md b/docs/SubAccountKeyPerms.md new file mode 100644 index 0000000..1b978be --- /dev/null +++ b/docs/SubAccountKeyPerms.md @@ -0,0 +1,11 @@ +# SubAccountKeyPerms + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Permission function name (no value will be cleared) - wallet: wallet - spot: spot/margin - futures: perpetual contract - delivery: delivery contract - earn: earn - custody: custody - options: options - account: account information - loan: lending - margin: margin - unified: unified account - copy: copy trading | [optional] +**read_only** | **bool** | Read Only | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SubAccountMarginBalance.md b/docs/SubAccountMarginBalance.md new file mode 100644 index 0000000..817fd31 --- /dev/null +++ b/docs/SubAccountMarginBalance.md @@ -0,0 +1,11 @@ +# SubAccountMarginBalance + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uid** | **str** | User ID | [optional] +**available** | [**list[MarginAccount]**](MarginAccount.md) | Margin account balances | [optional] + +[[Back to Model list]](../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 new file mode 100644 index 0000000..ad18faf --- /dev/null +++ b/docs/SubAccountToSubAccount.md @@ -0,0 +1,16 @@ +# SubAccountToSubAccount + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **str** | Transfer currency name | +**sub_account_type** | **str** | Transfer from account (deprecated, use `sub_account_from_type` and `sub_account_to_type` instead) | [optional] +**sub_account_from** | **str** | Transfer from the user id of the sub-account | +**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 | + +[[Back to Model list]](../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 28a4dac..c591078 100644 --- a/docs/SubAccountTransfer.md +++ b/docs/SubAccountTransfer.md @@ -3,14 +3,12 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**currency** | **str** | Transfer currency name | **sub_account** | **str** | Sub account user ID | -**direction** | **str** | Transfer direction. to - transfer into sub account; from - transfer out from sub account | +**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 | -**uid** | **str** | Main account user ID | [optional] [readonly] -**timest** | **str** | Transfer timestamp | [optional] [readonly] -**source** | **str** | Where the operation is initiated from | [optional] [readonly] -**sub_account_type** | **str** | Target sub user's account. `spot` - spot account, `futures` - perpetual contract account | [optional] [default to 'spot'] +**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] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/SubAccountTransferRecordItem.md b/docs/SubAccountTransferRecordItem.md new file mode 100644 index 0000000..ebfe07e --- /dev/null +++ b/docs/SubAccountTransferRecordItem.md @@ -0,0 +1,19 @@ +# SubAccountTransferRecordItem + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timest** | **str** | Transfer timestamp | [optional] [readonly] +**uid** | **str** | Main account user ID | [optional] [readonly] +**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 | +**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] +**status** | **str** | Sub-account transfer record status, currently only 'success' | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SubCrossMarginAccount.md b/docs/SubCrossMarginAccount.md new file mode 100644 index 0000000..b3ab224 --- /dev/null +++ b/docs/SubCrossMarginAccount.md @@ -0,0 +1,25 @@ +# SubCrossMarginAccount + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_id** | **int** | Cross margin account user ID. 0 means this sub-account has not yet opened a cross margin account | [optional] +**locked** | **bool** | Whether the account is locked | [optional] +**balances** | [**dict(str, CrossMarginBalance)**](CrossMarginBalance.md) | | [optional] +**total** | **str** | Total account value in USDT, i.e., the sum of all currencies' `(available+freeze)*price*discount` | [optional] +**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] +**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] +**total_margin_balance** | **str** | Total margin balance | [optional] +**total_maintenance_margin** | **str** | Total maintenance margin | [optional] +**total_initial_margin_rate** | **str** | Total initial margin rate | [optional] +**total_maintenance_margin_rate** | **str** | Total maintenance margin rate | [optional] +**total_available_margin** | **str** | Total available margin | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SubUserMode.md b/docs/SubUserMode.md new file mode 100644 index 0000000..a1d0c6d --- /dev/null +++ b/docs/SubUserMode.md @@ -0,0 +1,12 @@ +# SubUserMode + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_id** | **int** | User ID | [optional] +**is_unified** | **bool** | Whether it is a unified account | [optional] +**mode** | **str** | Unified account mode: - `classic`: Classic account mode - `multi_currency`: Multi-currency margin mode - `portfolio`: Portfolio 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/SwapCoin.md b/docs/SwapCoin.md new file mode 100644 index 0000000..3dc278b --- /dev/null +++ b/docs/SwapCoin.md @@ -0,0 +1,14 @@ +# SwapCoin + +Blockchain Mining +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**coin** | **str** | Currency | +**side** | **str** | 0 - Stake 1 - Redeem | +**amount** | **str** | Size | +**pid** | **int** | DeFi-type Mining Protocol Identifier | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SwapCoinStruct.md b/docs/SwapCoinStruct.md new file mode 100644 index 0000000..15735e1 --- /dev/null +++ b/docs/SwapCoinStruct.md @@ -0,0 +1,24 @@ +# SwapCoinStruct + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Order ID | [optional] +**pid** | **int** | Product ID | [optional] +**uid** | **int** | User ID | [optional] +**coin** | **str** | Currency | [optional] +**type** | **int** | Type 0-Staking 1-Redemption | [optional] +**subtype** | **str** | SubType | [optional] +**amount** | **str** | Amount | [optional] +**exchange_rate** | **str** | Exchange ratio | [optional] +**exchange_amount** | **str** | Redemption Amount | [optional] +**update_stamp** | **int** | UpdateTimestamp | [optional] +**create_stamp** | **int** | Transaction timestamp | [optional] +**status** | **int** | status 1-success | [optional] +**protocol_type** | **int** | DEFI Protocol Type | [optional] +**client_order_id** | **str** | Reference ID | [optional] +**source** | **str** | Order Origin | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SystemTime.md b/docs/SystemTime.md new file mode 100644 index 0000000..abcf889 --- /dev/null +++ b/docs/SystemTime.md @@ -0,0 +1,10 @@ +# SystemTime + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**server_time** | **int** | Server current time(ms) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Ticker.md b/docs/Ticker.md index 8f56ac6..8f0a410 100644 --- a/docs/Ticker.md +++ b/docs/Ticker.md @@ -5,16 +5,20 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **currency_pair** | **str** | Currency pair | [optional] **last** | **str** | Last trading price | [optional] -**lowest_ask** | **str** | Lowest ask | [optional] -**highest_bid** | **str** | Highest bid | [optional] -**change_percentage** | **str** | Change percentage. | [optional] -**base_volume** | **str** | Base currency trade volume | [optional] -**quote_volume** | **str** | Quote currency trade volume | [optional] -**high_24h** | **str** | Highest price in 24h | [optional] -**low_24h** | **str** | Lowest price in 24h | [optional] +**lowest_ask** | **str** | Recent lowest ask | [optional] +**lowest_size** | **str** | Latest seller's lowest price quantity; not available for batch queries; available for single queries, empty if no data | [optional] +**highest_bid** | **str** | Recent highest bid | [optional] +**highest_size** | **str** | Latest buyer's highest price quantity; not available for batch queries; available for single queries, empty if no data | [optional] +**change_percentage** | **str** | 24h price change percentage (negative for decrease, e.g., -7.45) | [optional] +**change_utc0** | **str** | UTC+0 timezone, 24h price change percentage, negative for decline (e.g., -7.45) | [optional] +**change_utc8** | **str** | UTC+8 timezone, 24h price change percentage, negative for decline (e.g., -7.45) | [optional] +**base_volume** | **str** | Base currency trading volume in the last 24h | [optional] +**quote_volume** | **str** | Quote currency trading volume in the last 24h | [optional] +**high_24h** | **str** | 24h High | [optional] +**low_24h** | **str** | 24h Low | [optional] **etf_net_value** | **str** | ETF net value | [optional] -**etf_pre_net_value** | **str** | ETF previous net value at re-balancing time | [optional] -**etf_pre_timestamp** | **int** | ETF previous re-balancing time | [optional] +**etf_pre_net_value** | **str** | ETF net value at previous rebalancing point | [optional] +**etf_pre_timestamp** | **int** | ETF previous rebalancing time | [optional] **etf_leverage** | **str** | ETF current 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/TotalBalance.md b/docs/TotalBalance.md index 91b929e..bead2e3 100644 --- a/docs/TotalBalance.md +++ b/docs/TotalBalance.md @@ -1,11 +1,11 @@ # TotalBalance -User's balance in all accounts +User's total balance information ## Properties 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: futures account - delivery: delivery account - warrant: warrant account - cbbc: cbbc account | [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] [[Back to Model list]](../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 264457a..9fbf77f 100644 --- a/docs/Trade.md +++ b/docs/Trade.md @@ -3,19 +3,22 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **str** | Trade ID | [optional] -**create_time** | **str** | Trading time | [optional] +**id** | **str** | Fill ID | [optional] +**create_time** | **str** | Fill Time | [optional] **create_time_ms** | **str** | Trading time, with millisecond precision | [optional] **currency_pair** | **str** | Currency pair | [optional] -**side** | **str** | Order side | [optional] -**role** | **str** | Trade role | [optional] +**side** | **str** | Buy or sell order | [optional] +**role** | **str** | Trade role, not returned in public endpoints | [optional] **amount** | **str** | Trade amount | [optional] **price** | **str** | Order price | [optional] -**order_id** | **str** | Related order ID. No value in public endpoints | [optional] -**fee** | **str** | Fee deducted. No value in public endpoints | [optional] -**fee_currency** | **str** | Fee currency unit. No value in public endpoints | [optional] -**point_fee** | **str** | Points used to deduct fee | [optional] -**gt_fee** | **str** | GT used to deduct fee | [optional] +**order_id** | **str** | Related order ID, not returned in public endpoints | [optional] +**fee** | **str** | Fee deducted, not returned in public endpoints | [optional] +**fee_currency** | **str** | Fee currency unit, not returned in public endpoints | [optional] +**point_fee** | **str** | Points used to deduct fee, not returned in public endpoints | [optional] +**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] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/TradeFee.md b/docs/TradeFee.md index be65029..4914a3f 100644 --- a/docs/TradeFee.md +++ b/docs/TradeFee.md @@ -6,13 +6,16 @@ Name | Type | Description | Notes **user_id** | **int** | User ID | [optional] **taker_fee** | **str** | taker fee rate | [optional] **maker_fee** | **str** | maker fee rate | [optional] -**gt_discount** | **bool** | If GT deduction is enabled | [optional] +**gt_discount** | **bool** | Whether GT deduction discount is enabled | [optional] **gt_taker_fee** | **str** | Taker fee rate if using GT deduction. It will be 0 if GT deduction is disabled | [optional] -**gt_maker_fee** | **str** | Maker fee rate if using GT deduction. It will be 0 if GT deduction is disabled | [optional] +**gt_maker_fee** | **str** | Maker fee rate with GT deduction. Returns 0 if GT deduction is disabled | [optional] **loan_fee** | **str** | Loan fee rate of margin lending | [optional] -**point_type** | **str** | Point type. 0 - Initial version. 1 - new version since 202009 | [optional] -**futures_taker_fee** | **str** | Futures trading taker fee | [optional] -**futures_maker_fee** | **str** | Future trading maker fee | [optional] +**point_type** | **str** | Point card type: 0 - Original version, 1 - New version since 202009 | [optional] +**futures_taker_fee** | **str** | Perpetual contract taker fee rate | [optional] +**futures_maker_fee** | **str** | Perpetual contract maker fee rate | [optional] +**delivery_taker_fee** | **str** | Delivery contract taker fee rate | [optional] +**delivery_maker_fee** | **str** | Delivery contract maker fee rate | [optional] +**debit_fee** | **int** | Deduction types for rates, 1 - GT deduction, 2 - Point card deduction, 3 - VIP 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/TransactionID.md b/docs/TransactionID.md new file mode 100644 index 0000000..92a681e --- /dev/null +++ b/docs/TransactionID.md @@ -0,0 +1,10 @@ +# TransactionID + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tx_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/Transfer.md b/docs/Transfer.md index 779b494..bf9cac3 100644 --- a/docs/Transfer.md +++ b/docs/Transfer.md @@ -1,15 +1,15 @@ # Transfer -Accounts available to transfer: - `spot`: spot account - `margin`: margin account - `futures`: perpetual futures account - `delivery`: delivery futures account - `cross_margin`: cross margin account +Accounts available to transfer: - `spot`: spot account - `margin`: margin account - `futures`: perpetual futures account - `delivery`: delivery futures account - `options`: options account ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**currency** | **str** | Transfer currency. For futures account, `currency` can be set to `POINT` or settle currency | +**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 | -**currency_pair** | **str** | Margin currency pair. Required if transfer from or to margin account | [optional] -**settle** | **str** | Futures settle currency. Required if `currency` is `POINT` | [optional] +**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] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/TransferOrderStatus.md b/docs/TransferOrderStatus.md new file mode 100644 index 0000000..ff17da4 --- /dev/null +++ b/docs/TransferOrderStatus.md @@ -0,0 +1,11 @@ +# TransferOrderStatus + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tx_id** | **str** | Order ID | [optional] +**status** | **str** | Transfer status: PENDING - Processing, SUCCESS - Transfer successful, FAIL - Transfer failed, PARTIAL_SUCCESS - Partially successful (this status appears when transferring between sub-accounts) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TransferablesResult.md b/docs/TransferablesResult.md new file mode 100644 index 0000000..87b8b07 --- /dev/null +++ b/docs/TransferablesResult.md @@ -0,0 +1,12 @@ +# TransferablesResult + +Batch query unified account maximum transferable results +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **str** | Currency detail | [optional] +**amount** | **str** | Maximum transferable 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/TriggerTime.md b/docs/TriggerTime.md new file mode 100644 index 0000000..a1e5d05 --- /dev/null +++ b/docs/TriggerTime.md @@ -0,0 +1,10 @@ +# TriggerTime + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**trigger_time** | **int** | Timestamp when countdown ends, 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/UidPushOrder.md b/docs/UidPushOrder.md new file mode 100644 index 0000000..25eb840 --- /dev/null +++ b/docs/UidPushOrder.md @@ -0,0 +1,18 @@ +# UidPushOrder + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Order ID | [optional] +**push_uid** | **int** | Initiator User ID | [optional] +**receive_uid** | **int** | Recipient User ID | [optional] +**currency** | **str** | Currency name | [optional] +**amount** | **str** | Transfer amount | [optional] +**create_time** | **int** | Created time | [optional] +**status** | **str** | Withdrawal status: - CREATING: Creating - PENDING: Waiting for recipient (Please contact the recipient to accept the transfer on Gate official website) - CANCELLING: Cancelling - CANCELLED: Cancelled - REFUSING: Refusing - REFUSED: Refused - RECEIVING: Receiving - RECEIVED: Success | [optional] +**message** | **str** | PENDING reason tips | [optional] +**transaction_type** | **str** | Order 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/UidPushWithdrawal.md b/docs/UidPushWithdrawal.md new file mode 100644 index 0000000..2510006 --- /dev/null +++ b/docs/UidPushWithdrawal.md @@ -0,0 +1,12 @@ +# UidPushWithdrawal + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**receive_uid** | **int** | Recipient UID | +**currency** | **str** | Currency name | +**amount** | **str** | Transfer 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/UidPushWithdrawalResp.md b/docs/UidPushWithdrawalResp.md new file mode 100644 index 0000000..5363c0f --- /dev/null +++ b/docs/UidPushWithdrawalResp.md @@ -0,0 +1,10 @@ +# UidPushWithdrawalResp + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**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/UniCurrency.md b/docs/UniCurrency.md new file mode 100644 index 0000000..02ea971 --- /dev/null +++ b/docs/UniCurrency.md @@ -0,0 +1,15 @@ +# UniCurrency + +Currency detail +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **str** | Currency name | [optional] [readonly] +**min_lend_amount** | **str** | The minimum lending amount, in the unit of the currency | [optional] [readonly] +**max_lend_amount** | **str** | The total maximum lending amount, in USDT | [optional] [readonly] +**max_rate** | **str** | Maximum rate (Hourly) | [optional] [readonly] +**min_rate** | **str** | Minimum rate (Hourly) | [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/UniCurrencyInterest.md b/docs/UniCurrencyInterest.md new file mode 100644 index 0000000..96c01fc --- /dev/null +++ b/docs/UniCurrencyInterest.md @@ -0,0 +1,11 @@ +# UniCurrencyInterest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **str** | Currency | [optional] [readonly] +**interest_status** | **str** | Interest status: interest_dividend - Normal dividend, interest_reinvest - Interest reinvestment | [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/UniCurrencyPair.md b/docs/UniCurrencyPair.md new file mode 100644 index 0000000..4e0d0c6 --- /dev/null +++ b/docs/UniCurrencyPair.md @@ -0,0 +1,14 @@ +# UniCurrencyPair + +Currency pair of the loan +## Properties +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] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UniInterestRecord.md b/docs/UniInterestRecord.md new file mode 100644 index 0000000..9486ec0 --- /dev/null +++ b/docs/UniInterestRecord.md @@ -0,0 +1,16 @@ +# UniInterestRecord + +Interest Record +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **int** | Status: 0 - fail, 1 - success | [optional] [readonly] +**currency** | **str** | Currency | [optional] [readonly] +**actual_rate** | **str** | Actual Rate | [optional] [readonly] +**interest** | **str** | Interest | [optional] [readonly] +**interest_status** | **str** | Interest status: interest_dividend - Normal dividend, interest_reinvest - Interest reinvestment | [optional] [readonly] +**create_time** | **int** | Created time | [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/UniLend.md b/docs/UniLend.md new file mode 100644 index 0000000..7080ac5 --- /dev/null +++ b/docs/UniLend.md @@ -0,0 +1,20 @@ +# UniLend + +Loan record +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **str** | Currency | [optional] [readonly] +**current_amount** | **str** | Current amount | [optional] [readonly] +**amount** | **str** | Total Lending Amount | [optional] [readonly] +**lent_amount** | **str** | Lent Amount | [optional] [readonly] +**frozen_amount** | **str** | Pending Redemption Amount | [optional] [readonly] +**min_rate** | **str** | Minimum interest rate | [optional] [readonly] +**interest_status** | **str** | Interest status: interest_dividend - Normal dividend, interest_reinvest - Interest reinvestment | [optional] [readonly] +**reinvest_left_amount** | **str** | Non-reinvested Amount | [optional] [readonly] +**create_time** | **int** | Lending Order Creation Time | [optional] [readonly] +**update_time** | **int** | Lending Order Last Update Time | [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/UniLendInterest.md b/docs/UniLendInterest.md new file mode 100644 index 0000000..899acfb --- /dev/null +++ b/docs/UniLendInterest.md @@ -0,0 +1,11 @@ +# UniLendInterest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **str** | Currency | [optional] [readonly] +**interest** | **str** | Interest income | [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/UniLendRecord.md b/docs/UniLendRecord.md new file mode 100644 index 0000000..39c187a --- /dev/null +++ b/docs/UniLendRecord.md @@ -0,0 +1,17 @@ +# UniLendRecord + +Lending Record +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **str** | Currency name | [optional] [readonly] +**amount** | **str** | Current Amount | [optional] [readonly] +**last_wallet_amount** | **str** | Previous Available Amount | [optional] [readonly] +**last_lent_amount** | **str** | Previous Lent Amount | [optional] [readonly] +**last_frozen_amount** | **str** | Previous Frozen Amount | [optional] [readonly] +**type** | **str** | Record Type: lend - Lend, redeem - Redeem | [optional] [readonly] +**create_time** | **int** | Created time | [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/UniLoan.md b/docs/UniLoan.md new file mode 100644 index 0000000..6293d5f --- /dev/null +++ b/docs/UniLoan.md @@ -0,0 +1,16 @@ +# UniLoan + +Borrowing +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **str** | Currency | [optional] [readonly] +**currency_pair** | **str** | Currency pair | [optional] [readonly] +**amount** | **str** | Amount to Repay | [optional] [readonly] +**type** | **str** | Loan type: platform borrowing - platform, margin borrowing - margin | [optional] [readonly] +**create_time** | **int** | Created time | [optional] [readonly] +**update_time** | **int** | Last Update Time | [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/UniLoanInterestRecord.md b/docs/UniLoanInterestRecord.md new file mode 100644 index 0000000..e93539b --- /dev/null +++ b/docs/UniLoanInterestRecord.md @@ -0,0 +1,17 @@ +# UniLoanInterestRecord + +Interest Deduction Record +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **str** | Currency name | [optional] [readonly] +**currency_pair** | **str** | Currency pair | [optional] [readonly] +**actual_rate** | **str** | Actual Rate | [optional] [readonly] +**interest** | **str** | Interest | [optional] [readonly] +**status** | **int** | Status: 0 - fail, 1 - success | [optional] [readonly] +**type** | **str** | Type: platform - Platform borrowing, margin - Margin borrowing | [optional] [readonly] +**create_time** | **int** | Created time | [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/UniLoanRecord.md b/docs/UniLoanRecord.md new file mode 100644 index 0000000..b34be2c --- /dev/null +++ b/docs/UniLoanRecord.md @@ -0,0 +1,15 @@ +# UniLoanRecord + +Borrowing Records +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | Type: `borrow` - borrow, `repay` - repay | [optional] [readonly] +**currency_pair** | **str** | Currency pair | [optional] [readonly] +**currency** | **str** | Currency | [optional] [readonly] +**amount** | **str** | Borrow or repayment amount | [optional] [readonly] +**create_time** | **int** | Created time | [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/UnifiedAccount.md b/docs/UnifiedAccount.md new file mode 100644 index 0000000..4d2d24b --- /dev/null +++ b/docs/UnifiedAccount.md @@ -0,0 +1,29 @@ +# UnifiedAccount + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**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_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] +**spot_order_loss** | **str** | Total pending order loss, in USDT, valid in cross-currency margin/combined margin mode, 0 in other modes such as single-currency margin mode | [optional] +**spot_hedge** | **bool** | Spot hedging status: true - enabled, false - disabled | [optional] +**use_funding** | **bool** | Whether to use Earn funds as margin | [optional] +**is_all_collateral** | **bool** | Whether all currencies are used as margin: true - all currencies as margin, false - 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/UnifiedApi.md b/docs/UnifiedApi.md new file mode 100644 index 0000000..5c23e08 --- /dev/null +++ b/docs/UnifiedApi.md @@ -0,0 +1,1487 @@ +# gate_api.UnifiedApi + +All URIs are relative to *https://api.gateio.ws/api/v4* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**list_unified_accounts**](UnifiedApi.md#list_unified_accounts) | **GET** /unified/accounts | Get unified account information +[**get_unified_borrowable**](UnifiedApi.md#get_unified_borrowable) | **GET** /unified/borrowable | Query maximum borrowable amount for unified account +[**get_unified_transferable**](UnifiedApi.md#get_unified_transferable) | **GET** /unified/transferable | Query maximum transferable amount for unified account +[**get_unified_transferables**](UnifiedApi.md#get_unified_transferables) | **GET** /unified/transferables | Batch query maximum transferable amount for unified accounts. Each currency shows the maximum value. After user withdrawal, the transferable amount for all currencies will change +[**get_unified_borrowable_list**](UnifiedApi.md#get_unified_borrowable_list) | **GET** /unified/batch_borrowable | Batch query unified account maximum borrowable amount +[**list_unified_loans**](UnifiedApi.md#list_unified_loans) | **GET** /unified/loans | Query loans +[**create_unified_loan**](UnifiedApi.md#create_unified_loan) | **POST** /unified/loans | Borrow or repay +[**list_unified_loan_records**](UnifiedApi.md#list_unified_loan_records) | **GET** /unified/loan_records | Query loan records +[**list_unified_loan_interest_records**](UnifiedApi.md#list_unified_loan_interest_records) | **GET** /unified/interest_records | Query interest deduction records +[**get_unified_risk_units**](UnifiedApi.md#get_unified_risk_units) | **GET** /unified/risk_units | Get user risk unit details +[**get_unified_mode**](UnifiedApi.md#get_unified_mode) | **GET** /unified/unified_mode | Query mode of the unified account +[**set_unified_mode**](UnifiedApi.md#set_unified_mode) | **PUT** /unified/unified_mode | Set unified account mode +[**get_unified_estimate_rate**](UnifiedApi.md#get_unified_estimate_rate) | **GET** /unified/estimate_rate | Query unified account estimated interest rate +[**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 +[**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 + + +# **list_unified_accounts** +> UnifiedAccount list_unified_accounts(currency=currency, sub_uid=sub_uid) + +Get unified account information + +The assets of each currency in the account will be adjusted according to their liquidity, defined by corresponding adjustment coefficients, and then uniformly converted to USD to calculate the total asset value and position value of the account. For specific formulas, please refer to [Margin Formula](#margin-formula) + +### 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) +currency = 'BTC' # str | Query by specified currency name (optional) +sub_uid = '10001' # str | Sub account user ID (optional) + +try: + # Get unified account information + api_response = api_instance.list_unified_accounts(currency=currency, sub_uid=sub_uid) + 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->list_unified_accounts: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currency** | **str**| Query by specified currency name | [optional] + **sub_uid** | **str**| Sub account user ID | [optional] + +### Return type + +[**UnifiedAccount**](UnifiedAccount.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) + +# **get_unified_borrowable** +> UnifiedBorrowable get_unified_borrowable(currency) + +Query maximum borrowable amount for unified account + +### 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) +currency = 'BTC' # str | Query by specified currency name + +try: + # Query maximum borrowable amount for unified account + api_response = api_instance.get_unified_borrowable(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 UnifiedApi->get_unified_borrowable: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currency** | **str**| Query by specified currency name | + +### Return type + +[**UnifiedBorrowable**](UnifiedBorrowable.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_unified_transferable** +> UnifiedTransferable get_unified_transferable(currency) + +Query maximum transferable amount for unified account + +### 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) +currency = 'BTC' # str | Query by specified currency name + +try: + # Query maximum transferable amount for unified account + api_response = api_instance.get_unified_transferable(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 UnifiedApi->get_unified_transferable: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currency** | **str**| Query by specified currency name | + +### Return type + +[**UnifiedTransferable**](UnifiedTransferable.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_unified_transferables** +> list[TransferablesResult] get_unified_transferables(currencies) + +Batch query maximum transferable amount for unified accounts. Each currency shows the maximum value. After user withdrawal, the transferable amount for all currencies will change + +### 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) +currencies = 'BTC,ETH' # str | Specify the currency name to query in batches, and support up to 100 pass parameters at a time + +try: + # Batch query maximum transferable amount for unified accounts. Each currency shows the maximum value. After user withdrawal, the transferable amount for all currencies will change + api_response = api_instance.get_unified_transferables(currencies) + 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_transferables: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currencies** | **str**| Specify the currency name to query in batches, and support up to 100 pass parameters at a time | + +### Return type + +[**list[TransferablesResult]**](TransferablesResult.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_unified_borrowable_list** +> list[UnifiedBorrowable1] get_unified_borrowable_list(currencies) + +Batch query unified account maximum borrowable 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.UnifiedApi(api_client) +currencies = ['[\"BTC\",\"GT\"]'] # list[str] | Specify currency names for querying in an array, separated by commas, maximum 10 currencies + +try: + # Batch query unified account maximum borrowable amount + api_response = api_instance.get_unified_borrowable_list(currencies) + 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_borrowable_list: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currencies** | [**list[str]**](str.md)| Specify currency names for querying in an array, separated by commas, maximum 10 currencies | + +### Return type + +[**list[UnifiedBorrowable1]**](UnifiedBorrowable1.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_unified_loans** +> list[UniLoan] list_unified_loans(currency=currency, page=page, limit=limit, type=type) + +Query loans + +### 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) +currency = 'BTC' # str | Query by specified currency name (optional) +page = 1 # int | Page number (optional) (default to 1) +limit = 100 # int | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 (optional) (default to 100) +type = 'platform' # str | Loan type: platform borrowing - platform, margin borrowing - margin (optional) + +try: + # Query loans + api_response = api_instance.list_unified_loans(currency=currency, page=page, limit=limit, 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 UnifiedApi->list_unified_loans: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currency** | **str**| Query by specified currency name | [optional] + **page** | **int**| Page number | [optional] [default to 1] + **limit** | **int**| Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 | [optional] [default to 100] + **type** | **str**| Loan type: platform borrowing - platform, margin borrowing - margin | [optional] + +### Return type + +[**list[UniLoan]**](UniLoan.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_unified_loan** +> UnifiedLoanResult create_unified_loan(unified_loan) + +Borrow or repay + +When borrowing, ensure the borrowed amount is not below the minimum borrowing threshold for the specific cryptocurrency and does not exceed the maximum borrowing limit set by the platform and user. Loan interest will be automatically deducted from the account at regular intervals. Users are responsible for managing repayment of borrowed amounts. For repayment, use `repaid_all=true` to repay all available amounts + +### 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) +unified_loan = gate_api.UnifiedLoan() # UnifiedLoan | + +try: + # Borrow or repay + api_response = api_instance.create_unified_loan(unified_loan) + 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_unified_loan: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **unified_loan** | [**UnifiedLoan**](UnifiedLoan.md)| | + +### Return type + +[**UnifiedLoanResult**](UnifiedLoanResult.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** | Operation 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_unified_loan_records** +> list[UnifiedLoanRecord] list_unified_loan_records(type=type, currency=currency, page=page, limit=limit) + +Query loan 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.UnifiedApi(api_client) +type = 'type_example' # str | Loan record type: borrow - borrowing, repay - repayment (optional) +currency = 'BTC' # str | Query by specified currency name (optional) +page = 1 # int | Page number (optional) (default to 1) +limit = 100 # int | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 (optional) (default to 100) + +try: + # Query loan records + api_response = api_instance.list_unified_loan_records(type=type, currency=currency, 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 UnifiedApi->list_unified_loan_records: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **type** | **str**| Loan record type: borrow - borrowing, repay - repayment | [optional] + **currency** | **str**| Query by specified currency name | [optional] + **page** | **int**| Page number | [optional] [default to 1] + **limit** | **int**| Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 | [optional] [default to 100] + +### Return type + +[**list[UnifiedLoanRecord]**](UnifiedLoanRecord.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_unified_loan_interest_records** +> list[UniLoanInterestRecord] list_unified_loan_interest_records(currency=currency, page=page, limit=limit, _from=_from, to=to, type=type) + +Query interest deduction 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.UnifiedApi(api_client) +currency = 'BTC' # str | Query by specified currency name (optional) +page = 1 # int | Page number (optional) (default to 1) +limit = 100 # int | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 (optional) (default to 100) +_from = 1627706330 # int | Start timestamp for the query (optional) +to = 1635329650 # int | End timestamp for the query, defaults to current time if not specified (optional) +type = 'platform' # str | Loan type: platform borrowing - platform, margin borrowing - margin. Defaults to margin if not specified (optional) + +try: + # Query interest deduction records + api_response = api_instance.list_unified_loan_interest_records(currency=currency, page=page, limit=limit, _from=_from, to=to, 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 UnifiedApi->list_unified_loan_interest_records: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currency** | **str**| Query by specified currency name | [optional] + **page** | **int**| Page number | [optional] [default to 1] + **limit** | **int**| Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 | [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] + **type** | **str**| Loan type: platform borrowing - platform, margin borrowing - margin. Defaults to margin if not specified | [optional] + +### Return type + +[**list[UniLoanInterestRecord]**](UniLoanInterestRecord.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_unified_risk_units** +> UnifiedRiskUnits get_unified_risk_units() + +Get user risk unit details + +Get user risk unit details, only valid in 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: + # Get user risk unit details + api_response = api_instance.get_unified_risk_units() + 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_risk_units: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**UnifiedRiskUnits**](UnifiedRiskUnits.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_unified_mode** +> UnifiedModeSet get_unified_mode() + +Query mode of the unified account + +Unified account mode: - `classic`: Classic account mode - `multi_currency`: Cross-currency margin mode - `portfolio`: Portfolio margin mode - `single_currency`: Single-currency 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: + # Query mode of the unified account + api_response = api_instance.get_unified_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 UnifiedApi->get_unified_mode: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**UnifiedModeSet**](UnifiedModeSet.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) + +# **set_unified_mode** +> set_unified_mode(unified_mode_set) + +Set unified account mode + +Each account mode switch only requires passing the corresponding account mode parameter, and also supports turning on or off the configuration switches under the corresponding account mode during the switch. - When enabling the classic account mode, mode=classic ``` PUT /unified/unified_mode { \"mode\": \"classic\" } ``` - When enabling the cross-currency margin \"multi_currency\", \"settings\": { \"usdt_futures\": true } } ``` - When enabling the portfolio margin mode, mode=portfolio ``` PUT /unified/unified_mode { \"mode\": \"portfolio\", \"settings\": { \"spot_hedge\": true } } ``` - When enabling the single-currency margin mode, mode=single_currency ``` PUT /unified/unified_mode { \"mode\": \"single_currency\" } ``` + +### 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) +unified_mode_set = gate_api.UnifiedModeSet() # UnifiedModeSet | + +try: + # Set unified account mode + api_instance.set_unified_mode(unified_mode_set) +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_mode: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **unified_mode_set** | [**UnifiedModeSet**](UnifiedModeSet.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 | +|-------------|-------------|------------------| +**204** | 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_unified_estimate_rate** +> dict(str, str) get_unified_estimate_rate(currencies) + +Query unified account estimated interest rate + +Interest rates fluctuate hourly based on lending depth, so exact rates cannot be provided. When a currency is not supported, the interest rate returned will be 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.UnifiedApi(api_client) +currencies = ['[\"BTC\",\"GT\"]'] # list[str] | Specify currency names for querying in an array, separated by commas, maximum 10 currencies + +try: + # Query unified account estimated interest rate + api_response = api_instance.get_unified_estimate_rate(currencies) + 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_estimate_rate: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currencies** | [**list[str]**](str.md)| Specify currency names for querying in an array, separated by commas, maximum 10 currencies | + +### 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** | 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_currency_discount_tiers** +> list[UnifiedDiscount] list_currency_discount_tiers() + +Query unified account tiered + +### 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.UnifiedApi(api_client) + +try: + # Query unified account tiered + api_response = api_instance.list_currency_discount_tiers() + 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->list_currency_discount_tiers: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**list[UnifiedDiscount]**](UnifiedDiscount.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) + +# **list_loan_margin_tiers** +> list[UnifiedMarginTiers] list_loan_margin_tiers() + +Query unified account tiered loan margin + +### 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.UnifiedApi(api_client) + +try: + # Query unified account tiered loan margin + api_response = api_instance.list_loan_margin_tiers() + 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->list_loan_margin_tiers: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**list[UnifiedMarginTiers]**](UnifiedMarginTiers.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) + +# **calculate_portfolio_margin** +> UnifiedPortfolioOutput calculate_portfolio_margin(unified_portfolio_input) + +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. + +### 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.UnifiedApi(api_client) +unified_portfolio_input = gate_api.UnifiedPortfolioInput() # UnifiedPortfolioInput | + +try: + # Portfolio margin calculator + api_response = api_instance.calculate_portfolio_margin(unified_portfolio_input) + 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->calculate_portfolio_margin: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **unified_portfolio_input** | [**UnifiedPortfolioInput**](UnifiedPortfolioInput.md)| | + +### Return type + +[**UnifiedPortfolioOutput**](UnifiedPortfolioOutput.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **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_user_leverage_currency_config** +> UnifiedLeverageConfig get_user_leverage_currency_config(currency) + +Maximum and minimum currency leverage that can be set + +### 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) +currency = 'BTC' # str | Currency + +try: + # Maximum and minimum currency leverage that can be set + api_response = api_instance.get_user_leverage_currency_config(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 UnifiedApi->get_user_leverage_currency_config: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currency** | **str**| Currency | + +### Return type + +[**UnifiedLeverageConfig**](UnifiedLeverageConfig.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_user_leverage_currency_setting** +> list[UnifiedLeverageSetting] get_user_leverage_currency_setting(currency=currency) + +Get user currency leverage + +Get user currency leverage. If currency is not specified, query all currencies + +### 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) +currency = 'BTC' # str | Currency (optional) + +try: + # Get user currency leverage + api_response = api_instance.get_user_leverage_currency_setting(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 UnifiedApi->get_user_leverage_currency_setting: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currency** | **str**| Currency | [optional] + +### Return type + +[**list[UnifiedLeverageSetting]**](UnifiedLeverageSetting.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) + +# **set_user_leverage_currency_setting** +> set_user_leverage_currency_setting(unified_leverage_setting) + +Set loan currency leverage + +### 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) +unified_leverage_setting = gate_api.UnifiedLeverageSetting() # UnifiedLeverageSetting | + +try: + # Set loan currency leverage + api_instance.set_user_leverage_currency_setting(unified_leverage_setting) +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_currency_setting: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **unified_leverage_setting** | [**UnifiedLeverageSetting**](UnifiedLeverageSetting.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 | +|-------------|-------------|------------------| +**204** | 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) + +# **list_unified_currencies** +> list[UnifiedCurrency] list_unified_currencies(currency=currency) + +List of loan currencies supported by unified account + +### 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.UnifiedApi(api_client) +currency = 'BTC' # str | Currency (optional) + +try: + # List of loan currencies supported by unified account + api_response = api_instance.list_unified_currencies(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 UnifiedApi->list_unified_currencies: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currency** | **str**| Currency | [optional] + +### Return type + +[**list[UnifiedCurrency]**](UnifiedCurrency.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_history_loan_rate** +> UnifiedHistoryLoanRate get_history_loan_rate(currency, tier=tier, page=page, limit=limit) + +Get historical lending 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.UnifiedApi(api_client) +currency = 'USDT' # str | Currency +tier = '1' # str | VIP level for the floating rate to be queried (optional) +page = 1 # int | Page number (optional) (default to 1) +limit = 100 # int | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 (optional) (default to 100) + +try: + # Get historical lending rates + api_response = api_instance.get_history_loan_rate(currency, tier=tier, 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 UnifiedApi->get_history_loan_rate: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currency** | **str**| Currency | + **tier** | **str**| VIP level for the floating rate to be queried | [optional] + **page** | **int**| Page number | [optional] [default to 1] + **limit** | **int**| Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 | [optional] [default to 100] + +### Return type + +[**UnifiedHistoryLoanRate**](UnifiedHistoryLoanRate.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) + +# **set_unified_collateral** +> UnifiedCollateralRes set_unified_collateral(unified_collateral_req) + +Set collateral currency + +### 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) +unified_collateral_req = gate_api.UnifiedCollateralReq() # UnifiedCollateralReq | + +try: + # Set collateral currency + api_response = api_instance.set_unified_collateral(unified_collateral_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 UnifiedApi->set_unified_collateral: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **unified_collateral_req** | [**UnifiedCollateralReq**](UnifiedCollateralReq.md)| | + +### Return type + +[**UnifiedCollateralRes**](UnifiedCollateralRes.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** | 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) + diff --git a/docs/UnifiedBalance.md b/docs/UnifiedBalance.md new file mode 100644 index 0000000..748cf98 --- /dev/null +++ b/docs/UnifiedBalance.md @@ -0,0 +1,29 @@ +# UnifiedBalance + +## 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] +**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] +**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 is valid in single-currency margin mode and is 0 in other modes such as cross-currency margin/combined 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] +**enabled_collateral** | **bool** | Currency enabled as margin: true - Enabled, false - Disabled | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CrossMarginBorrowable.md b/docs/UnifiedBorrowable.md similarity index 94% rename from docs/CrossMarginBorrowable.md rename to docs/UnifiedBorrowable.md index cf7bc24..edd2c95 100644 --- a/docs/CrossMarginBorrowable.md +++ b/docs/UnifiedBorrowable.md @@ -1,4 +1,4 @@ -# CrossMarginBorrowable +# UnifiedBorrowable ## Properties Name | Type | Description | Notes diff --git a/docs/MarginBorrowable.md b/docs/UnifiedBorrowable1.md similarity index 70% rename from docs/MarginBorrowable.md rename to docs/UnifiedBorrowable1.md index 6cd64a5..81b38b3 100644 --- a/docs/MarginBorrowable.md +++ b/docs/UnifiedBorrowable1.md @@ -1,11 +1,11 @@ -# MarginBorrowable +# UnifiedBorrowable1 +Batch query unified account maximum borrowable results ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **currency** | **str** | Currency detail | [optional] -**currency_pair** | **str** | Currency pair | [optional] -**amount** | **str** | Max borrowable amount | [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/UnifiedCollateralReq.md b/docs/UnifiedCollateralReq.md new file mode 100644 index 0000000..fc1976a --- /dev/null +++ b/docs/UnifiedCollateralReq.md @@ -0,0 +1,12 @@ +# UnifiedCollateralReq + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**collateral_type** | **int** | User-set collateral mode: 0(all)-All currencies as collateral, 1(custom)-Custom currencies as collateral. When collateral_type is 0(all), enable_list and disable_list parameters are invalid | [optional] +**enable_list** | **list[str]** | Currency list, where collateral_type=1(custom) indicates the addition logic | [optional] +**disable_list** | **list[str]** | Disable list, indicating the disable logic | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UnifiedCollateralRes.md b/docs/UnifiedCollateralRes.md new file mode 100644 index 0000000..7432c38 --- /dev/null +++ b/docs/UnifiedCollateralRes.md @@ -0,0 +1,11 @@ +# UnifiedCollateralRes + +Unified account collateral mode settings response +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**is_success** | **bool** | Whether the setting was successful | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UnifiedCurrency.md b/docs/UnifiedCurrency.md new file mode 100644 index 0000000..db33f77 --- /dev/null +++ b/docs/UnifiedCurrency.md @@ -0,0 +1,15 @@ +# UnifiedCurrency + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Currency name | [optional] +**prec** | **str** | Currency precision | [optional] +**min_borrow_amount** | **str** | Minimum borrowable limit, in currency units | [optional] +**user_max_borrow_amount** | **str** | User's maximum borrowable limit, in USDT | [optional] +**total_max_borrow_amount** | **str** | Platform's maximum borrowable limit, in USDT | [optional] +**loan_status** | **str** | Lending status - `disable` : Lending prohibited - `enable` : Lending 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/UnifiedDiscount.md b/docs/UnifiedDiscount.md new file mode 100644 index 0000000..a242849 --- /dev/null +++ b/docs/UnifiedDiscount.md @@ -0,0 +1,12 @@ +# UnifiedDiscount + +Unified account tiered discount +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **str** | Currency name | [optional] +**discount_tiers** | [**list[UnifiedDiscountTiers]**](UnifiedDiscountTiers.md) | Tiered discount | [optional] + +[[Back to Model list]](../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 new file mode 100644 index 0000000..ba78cc7 --- /dev/null +++ b/docs/UnifiedDiscountTiers.md @@ -0,0 +1,14 @@ +# UnifiedDiscountTiers + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tier** | **str** | Tier | [optional] +**discount** | **str** | Discount | [optional] +**lower_limit** | **str** | Lower limit | [optional] +**upper_limit** | **str** | Upper limit, + indicates positive infinity | [optional] +**leverage** | **str** | Position 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/UnifiedHistoryLoanRate.md b/docs/UnifiedHistoryLoanRate.md new file mode 100644 index 0000000..4414cf5 --- /dev/null +++ b/docs/UnifiedHistoryLoanRate.md @@ -0,0 +1,13 @@ +# UnifiedHistoryLoanRate + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **str** | Currency name | [optional] +**tier** | **str** | VIP level for the floating rate to be retrieved | [optional] +**tier_up_rate** | **str** | Floating rate corresponding to VIP level | [optional] +**rates** | [**list[UnifiedHistoryLoanRateRates]**](UnifiedHistoryLoanRateRates.md) | Historical interest rate information, one data point per hour, array size determined by page and limit parameters from the API request, sorted by time from recent to distant | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UnifiedHistoryLoanRateRates.md b/docs/UnifiedHistoryLoanRateRates.md new file mode 100644 index 0000000..2cc9c85 --- /dev/null +++ b/docs/UnifiedHistoryLoanRateRates.md @@ -0,0 +1,11 @@ +# UnifiedHistoryLoanRateRates + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**time** | **int** | Hourly timestamp corresponding to this interest rate, in milliseconds | [optional] +**rate** | **str** | Historical interest rate for this hour | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UnifiedLeverageConfig.md b/docs/UnifiedLeverageConfig.md new file mode 100644 index 0000000..4f70f0d --- /dev/null +++ b/docs/UnifiedLeverageConfig.md @@ -0,0 +1,16 @@ +# UnifiedLeverageConfig + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**current_leverage** | **str** | Current leverage ratio | [optional] +**min_leverage** | **str** | Minimum adjustable leverage ratio | [optional] +**max_leverage** | **str** | Maximum adjustable leverage ratio | [optional] +**debit** | **str** | Current liabilities | [optional] +**available_margin** | **str** | Available Margin | [optional] +**borrowable** | **str** | Maximum borrowable amount at current leverage | [optional] +**except_leverage_borrowable** | **str** | Maximum borrowable from margin and maximum borrowable from Earn, whichever is smaller | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UnifiedLeverageSetting.md b/docs/UnifiedLeverageSetting.md new file mode 100644 index 0000000..63a8b10 --- /dev/null +++ b/docs/UnifiedLeverageSetting.md @@ -0,0 +1,12 @@ +# UnifiedLeverageSetting + +Leverage multiplier for borrowing currency +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **str** | Currency name | +**leverage** | **str** | 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/UnifiedLoan.md b/docs/UnifiedLoan.md new file mode 100644 index 0000000..0f950f3 --- /dev/null +++ b/docs/UnifiedLoan.md @@ -0,0 +1,15 @@ +# UnifiedLoan + +Borrow or repay +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **str** | Currency | +**type** | **str** | Type: `borrow` - borrow, `repay` - repay | +**amount** | **str** | Borrow or repayment amount | +**repaid_all** | **bool** | Full repayment, only used for repayment operations. When set to `true`, overrides `amount` and directly repays the full amount | [optional] +**text** | **str** | User defined custom 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/UnifiedLoanRecord.md b/docs/UnifiedLoanRecord.md new file mode 100644 index 0000000..29d2159 --- /dev/null +++ b/docs/UnifiedLoanRecord.md @@ -0,0 +1,18 @@ +# UnifiedLoanRecord + +Borrowing Records +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | ID | [optional] [readonly] +**type** | **str** | Type: `borrow` - borrow, `repay` - repay | [optional] [readonly] +**repayment_type** | **str** | Repayment type: none - No repayment type, manual_repay - Manual repayment, auto_repay - Automatic repayment, cancel_auto_repay - Automatic repayment after order cancellation, different_currencies_repayment - Cross-currency repayment | [optional] [readonly] +**borrow_type** | **str** | Borrowing type, returned when querying loan records: manual_borrow - Manual borrowing, auto_borrow - Automatic borrowing | [optional] +**currency_pair** | **str** | Currency pair | [optional] [readonly] +**currency** | **str** | Currency | [optional] [readonly] +**amount** | **str** | Borrow or repayment amount | [optional] [readonly] +**create_time** | **int** | Created time | [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/UnifiedLoanResult.md b/docs/UnifiedLoanResult.md new file mode 100644 index 0000000..8db1d72 --- /dev/null +++ b/docs/UnifiedLoanResult.md @@ -0,0 +1,11 @@ +# UnifiedLoanResult + +Unified account borrowing and repayment response result +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tran_id** | **int** | Transaction 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/UnifiedMarginTiers.md b/docs/UnifiedMarginTiers.md new file mode 100644 index 0000000..2f2cad9 --- /dev/null +++ b/docs/UnifiedMarginTiers.md @@ -0,0 +1,12 @@ +# UnifiedMarginTiers + +Unified account borrowing margin tiers +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **str** | Currency name | [optional] +**margin_tiers** | [**list[MarginTiers]**](MarginTiers.md) | Tiered margin | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UnifiedModeSet.md b/docs/UnifiedModeSet.md new file mode 100644 index 0000000..bdfbaa0 --- /dev/null +++ b/docs/UnifiedModeSet.md @@ -0,0 +1,11 @@ +# UnifiedModeSet + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mode** | **str** | Unified account mode: - `classic`: Classic account mode - `multi_currency`: Cross-currency margin mode - `portfolio`: Portfolio margin mode - `single_currency`: Single-currency margin mode | +**settings** | [**UnifiedSettings**](UnifiedSettings.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/UnifiedPortfolioInput.md b/docs/UnifiedPortfolioInput.md new file mode 100644 index 0000000..465188f --- /dev/null +++ b/docs/UnifiedPortfolioInput.md @@ -0,0 +1,17 @@ +# UnifiedPortfolioInput + +Portfolio margin calculator input +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**spot_balances** | [**list[MockSpotBalance]**](MockSpotBalance.md) | Spot | [optional] +**spot_orders** | [**list[MockSpotOrder]**](MockSpotOrder.md) | Spot orders | [optional] +**futures_positions** | [**list[MockFuturesPosition]**](MockFuturesPosition.md) | Futures positions | [optional] +**futures_orders** | [**list[MockFuturesOrder]**](MockFuturesOrder.md) | Futures order | [optional] +**options_positions** | [**list[MockOptionsPosition]**](MockOptionsPosition.md) | Options positions | [optional] +**options_orders** | [**list[MockOptionsOrder]**](MockOptionsOrder.md) | Option orders | [optional] +**spot_hedge** | **bool** | Whether to enable spot hedging | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UnifiedPortfolioOutput.md b/docs/UnifiedPortfolioOutput.md new file mode 100644 index 0000000..08d671a --- /dev/null +++ b/docs/UnifiedPortfolioOutput.md @@ -0,0 +1,14 @@ +# UnifiedPortfolioOutput + +Portfolio margin calculator output +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**maintain_margin_total** | **str** | Total maintenance margin, including only portfolio margin calculation results for positions in risk units, excluding borrowing margin. If borrowing exists, conventional borrowing margin requirements will still apply | [optional] +**initial_margin_total** | **str** | Total initial margin, calculated as the maximum of the following three combinations: position, position + positive delta orders, position + negative delta orders | [optional] +**calculate_time** | **int** | Calculation time | [optional] +**risk_unit** | [**list[MockRiskUnit]**](MockRiskUnit.md) | Risk unit | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UnifiedRiskUnits.md b/docs/UnifiedRiskUnits.md new file mode 100644 index 0000000..ef263da --- /dev/null +++ b/docs/UnifiedRiskUnits.md @@ -0,0 +1,12 @@ +# UnifiedRiskUnits + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_id** | **int** | User ID | [optional] +**spot_hedge** | **bool** | Spot hedging status: true - enabled, false - disabled | [optional] +**risk_units** | [**list[RiskUnits]**](RiskUnits.md) | Risk unit | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UnifiedSettings.md b/docs/UnifiedSettings.md new file mode 100644 index 0000000..96fe971 --- /dev/null +++ b/docs/UnifiedSettings.md @@ -0,0 +1,13 @@ +# UnifiedSettings + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**usdt_futures** | **bool** | USDT futures switch. In cross-currency margin mode, can only be enabled and cannot be disabled | [optional] +**spot_hedge** | **bool** | Spot hedging switch | [optional] +**use_funding** | **bool** | Earn switch, when mode is cross-currency margin mode, whether to use Earn funds as margin | [optional] +**options** | **bool** | Options switch. In cross-currency margin mode, can only be enabled and cannot be disabled | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CrossMarginTransferable.md b/docs/UnifiedTransferable.md similarity index 79% rename from docs/CrossMarginTransferable.md rename to docs/UnifiedTransferable.md index 4e2b0d6..1d07c53 100644 --- a/docs/CrossMarginTransferable.md +++ b/docs/UnifiedTransferable.md @@ -1,10 +1,10 @@ -# CrossMarginTransferable +# UnifiedTransferable ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **currency** | **str** | Currency detail | [optional] -**amount** | **str** | Max transferable amount | [optional] +**amount** | **str** | Maximum transferable 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/UserLtvInfo.md b/docs/UserLtvInfo.md new file mode 100644 index 0000000..1483aff --- /dev/null +++ b/docs/UserLtvInfo.md @@ -0,0 +1,17 @@ +# 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/UserSub.md b/docs/UserSub.md new file mode 100644 index 0000000..c5432f0 --- /dev/null +++ b/docs/UserSub.md @@ -0,0 +1,13 @@ +# UserSub + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uid** | **int** | User ID | [optional] +**belong** | **str** | User's system affiliation (partner/referral). Empty means not belonging to any system | [optional] +**type** | **int** | Type (0-Not in system 1-Direct subordinate agent 2-Indirect subordinate agent 3-Direct direct customer 4-Indirect direct customer 5-Regular user) | [optional] +**ref_uid** | **int** | Inviter user 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/UserSubRelation.md b/docs/UserSubRelation.md new file mode 100644 index 0000000..912227c --- /dev/null +++ b/docs/UserSubRelation.md @@ -0,0 +1,10 @@ +# UserSubRelation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**list** | [**list[UserSub]**](UserSub.md) | Subordinate relationship 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/UserTotalAmount.md b/docs/UserTotalAmount.md new file mode 100644 index 0000000..87460d1 --- /dev/null +++ b/docs/UserTotalAmount.md @@ -0,0 +1,12 @@ +# 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 696cebf..e137cb6 100644 --- a/docs/WalletApi.md +++ b/docs/WalletApi.md @@ -4,17 +4,86 @@ All URIs are relative to *https://api.gateio.ws/api/v4* Method | HTTP request | Description ------------- | ------------- | ------------- +[**list_currency_chains**](WalletApi.md#list_currency_chains) | **GET** /wallet/currency_chains | Query chains supported for specified currency [**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 | Retrieve withdrawal records -[**list_deposits**](WalletApi.md#list_deposits) | **GET** /wallet/deposits | Retrieve deposit records +[**list_withdrawals**](WalletApi.md#list_withdrawals) | **GET** /wallet/withdrawals | Get withdrawal records +[**list_deposits**](WalletApi.md#list_deposits) | **GET** /wallet/deposits | Get deposit records [**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 | Retrieve transfer records between main and sub 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 -[**list_withdraw_status**](WalletApi.md#list_withdraw_status) | **GET** /wallet/withdraw_status | Retrieve withdrawal status -[**list_sub_account_balances**](WalletApi.md#list_sub_account_balances) | **GET** /wallet/sub_account_balances | Retrieve sub account balances -[**get_trade_fee**](WalletApi.md#get_trade_fee) | **GET** /wallet/fee | Retrieve personal trading fee -[**get_total_balance**](WalletApi.md#get_total_balance) | **GET** /wallet/total_balance | Retrieve user's total balances +[**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 +[**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 +[**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 +[**convert_small_balance**](WalletApi.md#convert_small_balance) | **POST** /wallet/small_balance | Convert small balance currency +[**list_small_balance_history**](WalletApi.md#list_small_balance_history) | **GET** /wallet/small_balance_history | Get convertible small balance currency history +[**list_push_orders**](WalletApi.md#list_push_orders) | **GET** /wallet/push | Get UID transfer history + + +# **list_currency_chains** +> list[CurrencyChain] list_currency_chains(currency) + +Query chains supported for specified currency +### 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.WalletApi(api_client) +currency = 'GT' # str | Currency name + +try: + # Query chains supported for specified currency + api_response = api_instance.list_currency_chains(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 WalletApi->list_currency_chains: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currency** | **str**| Currency name | + +### Return type + +[**list[CurrencyChain]**](CurrencyChain.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) # **get_deposit_address** > DepositAddress get_deposit_address(currency) @@ -84,11 +153,11 @@ 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_withdrawals** -> list[LedgerRecord] list_withdrawals(currency=currency, _from=_from, to=to, limit=limit, offset=offset) +> list[WithdrawalRecord] list_withdrawals(currency=currency, withdraw_id=withdraw_id, asset_class=asset_class, withdraw_order_id=withdraw_order_id, _from=_from, to=to, limit=limit, offset=offset) -Retrieve withdrawal records +Get withdrawal records -Record time range cannot exceed 30 days +Record query time range cannot exceed 30 days ### Example @@ -114,15 +183,18 @@ 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 = 'BTC' # str | Filter by currency. Return all currency records if not specified (optional) -_from = 1602120000 # int | Time range beginning, default to 7 days before current time (optional) -to = 1602123600 # int | Time range ending, default to current time (optional) -limit = 100 # int | Maximum number of records to be returned in a single list (optional) (default to 100) +currency = 'BTC' # str | Specify the currency. If not specified, returns all currencies (optional) +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) +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) try: - # Retrieve withdrawal records - api_response = api_instance.list_withdrawals(currency=currency, _from=_from, to=to, limit=limit, offset=offset) + # Get withdrawal records + api_response = api_instance.list_withdrawals(currency=currency, withdraw_id=withdraw_id, asset_class=asset_class, withdraw_order_id=withdraw_order_id, _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)) @@ -134,15 +206,18 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **currency** | **str**| Filter by currency. Return all currency records if not specified | [optional] - **_from** | **int**| Time range beginning, default to 7 days before current time | [optional] - **to** | **int**| Time range ending, default to current time | [optional] - **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] + **currency** | **str**| Specify the currency. If not specified, returns all currencies | [optional] + **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] + **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] ### Return type -[**list[LedgerRecord]**](LedgerRecord.md) +[**list[WithdrawalRecord]**](WithdrawalRecord.md) ### Authorization @@ -156,16 +231,16 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**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_deposits** -> list[LedgerRecord] list_deposits(currency=currency, _from=_from, to=to, limit=limit, offset=offset) +> list[DepositRecord] list_deposits(currency=currency, _from=_from, to=to, limit=limit, offset=offset) -Retrieve deposit records +Get deposit records -Record time range cannot exceed 30 days +Record query time range cannot exceed 30 days ### Example @@ -191,14 +266,14 @@ 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 = 'BTC' # str | Filter by currency. Return all currency records if not specified (optional) -_from = 1602120000 # int | Time range beginning, default to 7 days before current time (optional) -to = 1602123600 # int | Time range ending, default to current time (optional) -limit = 100 # int | Maximum number of records to be returned in a single list (optional) (default to 100) +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) +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) try: - # Retrieve deposit records + # Get deposit records api_response = api_instance.list_deposits(currency=currency, _from=_from, to=to, limit=limit, offset=offset) print(api_response) except GateApiException as ex: @@ -211,15 +286,15 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **currency** | **str**| Filter by currency. Return all currency records if not specified | [optional] - **_from** | **int**| Time range beginning, default to 7 days before current time | [optional] - **to** | **int**| Time range ending, default to current time | [optional] - **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] + **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] + **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] ### Return type -[**list[LedgerRecord]**](LedgerRecord.md) +[**list[DepositRecord]**](DepositRecord.md) ### Authorization @@ -233,16 +308,16 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**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) # **transfer** -> transfer(transfer) +> TransactionID transfer(transfer) Transfer between trading accounts -Transfer between different accounts. Currently support transfers between the following: 1. spot - margin 2. spot - futures(perpetual) 3. spot - delivery 4. spot - cross margin +Balance transfers between personal trading accounts. Currently supports the following transfer operations: 1. Spot account - Margin account 2. Spot account - Perpetual futures account 3. Spot account - Delivery futures account 4. Spot account - Options account ### Example @@ -272,7 +347,8 @@ transfer = gate_api.Transfer() # Transfer | try: # Transfer between trading accounts - api_instance.transfer(transfer) + api_response = api_instance.transfer(transfer) + print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) except ApiException as e: @@ -287,7 +363,7 @@ Name | Type | Description | Notes ### Return type -void (empty response body) +[**TransactionID**](TransactionID.md) ### Authorization @@ -296,21 +372,21 @@ void (empty response body) ### HTTP request headers - **Content-Type**: application/json - - **Accept**: Not defined + - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**204** | Balance transferred | - | +**200** | Transfer operation 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_sub_account_transfers** -> list[SubAccountTransfer] list_sub_account_transfers(sub_uid=sub_uid, _from=_from, to=to, limit=limit, offset=offset) +> list[SubAccountTransferRecordItem] list_sub_account_transfers(sub_uid=sub_uid, _from=_from, to=to, limit=limit, offset=offset) -Retrieve transfer records between main and sub accounts +Get transfer records between main and sub accounts -Record time range cannot exceed 30 days > Note: only records after 2020-04-10 can be retrieved +Record query time range cannot exceed 30 days > Note: Only records after 2020-04-10 can be retrieved ### Example @@ -336,14 +412,14 @@ configuration = gate_api.Configuration( 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. Return records related to all sub accounts if not specified (optional) -_from = 1602120000 # int | Time range beginning, default to 7 days before current time (optional) -to = 1602123600 # int | Time range ending, default to current time (optional) -limit = 100 # int | Maximum number of records to be returned in a single list (optional) (default to 100) +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) +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) try: - # Retrieve transfer records between main and sub accounts + # Get transfer records between main and sub accounts api_response = api_instance.list_sub_account_transfers(sub_uid=sub_uid, _from=_from, to=to, limit=limit, offset=offset) print(api_response) except GateApiException as ex: @@ -356,15 +432,15 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **sub_uid** | **str**| Sub account user ID. Return records related to all sub accounts if not specified | [optional] - **_from** | **int**| Time range beginning, default to 7 days before current time | [optional] - **to** | **int**| Time range ending, default to current time | [optional] - **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] + **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] + **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] ### Return type -[**list[SubAccountTransfer]**](SubAccountTransfer.md) +[**list[SubAccountTransferRecordItem]**](SubAccountTransferRecordItem.md) ### Authorization @@ -378,16 +454,16 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**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) # **transfer_with_sub_account** -> transfer_with_sub_account(sub_account_transfer) +> TransactionID transfer_with_sub_account(sub_account_transfer) Transfer between main and sub accounts -Support transferring with sub user's spot or futures account. Note that only main user's spot account is used no matter which sub user's account is operated. +Supports transfers to/from sub-account's spot or futures accounts. Note that regardless of which sub-account is operated, only the main account's spot account is used ### Example @@ -417,7 +493,8 @@ sub_account_transfer = gate_api.SubAccountTransfer() # SubAccountTransfer | try: # Transfer between main and sub accounts - api_instance.transfer_with_sub_account(sub_account_transfer) + api_response = api_instance.transfer_with_sub_account(sub_account_transfer) + print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) except ApiException as e: @@ -432,7 +509,7 @@ Name | Type | Description | Notes ### Return type -void (empty response body) +[**TransactionID**](TransactionID.md) ### Authorization @@ -441,19 +518,159 @@ void (empty response body) ### HTTP request headers - **Content-Type**: application/json - - **Accept**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Transfer operation 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) + +# **sub_account_to_sub_account** +> TransactionID sub_account_to_sub_account(sub_account_to_sub_account) + +Transfer between sub-accounts + +Supports balance transfers between two sub-accounts under the same main account. You can use either the main account's API Key or the source sub-account's API Key to perform the operation + +### 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) +sub_account_to_sub_account = gate_api.SubAccountToSubAccount() # SubAccountToSubAccount | + +try: + # Transfer between sub-accounts + api_response = api_instance.sub_account_to_sub_account(sub_account_to_sub_account) + 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->sub_account_to_sub_account: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **sub_account_to_sub_account** | [**SubAccountToSubAccount**](SubAccountToSubAccount.md)| | + +### Return type + +[**TransactionID**](TransactionID.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** | Transfer operation 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_transfer_order_status** +> TransferOrderStatus get_transfer_order_status(client_order_id=client_order_id, tx_id=tx_id) + +Transfer status query + +Supports querying transfer status based on user-defined client_order_id or tx_id returned by the transfer interface + +### 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) +client_order_id = 'da3ce7a088c8b0372b741419c7829033' # 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) +tx_id = '59636381286' # str | Transfer operation number, cannot be empty at the same time as client_order_id (optional) + +try: + # 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: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling WalletApi->get_transfer_order_status: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **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] + **tx_id** | **str**| Transfer operation number, cannot be empty at the same time as client_order_id | [optional] + +### Return type + +[**TransferOrderStatus**](TransferOrderStatus.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**204** | Balance transferred | - | +**200** | Transfer status 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_withdraw_status** > list[WithdrawStatus] list_withdraw_status(currency=currency) -Retrieve withdrawal status +Query withdrawal status ### Example @@ -479,10 +696,10 @@ 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 = 'BTC' # str | Retrieve data of the specified currency (optional) +currency = 'BTC' # str | Query by specified currency name (optional) try: - # Retrieve withdrawal status + # Query withdrawal status api_response = api_instance.list_withdraw_status(currency=currency) print(api_response) except GateApiException as ex: @@ -495,7 +712,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **currency** | **str**| Retrieve data of the specified currency | [optional] + **currency** | **str**| Query by specified currency name | [optional] ### Return type @@ -513,14 +730,14 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**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_sub_account_balances** > list[SubAccountBalance] list_sub_account_balances(sub_uid=sub_uid) -Retrieve sub account balances +Query sub-account balance information ### Example @@ -546,10 +763,10 @@ configuration = gate_api.Configuration( 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. Return records related to all sub accounts if not specified (optional) +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) try: - # Retrieve sub account balances + # Query sub-account balance information api_response = api_instance.list_sub_account_balances(sub_uid=sub_uid) print(api_response) except GateApiException as ex: @@ -562,7 +779,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **sub_uid** | **str**| Sub account user ID. Return records related to all sub accounts if not specified | [optional] + **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] ### Return type @@ -580,14 +797,14 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved | - | +**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_trade_fee** -> TradeFee get_trade_fee(currency_pair=currency_pair) +# **list_sub_account_margin_balances** +> list[SubAccountMarginBalance] list_sub_account_margin_balances(sub_uid=sub_uid) -Retrieve personal trading fee +Query sub-account isolated margin account balance information ### Example @@ -613,27 +830,27 @@ 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_pair = 'BTC_USDT' # str | Specify a currency pair to retrieve precise fee rate This field is optional. In most cases, the fee rate is identical among all currency pairs (optional) +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) try: - # Retrieve personal trading fee - api_response = api_instance.get_trade_fee(currency_pair=currency_pair) + # Query sub-account isolated margin account balance information + api_response = api_instance.list_sub_account_margin_balances(sub_uid=sub_uid) 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_trade_fee: %s\n" % e) + print("Exception when calling WalletApi->list_sub_account_margin_balances: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **currency_pair** | **str**| Specify a currency pair to retrieve precise fee rate This field is optional. In most cases, the fee rate is identical among all currency pairs | [optional] + **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] ### Return type -[**TradeFee**](TradeFee.md) +[**list[SubAccountMarginBalance]**](SubAccountMarginBalance.md) ### Authorization @@ -647,14 +864,14 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**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_total_balance** -> TotalBalance get_total_balance(currency=currency) +# **list_sub_account_futures_balances** +> list[SubAccountFuturesBalance] list_sub_account_futures_balances(sub_uid=sub_uid, settle=settle) -Retrieve user's total balances +Query sub-account perpetual futures account balance information ### Example @@ -680,27 +897,584 @@ 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 unit used to calculate the balance amount. BTC, CNY, USD and USDT are allowed. USDT is the default. (optional) (default to 'USDT') +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) +settle = 'usdt' # str | Query balance of specified settlement currency (optional) try: - # Retrieve user's total balances - api_response = api_instance.get_total_balance(currency=currency) + # Query sub-account perpetual futures account balance information + api_response = api_instance.list_sub_account_futures_balances(sub_uid=sub_uid, settle=settle) 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_total_balance: %s\n" % e) + print("Exception when calling WalletApi->list_sub_account_futures_balances: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **currency** | **str**| Currency unit used to calculate the balance amount. BTC, CNY, USD and USDT are allowed. USDT is the default. | [optional] [default to 'USDT'] + **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] + **settle** | **str**| Query balance of specified settlement currency | [optional] ### Return type -[**TotalBalance**](TotalBalance.md) +[**list[SubAccountFuturesBalance]**](SubAccountFuturesBalance.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_sub_account_cross_margin_balances** +> list[SubAccountCrossMarginBalance] list_sub_account_cross_margin_balances(sub_uid=sub_uid) + +Query sub-account cross margin account balance 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.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) + +try: + # Query sub-account cross margin account balance information + api_response = api_instance.list_sub_account_cross_margin_balances(sub_uid=sub_uid) + 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->list_sub_account_cross_margin_balances: %s\n" % e) +``` + +### Parameters + +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] + +### Return type + +[**list[SubAccountCrossMarginBalance]**](SubAccountCrossMarginBalance.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_saved_address** +> list[SavedAddress] list_saved_address(currency, chain=chain, limit=limit, page=page) + +Query withdrawal address whitelist + +### 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) +currency = 'USDT' # str | Currency +chain = '' # str | Chain name (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) + +try: + # Query withdrawal address whitelist + api_response = api_instance.list_saved_address(currency, chain=chain, 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 WalletApi->list_saved_address: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currency** | **str**| Currency | + **chain** | **str**| Chain name | [optional] [default to ''] + **limit** | **str**| Maximum number returned, up to 100 | [optional] [default to '50'] + **page** | **int**| Page number | [optional] [default to 1] + +### Return type + +[**list[SavedAddress]**](SavedAddress.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) + +# **get_trade_fee** +> TradeFee get_trade_fee(currency_pair=currency_pair, settle=settle) + +Query personal trading fees + +### 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) +currency_pair = 'BTC_USDT' # str | Specify currency pair to get more accurate fee settings. This field is optional. Usually fee settings are the same for all currency pairs. (optional) +settle = 'BTC' # str | Specify the settlement currency of the contract to get more accurate fee settings. This field is optional. Generally, the fee settings for all settlement currencies are the same. (optional) + +try: + # Query personal trading fees + api_response = api_instance.get_trade_fee(currency_pair=currency_pair, settle=settle) + 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_trade_fee: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currency_pair** | **str**| Specify currency pair to get more accurate fee settings. This field is optional. Usually fee settings are the same for all currency pairs. | [optional] + **settle** | **str**| Specify the settlement currency of the contract to get more accurate fee settings. This field is optional. Generally, the fee settings for all settlement currencies are the same. | [optional] + +### Return type + +[**TradeFee**](TradeFee.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_total_balance** +> TotalBalance get_total_balance(currency=currency) + +Query personal account totals + +This query endpoint returns the total *estimated value* of all currencies in each account converted to the input currency. Exchange rates and related account balance information may be cached for up to 1 minute. It is not recommended to use this interface data for real-time calculations. For real-time calculations, query the corresponding balance interface based on account type, such as: - `GET /spot/accounts` to query spot account - `GET /margin/accounts` to query margin account - `GET /futures/{settle}/accounts` to query futures account + +### 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) +currency = 'USDT' # str | Target currency type for statistical conversion. Accepts BTC, CNY, USD, and USDT. USDT is the default value (optional) (default to 'USDT') + +try: + # Query personal account totals + api_response = api_instance.get_total_balance(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 WalletApi->get_total_balance: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currency** | **str**| Target currency type for statistical conversion. Accepts BTC, CNY, USD, and USDT. USDT is the default value | [optional] [default to 'USDT'] + +### Return type + +[**TotalBalance**](TotalBalance.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 is valid and successfully returned | - | + +[[Back to top]](#) [[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_small_balance** +> list[SmallBalance] list_small_balance() + +Get list of convertible small balance currencies + +### 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) + +try: + # Get list of convertible small balance currencies + api_response = api_instance.list_small_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 WalletApi->list_small_balance: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**list[SmallBalance]**](SmallBalance.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** | 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) + +# **convert_small_balance** +> convert_small_balance(convert_small_balance) + +Convert small balance currency + +### 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) +convert_small_balance = gate_api.ConvertSmallBalance() # ConvertSmallBalance | + +try: + # Convert small balance currency + api_instance.convert_small_balance(convert_small_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 WalletApi->convert_small_balance: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **convert_small_balance** | [**ConvertSmallBalance**](ConvertSmallBalance.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** | 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) + +# **list_small_balance_history** +> list[SmallBalanceHistory] list_small_balance_history(currency=currency, page=page, limit=limit) + +Get convertible small balance currency 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.WalletApi(api_client) +currency = 'currency_example' # str | Currency to convert (optional) +page = 1 # int | Page number (optional) (default to 1) +limit = 100 # int | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 (optional) (default to 100) + +try: + # Get convertible small balance currency history + api_response = api_instance.list_small_balance_history(currency=currency, 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 WalletApi->list_small_balance_history: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currency** | **str**| Currency to convert | [optional] + **page** | **int**| Page number | [optional] [default to 1] + **limit** | **int**| Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 | [optional] [default to 100] + +### Return type + +[**list[SmallBalanceHistory]**](SmallBalanceHistory.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** | 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) + +# **list_push_orders** +> list[UidPushOrder] list_push_orders(id=id, _from=_from, to=to, limit=limit, offset=offset, transaction_type=transaction_type) + +Get UID transfer 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.WalletApi(api_client) +id = 56 # int | Order ID (optional) +_from = 56 # int | Start time for querying records. If not specified, defaults to 7 days before the current time. Unix timestamp in seconds (optional) +to = 56 # int | End time for querying records. If not specified, defaults to the current time. Unix timestamp in seconds (optional) +limit = 100 # int | Maximum number of items returned in the list, default value is 100 (optional) (default to 100) +offset = 0 # int | List offset, starting from 0 (optional) (default to 0) +transaction_type = 'withdraw' # str | Order type returned in the list: `withdraw`, `deposit`. Default is `withdraw`. (optional) (default to 'withdraw') + +try: + # Get UID transfer history + api_response = api_instance.list_push_orders(id=id, _from=_from, to=to, limit=limit, offset=offset, transaction_type=transaction_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 WalletApi->list_push_orders: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| Order ID | [optional] + **_from** | **int**| Start time for querying records. If not specified, defaults to 7 days before the current time. Unix timestamp in seconds | [optional] + **to** | **int**| End time for querying records. If not specified, defaults to the current time. Unix timestamp in seconds | [optional] + **limit** | **int**| Maximum number of items returned in the list, default value is 100 | [optional] [default to 100] + **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] + **transaction_type** | **str**| Order type returned in the list: `withdraw`, `deposit`. Default is `withdraw`. | [optional] [default to 'withdraw'] + +### Return type + +[**list[UidPushOrder]**](UidPushOrder.md) ### Authorization @@ -714,7 +1488,7 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Request is valid and is successfully responded | - | +**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) diff --git a/docs/WithdrawStatus.md b/docs/WithdrawStatus.md index a7f1755..38ade7b 100644 --- a/docs/WithdrawStatus.md +++ b/docs/WithdrawStatus.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes **currency** | **str** | Currency | [optional] **name** | **str** | Currency name | [optional] **name_cn** | **str** | Currency Chinese name | [optional] -**deposit** | **str** | Deposits fee | [optional] +**deposit** | **str** | Deposit fee | [optional] **withdraw_percent** | **str** | Withdrawal fee rate percentage | [optional] **withdraw_fix** | **str** | Fixed withdrawal fee | [optional] **withdraw_day_limit** | **str** | Daily allowed withdrawal amount | [optional] @@ -14,6 +14,7 @@ Name | Type | Description | Notes **withdraw_day_limit_remain** | **str** | Daily withdrawal amount left | [optional] **withdraw_eachtime_limit** | **str** | Maximum amount for each withdrawal | [optional] **withdraw_fix_on_chains** | **dict(str, str)** | Fixed withdrawal fee on multiple chains | [optional] +**withdraw_percent_on_chains** | **dict(str, str)** | Percentage withdrawal fee on multiple chains | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/WithdrawalApi.md b/docs/WithdrawalApi.md index eedfba4..1c49178 100644 --- a/docs/WithdrawalApi.md +++ b/docs/WithdrawalApi.md @@ -5,6 +5,7 @@ All URIs are relative to *https://api.gateio.ws/api/v4* Method | HTTP request | Description ------------- | ------------- | ------------- [**withdraw**](WithdrawalApi.md#withdraw) | **POST** /withdrawals | Withdraw +[**withdraw_push_order**](WithdrawalApi.md#withdraw_push_order) | **POST** /withdrawals/push | UID transfer [**cancel_withdrawal**](WithdrawalApi.md#cancel_withdrawal) | **DELETE** /withdrawals/{withdrawal_id} | Cancel withdrawal with specified ID @@ -13,6 +14,8 @@ Method | HTTP request | Description Withdraw +If the recipient's on-chain address is also Gate, no transaction fee will be charged + ### Example * Api Key Authentication (apiv4): @@ -71,7 +74,76 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**202** | Withdraw request is accepted. Refer to withdrawal records for status | - | +**200** | Withdrawal request accepted. Check withdrawal record status for processing result | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **withdraw_push_order** +> UidPushWithdrawalResp withdraw_push_order(uid_push_withdrawal) + +UID transfer + +Transfers between main spot accounts. Both parties cannot be sub-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.WithdrawalApi(api_client) +uid_push_withdrawal = gate_api.UidPushWithdrawal() # UidPushWithdrawal | + +try: + # UID transfer + api_response = api_instance.withdraw_push_order(uid_push_withdrawal) + 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 WithdrawalApi->withdraw_push_order: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **uid_push_withdrawal** | [**UidPushWithdrawal**](UidPushWithdrawal.md)| | + +### Return type + +[**UidPushWithdrawalResp**](UidPushWithdrawalResp.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 accepted. Check withdrawal record status for processing result | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -138,7 +210,7 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**202** | Cancellation accepted. Refer to record status for the cancellation result | - | +**202** | Cancellation request accepted. Check record status for cancellation result | - | [[Back to top]](#) [[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 new file mode 100644 index 0000000..9cb30af --- /dev/null +++ b/docs/WithdrawalRecord.md @@ -0,0 +1,23 @@ +# WithdrawalRecord + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Record ID | [optional] [readonly] +**txid** | **str** | Hash record of the withdrawal | [optional] [readonly] +**block_number** | **str** | Block Number | [optional] [readonly] +**withdraw_order_id** | **str** | Client order id, up to 32 length and can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) | [optional] +**timestamp** | **str** | Operation time | [optional] [readonly] +**amount** | **str** | Token amount | +**fee** | **str** | fee | [optional] [readonly] +**currency** | **str** | Currency name | +**address** | **str** | Withdrawal address | [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] +**memo** | **str** | Additional remarks with regards to the withdrawal | [optional] +**status** | **str** | Transaction status - DONE: Completed (block_number > 0 is considered to be truly completed) - CANCEL: Canceled - REQUEST: Requesting - MANUAL: Pending manual review - BCODE: Recharge code operation - EXTPEND: Sent awaiting confirmation - FAIL: Failure on the chain awaiting confirmation - INVALID: Invalid order - VERIFY: Verifying - PROCES: Processing - PEND: Processing - DMOVE: pending manual review - 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/spot.py b/example/spot.py index 7c3b979..e9c6d04 100644 --- a/example/spot.py +++ b/example/spot.py @@ -21,7 +21,7 @@ def spot_demo(run_config): spot_api = SpotApi(ApiClient(config)) pair = spot_api.get_currency_pair(currency_pair) logger.info("testing against currency pair: " + currency_pair) - min_amount = pair.min_quote_amount + min_amount = pair.min_base_amount # get last price tickers = spot_api.list_tickers(currency_pair=currency_pair) diff --git a/gate_api/__init__.py b/gate_api/__init__.py index 0d914ea..060b069 100644 --- a/gate_api/__init__.py +++ b/gate_api/__init__.py @@ -3,23 +3,34 @@ # flake8: noqa """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ from __future__ import absolute_import -__version__ = "4.22.4" +__version__ = "7.1.8" # import apis into sdk package +from gate_api.api.earn_uni_api import EarnUniApi +from gate_api.api.margin_uni_api import MarginUniApi +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.delivery_api import DeliveryApi +from gate_api.api.earn_api import EarnApi +from gate_api.api.flash_swap_api import FlashSwapApi from gate_api.api.futures_api import FuturesApi 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.rebate_api import RebateApi from gate_api.api.spot_api import SpotApi from gate_api.api.wallet_api import WalletApi from gate_api.api.withdrawal_api import WithdrawalApi @@ -32,75 +43,259 @@ from gate_api.exceptions import ApiValueError from gate_api.exceptions import ApiKeyError from gate_api.exceptions import ApiException - # import models into sdk package from gate_api.models.account_balance import AccountBalance +from gate_api.models.account_detail import AccountDetail +from gate_api.models.account_detail_key import AccountDetailKey +from gate_api.models.account_rate_limit import AccountRateLimit +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.auto_repay_setting import AutoRepaySetting +from gate_api.models.batch_amend_item import BatchAmendItem +from gate_api.models.batch_amend_order_req import BatchAmendOrderReq +from gate_api.models.batch_futures_order import BatchFuturesOrder from gate_api.models.batch_order import BatchOrder -from gate_api.models.cancel_order import CancelOrder +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_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.cancel_batch_order import CancelBatchOrder from gate_api.models.cancel_order_result import CancelOrderResult +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.contract import Contract from gate_api.models.contract_stat import ContractStat -from gate_api.models.cross_margin_account import CrossMarginAccount -from gate_api.models.cross_margin_account_book import CrossMarginAccountBook +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_multi_collateral_order import CreateMultiCollateralOrder +from gate_api.models.create_uni_lend import CreateUniLend +from gate_api.models.create_uni_loan import CreateUniLoan from gate_api.models.cross_margin_balance import CrossMarginBalance -from gate_api.models.cross_margin_borrowable import CrossMarginBorrowable -from gate_api.models.cross_margin_currency import CrossMarginCurrency from gate_api.models.cross_margin_loan import CrossMarginLoan -from gate_api.models.cross_margin_repay_request import CrossMarginRepayRequest from gate_api.models.cross_margin_repayment import CrossMarginRepayment -from gate_api.models.cross_margin_transferable import CrossMarginTransferable 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.delivery_candlestick import DeliveryCandlestick from gate_api.models.delivery_contract import DeliveryContract from gate_api.models.delivery_settlement import DeliverySettlement +from gate_api.models.delivery_ticker import DeliveryTicker from gate_api.models.deposit_address import DepositAddress +from gate_api.models.deposit_record import DepositRecord +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.flash_swap_currency_pair import FlashSwapCurrencyPair +from gate_api.models.flash_swap_order import FlashSwapOrder +from gate_api.models.flash_swap_order_preview import FlashSwapOrderPreview +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 -from gate_api.models.funding_book_item import FundingBookItem from gate_api.models.funding_rate_record import FundingRateRecord +from gate_api.models.future_cancel_order_result import FutureCancelOrderResult from gate_api.models.futures_account import FuturesAccount from gate_api.models.futures_account_book import FuturesAccountBook +from gate_api.models.futures_account_history import FuturesAccountHistory +from gate_api.models.futures_auto_deleverage import FuturesAutoDeleverage +from gate_api.models.futures_batch_amend_order_request import FuturesBatchAmendOrderRequest from gate_api.models.futures_candlestick import FuturesCandlestick +from gate_api.models.futures_fee import FuturesFee +from gate_api.models.futures_index_constituents import FuturesIndexConstituents from gate_api.models.futures_initial_order import FuturesInitialOrder +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 from gate_api.models.futures_order import FuturesOrder +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_position_cross_mode import FuturesPositionCrossMode +from gate_api.models.futures_premium_index import FuturesPremiumIndex from gate_api.models.futures_price_trigger import FuturesPriceTrigger from gate_api.models.futures_price_triggered_order import FuturesPriceTriggeredOrder +from gate_api.models.futures_risk_limit_tier import FuturesRiskLimitTier from gate_api.models.futures_ticker import FuturesTicker from gate_api.models.futures_trade import FuturesTrade +from gate_api.models.index_constituent import IndexConstituent +from gate_api.models.inline_object import InlineObject +from gate_api.models.inline_response200 import InlineResponse200 +from gate_api.models.inline_response2001 import InlineResponse2001 from gate_api.models.insurance_record import InsuranceRecord from gate_api.models.ledger_record import LedgerRecord -from gate_api.models.loan import Loan -from gate_api.models.loan_patch import LoanPatch -from gate_api.models.loan_record import LoanRecord +from gate_api.models.liquidate_order import LiquidateOrder 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_borrowable import MarginBorrowable -from gate_api.models.margin_currency_pair import MarginCurrencyPair +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 from gate_api.models.margin_transferable import MarginTransferable +from gate_api.models.max_uni_borrowable import MaxUniBorrowable +from gate_api.models.mock_futures_order import MockFuturesOrder +from gate_api.models.mock_futures_position import MockFuturesPosition +from gate_api.models.mock_margin_result import MockMarginResult +from gate_api.models.mock_options_order import MockOptionsOrder +from gate_api.models.mock_options_position import MockOptionsPosition +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.multi_chain_address_item import MultiChainAddressItem +from gate_api.models.multi_collateral_currency import MultiCollateralCurrency +from gate_api.models.multi_collateral_item import MultiCollateralItem +from gate_api.models.multi_collateral_order import MultiCollateralOrder +from gate_api.models.multi_collateral_record import MultiCollateralRecord +from gate_api.models.multi_collateral_record_currency import MultiCollateralRecordCurrency +from gate_api.models.multi_loan_item import MultiLoanItem +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_futures_trade import MyFuturesTrade +from gate_api.models.my_futures_trade_time_range import MyFuturesTradeTimeRange from gate_api.models.open_orders import OpenOrders +from gate_api.models.options_account import OptionsAccount +from gate_api.models.options_account_book import OptionsAccountBook +from gate_api.models.options_candlestick import OptionsCandlestick +from gate_api.models.options_contract import OptionsContract +from gate_api.models.options_mmp import OptionsMMP +from gate_api.models.options_mmp_reset import OptionsMMPReset +from gate_api.models.options_my_settlements import OptionsMySettlements +from gate_api.models.options_my_trade import OptionsMyTrade +from gate_api.models.options_order import OptionsOrder +from gate_api.models.options_position import OptionsPosition +from gate_api.models.options_position_close import OptionsPositionClose +from gate_api.models.options_position_close_order import OptionsPositionCloseOrder +from gate_api.models.options_settlement import OptionsSettlement +from gate_api.models.options_ticker import OptionsTicker +from gate_api.models.options_underlying import OptionsUnderlying +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_cancel import OrderCancel +from gate_api.models.order_patch import OrderPatch +from gate_api.models.order_resp import OrderResp +from gate_api.models.partner_commission_history import PartnerCommissionHistory +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_dual_investment_order import PlaceDualInvestmentOrder 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.repay_request import RepayRequest -from gate_api.models.repayment import Repayment +from gate_api.models.profit_loss_range import ProfitLossRange +from gate_api.models.rebate_user_info import RebateUserInfo +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.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_insurance_history import SpotInsuranceHistory 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.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.sub_account import SubAccount from gate_api.models.sub_account_balance import SubAccountBalance +from gate_api.models.sub_account_cross_margin_balance import SubAccountCrossMarginBalance +from gate_api.models.sub_account_futures_balance import SubAccountFuturesBalance +from gate_api.models.sub_account_key import SubAccountKey +from gate_api.models.sub_account_key_perms import SubAccountKeyPerms +from gate_api.models.sub_account_margin_balance import SubAccountMarginBalance +from gate_api.models.sub_account_to_sub_account import SubAccountToSubAccount from gate_api.models.sub_account_transfer import SubAccountTransfer +from gate_api.models.sub_account_transfer_record_item import SubAccountTransferRecordItem +from gate_api.models.sub_cross_margin_account import SubCrossMarginAccount +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.system_time import SystemTime from gate_api.models.ticker import Ticker from gate_api.models.total_balance import TotalBalance from gate_api.models.trade import Trade from gate_api.models.trade_fee import TradeFee +from gate_api.models.transaction_id import TransactionID from gate_api.models.transfer import Transfer +from gate_api.models.transfer_order_status import TransferOrderStatus +from gate_api.models.transferables_result import TransferablesResult from gate_api.models.trigger_order_response import TriggerOrderResponse +from gate_api.models.trigger_time import TriggerTime +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_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_interest_record import UniInterestRecord +from gate_api.models.uni_lend import UniLend +from gate_api.models.uni_lend_interest import UniLendInterest +from gate_api.models.uni_lend_record import UniLendRecord +from gate_api.models.uni_loan import UniLoan +from gate_api.models.uni_loan_interest_record import UniLoanInterestRecord +from gate_api.models.uni_loan_record import UniLoanRecord +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 +from gate_api.models.unified_discount import UnifiedDiscount +from gate_api.models.unified_discount_tiers import UnifiedDiscountTiers +from gate_api.models.unified_history_loan_rate import UnifiedHistoryLoanRate +from gate_api.models.unified_history_loan_rate_rates import UnifiedHistoryLoanRateRates +from gate_api.models.unified_leverage_config import UnifiedLeverageConfig +from gate_api.models.unified_leverage_setting import UnifiedLeverageSetting +from gate_api.models.unified_loan import UnifiedLoan +from gate_api.models.unified_loan_record import UnifiedLoanRecord +from gate_api.models.unified_loan_result import UnifiedLoanResult +from gate_api.models.unified_margin_tiers import UnifiedMarginTiers +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_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.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 + diff --git a/gate_api/api/__init__.py b/gate_api/api/__init__.py index bc2d074..6cd727a 100644 --- a/gate_api/api/__init__.py +++ b/gate_api/api/__init__.py @@ -3,9 +3,20 @@ # flake8: noqa # import apis into api package +from gate_api.api.earn_uni_api import EarnUniApi +from gate_api.api.margin_uni_api import MarginUniApi +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.delivery_api import DeliveryApi +from gate_api.api.earn_api import EarnApi +from gate_api.api.flash_swap_api import FlashSwapApi from gate_api.api.futures_api import FuturesApi 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.rebate_api import RebateApi from gate_api.api.spot_api import SpotApi from gate_api.api.wallet_api import WalletApi from gate_api.api.withdrawal_api import WithdrawalApi diff --git a/gate_api/api/account_api.py b/gate_api/api/account_api.py new file mode 100644 index 0000000..5f381d6 --- /dev/null +++ b/gate_api/api/account_api.py @@ -0,0 +1,1054 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market 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 AccountApi(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_account_detail(self, **kwargs): # noqa: E501 + """Retrieve user 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.get_account_detail(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.AccountDetail + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_account_detail_with_http_info(**kwargs) # noqa: E501 + + def get_account_detail_with_http_info(self, **kwargs): # noqa: E501 + """Retrieve user 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.get_account_detail_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.AccountDetail, 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_account_detail" % 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( + '/account/detail', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AccountDetail', # 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_account_rate_limit(self, **kwargs): # noqa: E501 + """Get user transaction rate limit 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.get_account_rate_limit(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.AccountRateLimit] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_account_rate_limit_with_http_info(**kwargs) # noqa: E501 + + def get_account_rate_limit_with_http_info(self, **kwargs): # noqa: E501 + """Get user transaction rate limit 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.get_account_rate_limit_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.AccountRateLimit], 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_account_rate_limit" % 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( + '/account/rate_limit', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[AccountRateLimit]', # 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_stp_groups(self, **kwargs): # noqa: E501 + """Query STP user groups created by the user # noqa: E501 + + Only query STP user groups created by the current main account # 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_stp_groups(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str name: Fuzzy search by 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.StpGroup] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_stp_groups_with_http_info(**kwargs) # noqa: E501 + + def list_stp_groups_with_http_info(self, **kwargs): # noqa: E501 + """Query STP user groups created by the user # noqa: E501 + + Only query STP user groups created by the current main account # 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_stp_groups_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str name: Fuzzy search by 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.StpGroup], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'name' + ] + 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_stp_groups" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'name' in local_var_params and local_var_params['name'] is not None: # noqa: E501 + query_params.append(('name', local_var_params['name'])) # 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( + '/account/stp_groups', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[StpGroup]', # 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_stp_group(self, stp_group, **kwargs): # noqa: E501 + """Create STP user group # noqa: E501 + + Only the main account is allowed to create a new STP user group # 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_stp_group(stp_group, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param StpGroup stp_group: (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.StpGroup + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.create_stp_group_with_http_info(stp_group, **kwargs) # noqa: E501 + + def create_stp_group_with_http_info(self, stp_group, **kwargs): # noqa: E501 + """Create STP user group # noqa: E501 + + Only the main account is allowed to create a new STP user group # 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_stp_group_with_http_info(stp_group, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param StpGroup stp_group: (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.StpGroup, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'stp_group' + ] + 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_stp_group" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'stp_group' is set + if self.api_client.client_side_validation and ('stp_group' not in local_var_params or # noqa: E501 + local_var_params['stp_group'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `stp_group` when calling `create_stp_group`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'stp_group' in local_var_params: + body_params = local_var_params['stp_group'] + # 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( + '/account/stp_groups', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='StpGroup', # 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_stp_groups_users(self, stp_id, **kwargs): # noqa: E501 + """Query users in the STP user group # noqa: E501 + + Only the main account that created this STP group can query the account ID list in the current STP group # 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_stp_groups_users(stp_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int stp_id: STP Group 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.StpGroupUser] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_stp_groups_users_with_http_info(stp_id, **kwargs) # noqa: E501 + + def list_stp_groups_users_with_http_info(self, stp_id, **kwargs): # noqa: E501 + """Query users in the STP user group # noqa: E501 + + Only the main account that created this STP group can query the account ID list in the current STP group # 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_stp_groups_users_with_http_info(stp_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int stp_id: STP Group 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.StpGroupUser], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'stp_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_stp_groups_users" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'stp_id' is set + if self.api_client.client_side_validation and ('stp_id' not in local_var_params or # noqa: E501 + local_var_params['stp_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `stp_id` when calling `list_stp_groups_users`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'stp_id' in local_var_params: + path_params['stp_id'] = local_var_params['stp_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( + '/account/stp_groups/{stp_id}/users', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[StpGroupUser]', # 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_stp_group_users(self, stp_id, request_body, **kwargs): # noqa: E501 + """Add users to the STP user group # noqa: E501 + + - Only the main account that created this STP group can add users to the STP user group - Only accounts under the current main account are allowed, cross-main account is not permitted # 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_stp_group_users(stp_id, request_body, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int stp_id: STP Group ID (required) + :param list[int] request_body: User 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.StpGroupUser] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.add_stp_group_users_with_http_info(stp_id, request_body, **kwargs) # noqa: E501 + + def add_stp_group_users_with_http_info(self, stp_id, request_body, **kwargs): # noqa: E501 + """Add users to the STP user group # noqa: E501 + + - Only the main account that created this STP group can add users to the STP user group - Only accounts under the current main account are allowed, cross-main account is not permitted # 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_stp_group_users_with_http_info(stp_id, request_body, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int stp_id: STP Group ID (required) + :param list[int] request_body: User 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.StpGroupUser], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'stp_id', + 'request_body' + ] + 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_stp_group_users" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'stp_id' is set + if self.api_client.client_side_validation and ('stp_id' not in local_var_params or # noqa: E501 + local_var_params['stp_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `stp_id` when calling `add_stp_group_users`") # 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 `add_stp_group_users`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'stp_id' in local_var_params: + path_params['stp_id'] = local_var_params['stp_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + 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( + '/account/stp_groups/{stp_id}/users', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[StpGroupUser]', # 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_stp_group_users(self, stp_id, user_id, **kwargs): # noqa: E501 + """Delete users from the STP user group # noqa: E501 + + - Only the main account that created this STP group is allowed to delete users from the STP user group - Deletion is limited to accounts under the current main account; cross-account deletion is not permitted # 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_stp_group_users(stp_id, user_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int stp_id: STP Group ID (required) + :param int user_id: STP user IDs, multiple IDs can be separated by commas (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.StpGroupUser] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.delete_stp_group_users_with_http_info(stp_id, user_id, **kwargs) # noqa: E501 + + def delete_stp_group_users_with_http_info(self, stp_id, user_id, **kwargs): # noqa: E501 + """Delete users from the STP user group # noqa: E501 + + - Only the main account that created this STP group is allowed to delete users from the STP user group - Deletion is limited to accounts under the current main account; cross-account deletion is not permitted # 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_stp_group_users_with_http_info(stp_id, user_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int stp_id: STP Group ID (required) + :param int user_id: STP user IDs, multiple IDs can be separated by commas (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.StpGroupUser], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'stp_id', + 'user_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_stp_group_users" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'stp_id' is set + if self.api_client.client_side_validation and ('stp_id' not in local_var_params or # noqa: E501 + local_var_params['stp_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `stp_id` when calling `delete_stp_group_users`") # noqa: E501 + # verify the required parameter 'user_id' is set + if self.api_client.client_side_validation and ('user_id' not in local_var_params or # noqa: E501 + local_var_params['user_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `user_id` when calling `delete_stp_group_users`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'stp_id' in local_var_params: + path_params['stp_id'] = local_var_params['stp_id'] # noqa: E501 + + query_params = [] + if 'user_id' in local_var_params and local_var_params['user_id'] is not None: # noqa: E501 + query_params.append(('user_id', local_var_params['user_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( + '/account/stp_groups/{stp_id}/users', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[StpGroupUser]', # 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_debit_fee(self, **kwargs): # noqa: E501 + """Query GT fee deduction configuration # noqa: E501 + + Query the GT fee deduction configuration for the current account # 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_debit_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: gate_api.DebitFee + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_debit_fee_with_http_info(**kwargs) # noqa: E501 + + def get_debit_fee_with_http_info(self, **kwargs): # noqa: E501 + """Query GT fee deduction configuration # noqa: E501 + + Query the GT fee deduction configuration for the current account # 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_debit_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(gate_api.DebitFee, 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_debit_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( + '/account/debit_fee', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='DebitFee', # 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_debit_fee(self, debit_fee, **kwargs): # noqa: E501 + """Configure GT fee deduction # noqa: E501 + + Enable or disable GT fee deduction for the current account # 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_debit_fee(debit_fee, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param DebitFee debit_fee: (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.set_debit_fee_with_http_info(debit_fee, **kwargs) # noqa: E501 + + def set_debit_fee_with_http_info(self, debit_fee, **kwargs): # noqa: E501 + """Configure GT fee deduction # noqa: E501 + + Enable or disable GT fee deduction for the current account # 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_debit_fee_with_http_info(debit_fee, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param DebitFee debit_fee: (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 = [ + 'debit_fee' + ] + 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_debit_fee" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'debit_fee' is set + if self.api_client.client_side_validation and ('debit_fee' not in local_var_params or # noqa: E501 + local_var_params['debit_fee'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `debit_fee` when calling `set_debit_fee`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'debit_fee' in local_var_params: + body_params = local_var_params['debit_fee'] + # 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( + '/account/debit_fee', '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) diff --git a/gate_api/api/collateral_loan_api.py b/gate_api/api/collateral_loan_api.py new file mode 100644 index 0000000..a96b375 --- /dev/null +++ b/gate_api/api/collateral_loan_api.py @@ -0,0 +1,1241 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market 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 CollateralLoanApi(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_collateral_loan_orders(self, **kwargs): # noqa: E501 + """Query collateral loan 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_collateral_loan_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 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. + :param _request_timeout: timeout setting for 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.CollateralOrder] + :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 + + def list_collateral_loan_orders_with_http_info(self, **kwargs): # noqa: E501 + """Query collateral loan 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_collateral_loan_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 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 + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.CollateralOrder], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'page', + 'limit', + 'collateral_currency', + 'borrow_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_collateral_loan_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_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 = {} + + 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( + '/loan/collateral/orders', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[CollateralOrder]', # 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_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 + + 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) + >>> 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 _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.CollateralOrder + :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 + + def get_collateral_loan_order_detail_with_http_info(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_with_http_info(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 _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.CollateralOrder, 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_collateral_loan_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_collateral_loan_order_detail`") # 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( + '/loan/collateral/orders/{order_id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CollateralOrder', # 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 repay_collateral_loan(self, repay_loan, **kwargs): # noqa: E501 + """Collateral loan repayment # 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) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param RepayLoan repay_loan: (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.RepayResp + :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 + + def repay_collateral_loan_with_http_info(self, repay_loan, **kwargs): # noqa: E501 + """Collateral loan repayment # 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) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param RepayLoan repay_loan: (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.RepayResp, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'repay_loan' + ] + 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 repay_collateral_loan" % 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 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'repay_loan' in local_var_params: + body_params = local_var_params['repay_loan'] + # 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/repay', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='RepayResp', # 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_repay_records(self, source, **kwargs): # noqa: E501 + """Query collateral loan repayment 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_repay_records(source, 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 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. + :param _request_timeout: timeout setting for 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.RepayRecord] + :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 + + def list_repay_records_with_http_info(self, source, **kwargs): # noqa: E501 + """Query collateral loan repayment 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_repay_records_with_http_info(source, 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 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 + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.RepayRecord], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'source', + 'borrow_currency', + 'collateral_currency', + 'page', + 'limit', + '_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_repay_records" % 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'] < 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 + 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 '_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( + '/loan/collateral/repay_records', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[RepayRecord]', # 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_collateral_records(self, **kwargs): # noqa: E501 + """Query collateral adjustment 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_collateral_records(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 _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.CollateralRecord] + :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 + + def list_collateral_records_with_http_info(self, **kwargs): # noqa: E501 + """Query collateral adjustment 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_collateral_records_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 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 _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.CollateralRecord], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'page', + 'limit', + '_from', + 'to', + 'borrow_currency', + 'collateral_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_collateral_records" % 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_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 = {} + + 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( + '/loan/collateral/collaterals', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[CollateralRecord]', # 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 operate_collateral(self, collateral_align, **kwargs): # noqa: E501 + """Increase or redeem collateral # 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) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param CollateralAlign collateral_align: (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.operate_collateral_with_http_info(collateral_align, **kwargs) # noqa: E501 + + def operate_collateral_with_http_info(self, collateral_align, **kwargs): # noqa: E501 + """Increase or redeem collateral # 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) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param CollateralAlign collateral_align: (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 = [ + 'collateral_align' + ] + 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 operate_collateral" % 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 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + 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 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/loan/collateral/collaterals', '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 get_user_total_amount(self, **kwargs): # noqa: E501 + """Query user's total borrowing and collateral 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_user_total_amount(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.UserTotalAmount + :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 + + def get_user_total_amount_with_http_info(self, **kwargs): # noqa: E501 + """Query user's total borrowing and collateral 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_user_total_amount_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.UserTotalAmount, 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_total_amount" % 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( + '/loan/collateral/total_amount', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='UserTotalAmount', # 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_ltv_info(self, collateral_currency, borrow_currency, **kwargs): # noqa: E501 + """Query user's collateralization ratio and remaining borrowable currencies # 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) + >>> 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 _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.UserLtvInfo + :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 + + 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 + + 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) + >>> 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 _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.UserLtvInfo, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'collateral_currency', + 'borrow_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 get_user_ltv_info" % 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 + + 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 + + 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( + '/loan/collateral/ltv', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='UserLtvInfo', # 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_collateral_currencies(self, **kwargs): # noqa: E501 + """Query supported borrowing and collateral currencies # 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) + >>> 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 _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.CollateralLoanCurrency] + :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 + + def list_collateral_currencies_with_http_info(self, **kwargs): # noqa: E501 + """Query supported borrowing and collateral currencies # 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) + >>> 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 _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.CollateralLoanCurrency], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'loan_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_collateral_currencies" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + 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 + + 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( + '/loan/collateral/currencies', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[CollateralLoanCurrency]', # 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 2a773ea..4979aa5 100644 --- a/gate_api/api/delivery_api.py +++ b/gate_api/api/delivery_api.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -18,7 +18,10 @@ import six from gate_api.api_client import ApiClient -from gate_api.exceptions import ApiTypeError, ApiValueError # noqa: F401 +from gate_api.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) class DeliveryApi(object): @@ -34,7 +37,7 @@ def __init__(self, api_client=None): self.api_client = api_client def list_delivery_contracts(self, settle, **kwargs): # noqa: E501 - """List all futures contracts # noqa: E501 + """Query all futures contracts # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -58,7 +61,7 @@ def list_delivery_contracts(self, settle, **kwargs): # noqa: E501 return self.list_delivery_contracts_with_http_info(settle, **kwargs) # noqa: E501 def list_delivery_contracts_with_http_info(self, settle, **kwargs): # noqa: E501 - """List all futures contracts # noqa: E501 + """Query all futures contracts # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -83,21 +86,30 @@ def list_delivery_contracts_with_http_info(self, settle, **kwargs): # noqa: E50 local_var_params = locals() - all_params = ['settle'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'settle' + ] + 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_delivery_contracts" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_delivery_contracts" % 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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `settle` when calling `list_delivery_contracts`" - ) # noqa: E501 + 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_delivery_contracts`") # noqa: E501 collection_formats = {} @@ -114,14 +126,14 @@ def list_delivery_contracts_with_http_info(self, settle, **kwargs): # noqa: E50 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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( - '/delivery/{settle}/contracts', - 'GET', + '/delivery/{settle}/contracts', 'GET', path_params, query_params, header_params, @@ -134,11 +146,10 @@ def list_delivery_contracts_with_http_info(self, settle, **kwargs): # noqa: E50 _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, - ) + collection_formats=collection_formats) def get_delivery_contract(self, settle, contract, **kwargs): # noqa: E501 - """Get a single contract # noqa: E501 + """Query single contract information # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -163,7 +174,7 @@ def get_delivery_contract(self, settle, contract, **kwargs): # noqa: E501 return self.get_delivery_contract_with_http_info(settle, contract, **kwargs) # noqa: E501 def get_delivery_contract_with_http_info(self, settle, contract, **kwargs): # noqa: E501 - """Get a single contract # noqa: E501 + """Query single contract information # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -189,28 +200,35 @@ def get_delivery_contract_with_http_info(self, settle, contract, **kwargs): # n local_var_params = locals() - all_params = ['settle', 'contract'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'settle', + 'contract' + ] + 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_delivery_contract" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_delivery_contract" % 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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `settle` when calling `get_delivery_contract`" - ) # noqa: E501 + 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_delivery_contract`") # noqa: E501 # verify the required parameter 'contract' is set - if self.api_client.client_side_validation and ( - 'contract' not in local_var_params or local_var_params['contract'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `contract` when calling `get_delivery_contract`" - ) # noqa: E501 + 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_delivery_contract`") # noqa: E501 collection_formats = {} @@ -229,14 +247,14 @@ def get_delivery_contract_with_http_info(self, settle, contract, **kwargs): # n body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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( - '/delivery/{settle}/contracts/{contract}', - 'GET', + '/delivery/{settle}/contracts/{contract}', 'GET', path_params, query_params, header_params, @@ -249,11 +267,10 @@ def get_delivery_contract_with_http_info(self, settle, contract, **kwargs): # n _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, - ) + collection_formats=collection_formats) def list_delivery_order_book(self, settle, contract, **kwargs): # noqa: E501 - """Futures order book # noqa: E501 + """Query futures market depth information # noqa: E501 Bids will be sorted by price from high to low, while asks sorted reversely # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -264,9 +281,9 @@ 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: Order depth. 0 means no aggregation is applied. default to 0 - :param int limit: Maximum number of order depth data in asks or bids - :param bool with_id: Whether the order book update ID will be returned. This ID increases by 1 on every order book update + :param str interval: Price precision for depth aggregation, 0 means no aggregation, defaults to 0 if not specified + :param int limit: Number of depth levels + :param bool with_id: Whether to return depth update ID. This ID increments by 1 each time depth changes :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -282,7 +299,7 @@ def list_delivery_order_book(self, settle, contract, **kwargs): # noqa: E501 return self.list_delivery_order_book_with_http_info(settle, contract, **kwargs) # noqa: E501 def list_delivery_order_book_with_http_info(self, settle, contract, **kwargs): # noqa: E501 - """Futures order book # noqa: E501 + """Query futures market depth information # noqa: E501 Bids will be sorted by price from high to low, while asks sorted reversely # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -293,9 +310,9 @@ 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: Order depth. 0 means no aggregation is applied. default to 0 - :param int limit: Maximum number of order depth data in asks or bids - :param bool with_id: Whether the order book update ID will be returned. This ID increases by 1 on every order book update + :param str interval: Price precision for depth aggregation, 0 means no aggregation, defaults to 0 if not specified + :param int limit: Number of depth levels + :param bool with_id: Whether to return depth update ID. This ID increments by 1 each time depth changes :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -312,41 +329,43 @@ def list_delivery_order_book_with_http_info(self, settle, contract, **kwargs): local_var_params = locals() - all_params = ['settle', 'contract', 'interval', 'limit', 'with_id'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'settle', + 'contract', + 'interval', + 'limit', + 'with_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_delivery_order_book" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_delivery_order_book" % 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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `settle` when calling `list_delivery_order_book`" - ) # noqa: E501 + 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_delivery_order_book`") # noqa: E501 # verify the required parameter 'contract' is set - if self.api_client.client_side_validation and ( - 'contract' not in local_var_params or local_var_params['contract'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `contract` when calling `list_delivery_order_book`" - ) # noqa: E501 - - 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_delivery_order_book`, 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_delivery_order_book`, must be a value greater than or equal to `1`" - ) # noqa: E501 + 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 `list_delivery_order_book`") # noqa: E501 + + 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_delivery_order_book`, 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_delivery_order_book`, must be a value greater than or equal to `1`") # noqa: E501 collection_formats = {} path_params = {} @@ -370,14 +389,14 @@ def list_delivery_order_book_with_http_info(self, settle, contract, **kwargs): body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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( - '/delivery/{settle}/order_book', - 'GET', + '/delivery/{settle}/order_book', 'GET', path_params, query_params, header_params, @@ -390,11 +409,10 @@ def list_delivery_order_book_with_http_info(self, settle, contract, **kwargs): _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, - ) + collection_formats=collection_formats) def list_delivery_trades(self, settle, contract, **kwargs): # noqa: E501 - """Futures trading history # noqa: E501 + """Futures market transaction records # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -404,10 +422,10 @@ def list_delivery_trades(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 int limit: Maximum number of records to be returned in a single list - :param str last_id: Specify the starting point for this list based on a previously retrieved id This parameter is deprecated. Use `from` and `to` instead to limit time range + :param int limit: Maximum number of records returned in a single list + :param str last_id: Use the ID of the last record in the previous list as the starting point for the next list.This field is no longer supported. For new requests, please use the fromand tofields to specify the time rang :param int _from: Specify starting time in Unix seconds. If not specified, `to` and `limit` will be used to limit response items. If items between `from` and `to` are more than `limit`, only `limit` number will be returned. - :param int to: Specify end time in Unix seconds, default to current time + :param int to: Specify end time in Unix seconds, default to current time. :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -423,7 +441,7 @@ def list_delivery_trades(self, settle, contract, **kwargs): # noqa: E501 return self.list_delivery_trades_with_http_info(settle, contract, **kwargs) # noqa: E501 def list_delivery_trades_with_http_info(self, settle, contract, **kwargs): # noqa: E501 - """Futures trading history # noqa: E501 + """Futures market transaction records # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -433,10 +451,10 @@ def list_delivery_trades_with_http_info(self, settle, contract, **kwargs): # no :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) :param str contract: Futures contract (required) - :param int limit: Maximum number of records to be returned in a single list - :param str last_id: Specify the starting point for this list based on a previously retrieved id This parameter is deprecated. Use `from` and `to` instead to limit time range + :param int limit: Maximum number of records returned in a single list + :param str last_id: Use the ID of the last record in the previous list as the starting point for the next list.This field is no longer supported. For new requests, please use the fromand tofields to specify the time rang :param int _from: Specify starting time in Unix seconds. If not specified, `to` and `limit` will be used to limit response items. If items between `from` and `to` are more than `limit`, only `limit` number will be returned. - :param int to: Specify end time in Unix seconds, default to current time + :param int to: Specify end time in Unix seconds, default to current time. :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -453,41 +471,44 @@ def list_delivery_trades_with_http_info(self, settle, contract, **kwargs): # no local_var_params = locals() - all_params = ['settle', 'contract', 'limit', 'last_id', '_from', 'to'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'settle', + 'contract', + 'limit', + 'last_id', + '_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_delivery_trades" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_delivery_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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `settle` when calling `list_delivery_trades`" - ) # noqa: E501 + 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_delivery_trades`") # noqa: E501 # verify the required parameter 'contract' is set - if self.api_client.client_side_validation and ( - 'contract' not in local_var_params or local_var_params['contract'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `contract` when calling `list_delivery_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 `list_delivery_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 `list_delivery_trades`, must be a value greater than or equal to `1`" - ) # noqa: E501 + 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 `list_delivery_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 `list_delivery_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 `list_delivery_trades`, must be a value greater than or equal to `1`") # noqa: E501 collection_formats = {} path_params = {} @@ -513,14 +534,14 @@ def list_delivery_trades_with_http_info(self, settle, contract, **kwargs): # no body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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( - '/delivery/{settle}/trades', - 'GET', + '/delivery/{settle}/trades', 'GET', path_params, query_params, header_params, @@ -533,11 +554,10 @@ def list_delivery_trades_with_http_info(self, settle, contract, **kwargs): # no _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, - ) + collection_formats=collection_formats) def list_delivery_candlesticks(self, settle, contract, **kwargs): # noqa: E501 - """Get futures candlesticks # noqa: E501 + """Futures market K-line chart # noqa: E501 Return specified contract candlesticks. If prefix `contract` with `mark_`, the contract's mark price candlesticks are returned; if prefix with `index_`, index price candlesticks will be returned. Maximum of 2000 points are returned in one query. Be sure not to exceed the limit when specifying `from`, `to` and `interval` # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -549,9 +569,9 @@ def list_delivery_candlesticks(self, settle, contract, **kwargs): # noqa: E501 :param str settle: Settle currency (required) :param str contract: Futures contract (required) :param int _from: Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified - :param int to: End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time - :param int limit: Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. - :param str interval: Interval time between data points + :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: Time interval between data points, note that 1w represents a natural week, 7d time is aligned with Unix initial time :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -559,7 +579,7 @@ def list_delivery_candlesticks(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: list[gate_api.FuturesCandlestick] + :rtype: list[gate_api.DeliveryCandlestick] :return: If the method is called asynchronously, returns the request thread. """ @@ -567,7 +587,7 @@ def list_delivery_candlesticks(self, settle, contract, **kwargs): # noqa: E501 return self.list_delivery_candlesticks_with_http_info(settle, contract, **kwargs) # noqa: E501 def list_delivery_candlesticks_with_http_info(self, settle, contract, **kwargs): # noqa: E501 - """Get futures candlesticks # noqa: E501 + """Futures market K-line chart # noqa: E501 Return specified contract candlesticks. If prefix `contract` with `mark_`, the contract's mark price candlesticks are returned; if prefix with `index_`, index price candlesticks will be returned. Maximum of 2000 points are returned in one query. Be sure not to exceed the limit when specifying `from`, `to` and `interval` # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -579,9 +599,9 @@ def list_delivery_candlesticks_with_http_info(self, settle, contract, **kwargs): :param str settle: Settle currency (required) :param str contract: Futures contract (required) :param int _from: Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified - :param int to: End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time - :param int limit: Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. - :param str interval: Interval time between data points + :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: Time interval between data points, note that 1w represents a natural week, 7d time is aligned with Unix initial time :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -591,44 +611,49 @@ def list_delivery_candlesticks_with_http_info(self, settle, contract, **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.FuturesCandlestick], status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(list[gate_api.DeliveryCandlestick], 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', 'interval'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'settle', + 'contract', + '_from', + 'to', + 'limit', + 'interval' + ] + 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_delivery_candlesticks" % k + "Got an unexpected keyword argument '%s'" + " to method list_delivery_candlesticks" % 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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `settle` when calling `list_delivery_candlesticks`" - ) # noqa: E501 + 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_delivery_candlesticks`") # noqa: E501 # verify the required parameter 'contract' is set - if self.api_client.client_side_validation and ( - 'contract' not in local_var_params or local_var_params['contract'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `contract` when calling `list_delivery_candlesticks`" - ) # noqa: E501 - - if ( - self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 2000 - ): # noqa: E501 - raise ApiValueError( - "Invalid value for parameter `limit` when calling `list_delivery_candlesticks`, must be a value less than or equal to `2000`" - ) # noqa: E501 + 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 `list_delivery_candlesticks`") # noqa: E501 + + if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 2000: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `list_delivery_candlesticks`, must be a value less than or equal to `2000`") # noqa: E501 collection_formats = {} path_params = {} @@ -654,31 +679,30 @@ def list_delivery_candlesticks_with_http_info(self, settle, contract, **kwargs): body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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( - '/delivery/{settle}/candlesticks', - 'GET', + '/delivery/{settle}/candlesticks', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[FuturesCandlestick]', # noqa: E501 + response_type='list[DeliveryCandlestick]', # 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, - ) + collection_formats=collection_formats) def list_delivery_tickers(self, settle, **kwargs): # noqa: E501 - """List futures tickers # noqa: E501 + """Get all futures trading statistics # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -695,7 +719,7 @@ def list_delivery_tickers(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.FuturesTicker] + :rtype: list[gate_api.DeliveryTicker] :return: If the method is called asynchronously, returns the request thread. """ @@ -703,7 +727,7 @@ def list_delivery_tickers(self, settle, **kwargs): # noqa: E501 return self.list_delivery_tickers_with_http_info(settle, **kwargs) # noqa: E501 def list_delivery_tickers_with_http_info(self, settle, **kwargs): # noqa: E501 - """List futures tickers # noqa: E501 + """Get all futures trading statistics # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -722,28 +746,38 @@ def list_delivery_tickers_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.FuturesTicker], status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(list[gate_api.DeliveryTicker], status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ local_var_params = locals() - all_params = ['settle', 'contract'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'settle', + 'contract' + ] + 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_delivery_tickers" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_delivery_tickers" % 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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `settle` when calling `list_delivery_tickers`" - ) # noqa: E501 + 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_delivery_tickers`") # noqa: E501 collection_formats = {} @@ -762,31 +796,30 @@ def list_delivery_tickers_with_http_info(self, settle, **kwargs): # noqa: E501 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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( - '/delivery/{settle}/tickers', - 'GET', + '/delivery/{settle}/tickers', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[FuturesTicker]', # noqa: E501 + response_type='list[DeliveryTicker]', # 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, - ) + collection_formats=collection_formats) def list_delivery_insurance_ledger(self, settle, **kwargs): # noqa: E501 - """Futures insurance balance history # noqa: E501 + """Futures market insurance fund history # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -795,7 +828,7 @@ def list_delivery_insurance_ledger(self, settle, **kwargs): # noqa: E501 :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param int limit: Maximum number of records to be returned in a single list + :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. @@ -811,7 +844,7 @@ def list_delivery_insurance_ledger(self, settle, **kwargs): # noqa: E501 return self.list_delivery_insurance_ledger_with_http_info(settle, **kwargs) # noqa: E501 def list_delivery_insurance_ledger_with_http_info(self, settle, **kwargs): # noqa: E501 - """Futures insurance balance history # noqa: E501 + """Futures market insurance fund history # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -820,7 +853,7 @@ def list_delivery_insurance_ledger_with_http_info(self, settle, **kwargs): # no :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param int limit: Maximum number of records to be returned in a single list + :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 @@ -837,36 +870,36 @@ def list_delivery_insurance_ledger_with_http_info(self, settle, **kwargs): # no local_var_params = locals() - all_params = ['settle', 'limit'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'settle', + '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_delivery_insurance_ledger" % k + "Got an unexpected keyword argument '%s'" + " to method list_delivery_insurance_ledger" % 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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `settle` when calling `list_delivery_insurance_ledger`" - ) # 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_delivery_insurance_ledger`, 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_delivery_insurance_ledger`, must be a value greater than or equal to `1`" - ) # noqa: E501 + 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_delivery_insurance_ledger`") # 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_delivery_insurance_ledger`, 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_delivery_insurance_ledger`, must be a value greater than or equal to `1`") # noqa: E501 collection_formats = {} path_params = {} @@ -884,14 +917,14 @@ def list_delivery_insurance_ledger_with_http_info(self, settle, **kwargs): # no body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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( - '/delivery/{settle}/insurance', - 'GET', + '/delivery/{settle}/insurance', 'GET', path_params, query_params, header_params, @@ -904,11 +937,10 @@ def list_delivery_insurance_ledger_with_http_info(self, settle, **kwargs): # no _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, - ) + collection_formats=collection_formats) def list_delivery_accounts(self, settle, **kwargs): # noqa: E501 - """Query futures account # noqa: E501 + """Get futures account # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -932,7 +964,7 @@ def list_delivery_accounts(self, settle, **kwargs): # noqa: E501 return self.list_delivery_accounts_with_http_info(settle, **kwargs) # noqa: E501 def list_delivery_accounts_with_http_info(self, settle, **kwargs): # noqa: E501 - """Query futures account # noqa: E501 + """Get futures account # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -957,21 +989,30 @@ def list_delivery_accounts_with_http_info(self, settle, **kwargs): # noqa: E501 local_var_params = locals() - all_params = ['settle'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'settle' + ] + 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_delivery_accounts" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_delivery_accounts" % 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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `settle` when calling `list_delivery_accounts`" - ) # noqa: E501 + 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_delivery_accounts`") # noqa: E501 collection_formats = {} @@ -988,14 +1029,14 @@ def list_delivery_accounts_with_http_info(self, settle, **kwargs): # noqa: E501 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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( - '/delivery/{settle}/accounts', - 'GET', + '/delivery/{settle}/accounts', 'GET', path_params, query_params, header_params, @@ -1008,11 +1049,10 @@ def list_delivery_accounts_with_http_info(self, settle, **kwargs): # noqa: E501 _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, - ) + collection_formats=collection_formats) def list_delivery_account_book(self, settle, **kwargs): # noqa: E501 - """Query account book # noqa: E501 + """Query futures account change history # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -1021,10 +1061,10 @@ def list_delivery_account_book(self, settle, **kwargs): # noqa: E501 :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param int limit: Maximum number of records to be returned in a single list - :param int _from: Start timestamp - :param int to: End timestamp - :param str type: Changing Type: - dnw: Deposit & Withdraw - pnl: Profit & Loss by reducing position - fee: Trading fee - refr: Referrer rebate - fund: Funding - point_dnw: POINT Deposit & Withdraw - point_fee: POINT Trading fee - point_refr: POINT Referrer rebate + :param int limit: Maximum number of records returned in a single list + :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 type: Change types: - dnw: Deposit and withdrawal - pnl: Profit and loss from position reduction - fee: Trading fees - refr: Referrer rebates - fund: Funding fees - point_dnw: Point card deposit and withdrawal - point_fee: Point card trading fees - point_refr: Point card referrer rebates :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -1040,7 +1080,7 @@ def list_delivery_account_book(self, settle, **kwargs): # noqa: E501 return self.list_delivery_account_book_with_http_info(settle, **kwargs) # noqa: E501 def list_delivery_account_book_with_http_info(self, settle, **kwargs): # noqa: E501 - """Query account book # noqa: E501 + """Query futures account change history # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -1049,10 +1089,10 @@ def list_delivery_account_book_with_http_info(self, settle, **kwargs): # noqa: :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param int limit: Maximum number of records to be returned in a single list - :param int _from: Start timestamp - :param int to: End timestamp - :param str type: Changing Type: - dnw: Deposit & Withdraw - pnl: Profit & Loss by reducing position - fee: Trading fee - refr: Referrer rebate - fund: Funding - point_dnw: POINT Deposit & Withdraw - point_fee: POINT Trading fee - point_refr: POINT Referrer rebate + :param int limit: Maximum number of records returned in a single list + :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 type: Change types: - dnw: Deposit and withdrawal - pnl: Profit and loss from position reduction - fee: Trading fees - refr: Referrer rebates - fund: Funding fees - point_dnw: Point card deposit and withdrawal - point_fee: Point card trading fees - point_refr: Point card referrer rebates :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -1069,36 +1109,39 @@ def list_delivery_account_book_with_http_info(self, settle, **kwargs): # noqa: local_var_params = locals() - all_params = ['settle', 'limit', '_from', 'to', 'type'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'settle', + 'limit', + '_from', + 'to', + '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_delivery_account_book" % k + "Got an unexpected keyword argument '%s'" + " to method list_delivery_account_book" % 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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `settle` when calling `list_delivery_account_book`" - ) # 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_delivery_account_book`, 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_delivery_account_book`, must be a value greater than or equal to `1`" - ) # noqa: E501 + 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_delivery_account_book`") # 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_delivery_account_book`, 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_delivery_account_book`, must be a value greater than or equal to `1`") # noqa: E501 collection_formats = {} path_params = {} @@ -1122,14 +1165,14 @@ def list_delivery_account_book_with_http_info(self, settle, **kwargs): # noqa: body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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( - '/delivery/{settle}/account_book', - 'GET', + '/delivery/{settle}/account_book', 'GET', path_params, query_params, header_params, @@ -1142,11 +1185,10 @@ def list_delivery_account_book_with_http_info(self, settle, **kwargs): # noqa: _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, - ) + collection_formats=collection_formats) def list_delivery_positions(self, settle, **kwargs): # noqa: E501 - """List all positions of a user # noqa: E501 + """Get user position list # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -1170,7 +1212,7 @@ def list_delivery_positions(self, settle, **kwargs): # noqa: E501 return self.list_delivery_positions_with_http_info(settle, **kwargs) # noqa: E501 def list_delivery_positions_with_http_info(self, settle, **kwargs): # noqa: E501 - """List all positions of a user # noqa: E501 + """Get user position list # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -1195,21 +1237,30 @@ def list_delivery_positions_with_http_info(self, settle, **kwargs): # noqa: E50 local_var_params = locals() - all_params = ['settle'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'settle' + ] + 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_delivery_positions" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_delivery_positions" % 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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `settle` when calling `list_delivery_positions`" - ) # noqa: E501 + 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_delivery_positions`") # noqa: E501 collection_formats = {} @@ -1226,14 +1277,14 @@ def list_delivery_positions_with_http_info(self, settle, **kwargs): # noqa: E50 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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( - '/delivery/{settle}/positions', - 'GET', + '/delivery/{settle}/positions', 'GET', path_params, query_params, header_params, @@ -1246,11 +1297,10 @@ def list_delivery_positions_with_http_info(self, settle, **kwargs): # noqa: E50 _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, - ) + collection_formats=collection_formats) def get_delivery_position(self, settle, contract, **kwargs): # noqa: E501 - """Get single position # noqa: E501 + """Get single position information # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -1275,7 +1325,7 @@ def get_delivery_position(self, settle, contract, **kwargs): # noqa: E501 return self.get_delivery_position_with_http_info(settle, contract, **kwargs) # noqa: E501 def get_delivery_position_with_http_info(self, settle, contract, **kwargs): # noqa: E501 - """Get single position # noqa: E501 + """Get single position information # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -1301,28 +1351,35 @@ def get_delivery_position_with_http_info(self, settle, contract, **kwargs): # n local_var_params = locals() - all_params = ['settle', 'contract'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'settle', + 'contract' + ] + 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_delivery_position" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_delivery_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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `settle` when calling `get_delivery_position`" - ) # noqa: E501 + 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_delivery_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 local_var_params['contract'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `contract` when calling `get_delivery_position`" - ) # noqa: E501 + 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_delivery_position`") # noqa: E501 collection_formats = {} @@ -1341,14 +1398,14 @@ def get_delivery_position_with_http_info(self, settle, contract, **kwargs): # n body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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( - '/delivery/{settle}/positions/{contract}', - 'GET', + '/delivery/{settle}/positions/{contract}', 'GET', path_params, query_params, header_params, @@ -1361,8 +1418,7 @@ def get_delivery_position_with_http_info(self, settle, contract, **kwargs): # n _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, - ) + collection_formats=collection_formats) def update_delivery_position_margin(self, settle, contract, change, **kwargs): # noqa: E501 """Update position margin # noqa: E501 @@ -1375,7 +1431,7 @@ def update_delivery_position_margin(self, settle, contract, change, **kwargs): :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) :param str contract: Futures contract (required) - :param str change: Margin change. Use positive number to increase margin, negative number otherwise. (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. @@ -1401,7 +1457,7 @@ def update_delivery_position_margin_with_http_info(self, settle, contract, chang :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) :param str contract: Futures contract (required) - :param str change: Margin change. Use positive number to increase margin, negative number otherwise. (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 @@ -1418,37 +1474,40 @@ def update_delivery_position_margin_with_http_info(self, settle, contract, chang local_var_params = locals() - all_params = ['settle', 'contract', 'change'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'settle', + 'contract', + 'change' + ] + 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_delivery_position_margin" % k + "Got an unexpected keyword argument '%s'" + " to method update_delivery_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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `settle` when calling `update_delivery_position_margin`" - ) # noqa: E501 + 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_delivery_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 local_var_params['contract'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `contract` when calling `update_delivery_position_margin`" - ) # noqa: E501 + 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_delivery_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 local_var_params['change'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `change` when calling `update_delivery_position_margin`" - ) # noqa: E501 + 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_delivery_position_margin`") # noqa: E501 collection_formats = {} @@ -1469,14 +1528,14 @@ def update_delivery_position_margin_with_http_info(self, settle, contract, chang body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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( - '/delivery/{settle}/positions/{contract}/margin', - 'POST', + '/delivery/{settle}/positions/{contract}/margin', 'POST', path_params, query_params, header_params, @@ -1489,8 +1548,7 @@ def update_delivery_position_margin_with_http_info(self, settle, contract, chang _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, - ) + collection_formats=collection_formats) def update_delivery_position_leverage(self, settle, contract, leverage, **kwargs): # noqa: E501 """Update position leverage # noqa: E501 @@ -1546,37 +1604,40 @@ def update_delivery_position_leverage_with_http_info(self, settle, contract, lev local_var_params = locals() - all_params = ['settle', 'contract', 'leverage'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'settle', + 'contract', + 'leverage' + ] + 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_delivery_position_leverage" % k + "Got an unexpected keyword argument '%s'" + " to method update_delivery_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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `settle` when calling `update_delivery_position_leverage`" - ) # noqa: E501 + 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_delivery_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 local_var_params['contract'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `contract` when calling `update_delivery_position_leverage`" - ) # noqa: E501 + 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_delivery_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 local_var_params['leverage'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `leverage` when calling `update_delivery_position_leverage`" - ) # noqa: E501 + 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_delivery_position_leverage`") # noqa: E501 collection_formats = {} @@ -1597,14 +1658,14 @@ def update_delivery_position_leverage_with_http_info(self, settle, contract, lev body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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( - '/delivery/{settle}/positions/{contract}/leverage', - 'POST', + '/delivery/{settle}/positions/{contract}/leverage', 'POST', path_params, query_params, header_params, @@ -1617,8 +1678,7 @@ def update_delivery_position_leverage_with_http_info(self, settle, contract, lev _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, - ) + collection_formats=collection_formats) def update_delivery_position_risk_limit(self, settle, contract, risk_limit, **kwargs): # noqa: E501 """Update position risk limit # noqa: E501 @@ -1644,9 +1704,7 @@ def update_delivery_position_risk_limit(self, settle, contract, risk_limit, **kw returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.update_delivery_position_risk_limit_with_http_info( - settle, contract, risk_limit, **kwargs - ) # noqa: E501 + return self.update_delivery_position_risk_limit_with_http_info(settle, contract, risk_limit, **kwargs) # noqa: E501 def update_delivery_position_risk_limit_with_http_info(self, settle, contract, risk_limit, **kwargs): # noqa: E501 """Update position risk limit # noqa: E501 @@ -1676,37 +1734,40 @@ def update_delivery_position_risk_limit_with_http_info(self, settle, contract, r local_var_params = locals() - all_params = ['settle', 'contract', 'risk_limit'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + 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_delivery_position_risk_limit" % k + "Got an unexpected keyword argument '%s'" + " to method update_delivery_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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `settle` when calling `update_delivery_position_risk_limit`" - ) # noqa: E501 + 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_delivery_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 local_var_params['contract'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `contract` when calling `update_delivery_position_risk_limit`" - ) # noqa: E501 + 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_delivery_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 local_var_params['risk_limit'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `risk_limit` when calling `update_delivery_position_risk_limit`" - ) # noqa: E501 + 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_delivery_position_risk_limit`") # noqa: E501 collection_formats = {} @@ -1727,14 +1788,14 @@ def update_delivery_position_risk_limit_with_http_info(self, settle, contract, r body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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( - '/delivery/{settle}/positions/{contract}/risk_limit', - 'POST', + '/delivery/{settle}/positions/{contract}/risk_limit', 'POST', path_params, query_params, header_params, @@ -1747,13 +1808,12 @@ def update_delivery_position_risk_limit_with_http_info(self, settle, contract, r _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, - ) + collection_formats=collection_formats) def list_delivery_orders(self, settle, status, **kwargs): # noqa: E501 - """List futures orders # noqa: E501 + """Query futures order list # noqa: E501 - Zero-fill order cannot be retrieved for 60 seconds after cancellation # 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.list_delivery_orders(settle, status, async_req=True) @@ -1761,12 +1821,12 @@ def list_delivery_orders(self, settle, status, **kwargs): # noqa: E501 :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param str status: Only list the orders with this status (required) + :param str status: Query order list based on status (required) :param str contract: Futures contract - :param int limit: Maximum number of records to be returned in a single list + :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 list staring point using the `id` of last record in previous list-query results - :param int count_total: Whether to return total number matched. Default to 0(no return) + :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 int count_total: Whether to return total number matched, defaults to 0 (no return) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -1782,9 +1842,9 @@ def list_delivery_orders(self, settle, status, **kwargs): # noqa: E501 return self.list_delivery_orders_with_http_info(settle, status, **kwargs) # noqa: E501 def list_delivery_orders_with_http_info(self, settle, status, **kwargs): # noqa: E501 - """List futures orders # noqa: E501 + """Query futures order list # noqa: E501 - Zero-fill order cannot be retrieved for 60 seconds after cancellation # 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.list_delivery_orders_with_http_info(settle, status, async_req=True) @@ -1792,12 +1852,12 @@ def list_delivery_orders_with_http_info(self, settle, status, **kwargs): # noqa :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param str status: Only list the orders with this status (required) + :param str status: Query order list based on status (required) :param str contract: Futures contract - :param int limit: Maximum number of records to be returned in a single list + :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 list staring point using the `id` of last record in previous list-query results - :param int count_total: Whether to return total number matched. Default to 0(no return) + :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 int count_total: Whether to return total number matched, defaults to 0 (no return) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -1814,47 +1874,47 @@ def list_delivery_orders_with_http_info(self, settle, status, **kwargs): # noqa local_var_params = locals() - all_params = ['settle', 'status', 'contract', 'limit', 'offset', 'last_id', 'count_total'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'settle', + 'status', + 'contract', + 'limit', + 'offset', + 'last_id', + 'count_total' + ] + 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_delivery_orders" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_delivery_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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `settle` when calling `list_delivery_orders`" - ) # noqa: E501 + 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_delivery_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 local_var_params['status'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `status` when calling `list_delivery_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_delivery_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_delivery_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_delivery_orders`, must be a value greater than or equal to `0`" - ) # noqa: E501 + 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_delivery_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_delivery_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_delivery_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_delivery_orders`, must be a value greater than or equal to `0`") # noqa: E501 collection_formats = {} path_params = {} @@ -1882,14 +1942,14 @@ def list_delivery_orders_with_http_info(self, settle, status, **kwargs): # noqa body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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( - '/delivery/{settle}/orders', - 'GET', + '/delivery/{settle}/orders', 'GET', path_params, query_params, header_params, @@ -1902,13 +1962,12 @@ def list_delivery_orders_with_http_info(self, settle, status, **kwargs): # noqa _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, - ) + collection_formats=collection_formats) def create_delivery_order(self, settle, futures_order, **kwargs): # noqa: E501 - """Create a futures order # noqa: E501 + """Place futures order # noqa: E501 - Zero-fill order cannot be retrieved for 60 seconds after cancellation # 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.create_delivery_order(settle, futures_order, async_req=True) @@ -1932,9 +1991,9 @@ def create_delivery_order(self, settle, futures_order, **kwargs): # noqa: E501 return self.create_delivery_order_with_http_info(settle, futures_order, **kwargs) # noqa: E501 def create_delivery_order_with_http_info(self, settle, futures_order, **kwargs): # noqa: E501 - """Create a futures order # noqa: E501 + """Place futures order # noqa: E501 - Zero-fill order cannot be retrieved for 60 seconds after cancellation # 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.create_delivery_order_with_http_info(settle, futures_order, async_req=True) @@ -1959,28 +2018,35 @@ def create_delivery_order_with_http_info(self, settle, futures_order, **kwargs): local_var_params = locals() - all_params = ['settle', 'futures_order'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'settle', + 'futures_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_delivery_order" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_delivery_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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `settle` when calling `create_delivery_order`" - ) # noqa: E501 + 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_delivery_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 local_var_params['futures_order'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `futures_order` when calling `create_delivery_order`" - ) # noqa: E501 + 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_delivery_order`") # noqa: E501 collection_formats = {} @@ -1999,19 +2065,18 @@ def create_delivery_order_with_http_info(self, settle, futures_order, **kwargs): 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 + 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 + ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( - '/delivery/{settle}/orders', - 'POST', + '/delivery/{settle}/orders', 'POST', path_params, query_params, header_params, @@ -2024,13 +2089,12 @@ def create_delivery_order_with_http_info(self, settle, futures_order, **kwargs): _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, - ) + collection_formats=collection_formats) def cancel_delivery_orders(self, settle, contract, **kwargs): # noqa: E501 - """Cancel all `open` orders matched # noqa: E501 + """Cancel all orders with 'open' status # noqa: E501 - Zero-fill order cannot be retrieved for 60 seconds after cancellation # 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_delivery_orders(settle, contract, async_req=True) @@ -2039,7 +2103,7 @@ def cancel_delivery_orders(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 side: All bids or asks. Both included if not specified + :param str side: Specify all bids or all asks, both included if not specified :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -2055,9 +2119,9 @@ def cancel_delivery_orders(self, settle, contract, **kwargs): # noqa: E501 return self.cancel_delivery_orders_with_http_info(settle, contract, **kwargs) # noqa: E501 def cancel_delivery_orders_with_http_info(self, settle, contract, **kwargs): # noqa: E501 - """Cancel all `open` orders matched # noqa: E501 + """Cancel all orders with 'open' status # noqa: E501 - Zero-fill order cannot be retrieved for 60 seconds after cancellation # 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_delivery_orders_with_http_info(settle, contract, async_req=True) @@ -2066,7 +2130,7 @@ def cancel_delivery_orders_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 side: All bids or asks. Both included if not specified + :param str side: Specify all bids or all asks, both included 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 @@ -2083,28 +2147,36 @@ def cancel_delivery_orders_with_http_info(self, settle, contract, **kwargs): # local_var_params = locals() - all_params = ['settle', 'contract', 'side'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'settle', + 'contract', + '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 cancel_delivery_orders" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method cancel_delivery_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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `settle` when calling `cancel_delivery_orders`" - ) # noqa: E501 + 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_delivery_orders`") # noqa: E501 # verify the required parameter 'contract' is set - if self.api_client.client_side_validation and ( - 'contract' not in local_var_params or local_var_params['contract'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `contract` when calling `cancel_delivery_orders`" - ) # noqa: E501 + 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 `cancel_delivery_orders`") # noqa: E501 collection_formats = {} @@ -2125,14 +2197,14 @@ def cancel_delivery_orders_with_http_info(self, settle, contract, **kwargs): # body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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( - '/delivery/{settle}/orders', - 'DELETE', + '/delivery/{settle}/orders', 'DELETE', path_params, query_params, header_params, @@ -2145,13 +2217,12 @@ def cancel_delivery_orders_with_http_info(self, settle, contract, **kwargs): # _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, - ) + collection_formats=collection_formats) def get_delivery_order(self, settle, order_id, **kwargs): # noqa: E501 - """Get a single order # noqa: E501 + """Query single order details # noqa: E501 - Zero-fill order cannot be retrieved for 60 seconds after cancellation # 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.get_delivery_order(settle, order_id, async_req=True) @@ -2159,7 +2230,7 @@ def get_delivery_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: Retrieve the data of the order with the specified ID (required) + :param str 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. @@ -2175,9 +2246,9 @@ def get_delivery_order(self, settle, order_id, **kwargs): # noqa: E501 return self.get_delivery_order_with_http_info(settle, order_id, **kwargs) # noqa: E501 def get_delivery_order_with_http_info(self, settle, order_id, **kwargs): # noqa: E501 - """Get a single order # noqa: E501 + """Query single order details # noqa: E501 - Zero-fill order cannot be retrieved for 60 seconds after cancellation # 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.get_delivery_order_with_http_info(settle, order_id, async_req=True) @@ -2185,7 +2256,7 @@ def get_delivery_order_with_http_info(self, settle, order_id, **kwargs): # noqa :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param str order_id: Retrieve the data of the order with the specified ID (required) + :param str 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 @@ -2202,28 +2273,35 @@ def get_delivery_order_with_http_info(self, settle, order_id, **kwargs): # noqa local_var_params = locals() - all_params = ['settle', 'order_id'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + 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_delivery_order" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_delivery_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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `settle` when calling `get_delivery_order`" - ) # noqa: E501 + 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_delivery_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 local_var_params['order_id'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `order_id` when calling `get_delivery_order`" - ) # noqa: E501 + 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_delivery_order`") # noqa: E501 collection_formats = {} @@ -2242,14 +2320,14 @@ def get_delivery_order_with_http_info(self, settle, order_id, **kwargs): # noqa body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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( - '/delivery/{settle}/orders/{order_id}', - 'GET', + '/delivery/{settle}/orders/{order_id}', 'GET', path_params, query_params, header_params, @@ -2262,11 +2340,10 @@ def get_delivery_order_with_http_info(self, settle, order_id, **kwargs): # noqa _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, - ) + collection_formats=collection_formats) def cancel_delivery_order(self, settle, order_id, **kwargs): # noqa: E501 - """Cancel a single order # 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 @@ -2275,7 +2352,7 @@ def cancel_delivery_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: Retrieve the data of the order with the specified ID (required) + :param str 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. @@ -2291,7 +2368,7 @@ def cancel_delivery_order(self, settle, order_id, **kwargs): # noqa: E501 return self.cancel_delivery_order_with_http_info(settle, order_id, **kwargs) # noqa: E501 def cancel_delivery_order_with_http_info(self, settle, order_id, **kwargs): # noqa: E501 - """Cancel a single order # 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 @@ -2300,7 +2377,7 @@ def cancel_delivery_order_with_http_info(self, settle, order_id, **kwargs): # n :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param str order_id: Retrieve the data of the order with the specified ID (required) + :param str 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 @@ -2317,28 +2394,35 @@ def cancel_delivery_order_with_http_info(self, settle, order_id, **kwargs): # n local_var_params = locals() - all_params = ['settle', 'order_id'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + 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 cancel_delivery_order" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method cancel_delivery_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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `settle` when calling `cancel_delivery_order`" - ) # noqa: E501 + 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_delivery_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 local_var_params['order_id'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `order_id` when calling `cancel_delivery_order`" - ) # noqa: E501 + 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_delivery_order`") # noqa: E501 collection_formats = {} @@ -2357,14 +2441,14 @@ def cancel_delivery_order_with_http_info(self, settle, order_id, **kwargs): # n body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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( - '/delivery/{settle}/orders/{order_id}', - 'DELETE', + '/delivery/{settle}/orders/{order_id}', 'DELETE', path_params, query_params, header_params, @@ -2377,11 +2461,10 @@ def cancel_delivery_order_with_http_info(self, settle, order_id, **kwargs): # n _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, - ) + collection_formats=collection_formats) def get_my_delivery_trades(self, settle, **kwargs): # noqa: E501 - """List personal trading history # noqa: E501 + """Query personal trading records # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -2392,10 +2475,10 @@ def get_my_delivery_trades(self, settle, **kwargs): # noqa: E501 :param str settle: Settle currency (required) :param str contract: Futures contract :param int order: Futures order ID, return related data only if specified - :param int limit: Maximum number of records to be returned in a single list + :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 list staring point using the `id` of last record in previous list-query results - :param int count_total: Whether to return total number matched. Default to 0(no return) + :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 int count_total: Whether to return total number matched, defaults to 0 (no return) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -2411,7 +2494,7 @@ def get_my_delivery_trades(self, settle, **kwargs): # noqa: E501 return self.get_my_delivery_trades_with_http_info(settle, **kwargs) # noqa: E501 def get_my_delivery_trades_with_http_info(self, settle, **kwargs): # noqa: E501 - """List personal trading history # noqa: E501 + """Query personal trading records # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -2422,10 +2505,10 @@ def get_my_delivery_trades_with_http_info(self, settle, **kwargs): # noqa: E501 :param str settle: Settle currency (required) :param str contract: Futures contract :param int order: Futures order ID, return related data only if specified - :param int limit: Maximum number of records to be returned in a single list + :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 list staring point using the `id` of last record in previous list-query results - :param int count_total: Whether to return total number matched. Default to 0(no return) + :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 int count_total: Whether to return total number matched, defaults to 0 (no return) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -2442,40 +2525,43 @@ def get_my_delivery_trades_with_http_info(self, settle, **kwargs): # noqa: E501 local_var_params = locals() - all_params = ['settle', 'contract', 'order', 'limit', 'offset', 'last_id', 'count_total'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'settle', + 'contract', + 'order', + 'limit', + 'offset', + 'last_id', + 'count_total' + ] + 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_delivery_trades" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_my_delivery_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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `settle` when calling `get_my_delivery_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_delivery_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_delivery_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_delivery_trades`, must be a value greater than or equal to `0`" - ) # noqa: E501 + 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_delivery_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_delivery_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_delivery_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_delivery_trades`, must be a value greater than or equal to `0`") # noqa: E501 collection_formats = {} path_params = {} @@ -2503,14 +2589,14 @@ def get_my_delivery_trades_with_http_info(self, settle, **kwargs): # noqa: E501 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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( - '/delivery/{settle}/my_trades', - 'GET', + '/delivery/{settle}/my_trades', 'GET', path_params, query_params, header_params, @@ -2523,11 +2609,10 @@ def get_my_delivery_trades_with_http_info(self, settle, **kwargs): # noqa: E501 _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, - ) + collection_formats=collection_formats) def list_delivery_position_close(self, settle, **kwargs): # noqa: E501 - """List position close history # 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 @@ -2537,7 +2622,7 @@ def list_delivery_position_close(self, settle, **kwargs): # noqa: E501 :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) :param str contract: Futures contract - :param int limit: Maximum number of records to be returned in a single list + :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. @@ -2553,7 +2638,7 @@ def list_delivery_position_close(self, settle, **kwargs): # noqa: E501 return self.list_delivery_position_close_with_http_info(settle, **kwargs) # noqa: E501 def list_delivery_position_close_with_http_info(self, settle, **kwargs): # noqa: E501 - """List position close history # 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 @@ -2563,7 +2648,7 @@ def list_delivery_position_close_with_http_info(self, settle, **kwargs): # noqa :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) :param str contract: Futures contract - :param int limit: Maximum number of records to be returned in a single list + :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 @@ -2580,36 +2665,37 @@ def list_delivery_position_close_with_http_info(self, settle, **kwargs): # noqa local_var_params = locals() - all_params = ['settle', 'contract', 'limit'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'settle', + 'contract', + '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_delivery_position_close" % k + "Got an unexpected keyword argument '%s'" + " to method list_delivery_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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `settle` when calling `list_delivery_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_delivery_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_delivery_position_close`, must be a value greater than or equal to `1`" - ) # noqa: E501 + 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_delivery_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_delivery_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_delivery_position_close`, must be a value greater than or equal to `1`") # noqa: E501 collection_formats = {} path_params = {} @@ -2629,14 +2715,14 @@ def list_delivery_position_close_with_http_info(self, settle, **kwargs): # noqa body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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( - '/delivery/{settle}/position_close', - 'GET', + '/delivery/{settle}/position_close', 'GET', path_params, query_params, header_params, @@ -2649,11 +2735,10 @@ def list_delivery_position_close_with_http_info(self, settle, **kwargs): # noqa _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, - ) + collection_formats=collection_formats) def list_delivery_liquidates(self, settle, **kwargs): # noqa: E501 - """List liquidation history # 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 @@ -2663,8 +2748,8 @@ def list_delivery_liquidates(self, settle, **kwargs): # noqa: E501 :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) :param str contract: Futures contract - :param int limit: Maximum number of records to be returned in a single list - :param int at: Specify a liquidation timestamp + :param int limit: Maximum number of records returned in a single list + :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. @@ -2680,7 +2765,7 @@ def list_delivery_liquidates(self, settle, **kwargs): # noqa: E501 return self.list_delivery_liquidates_with_http_info(settle, **kwargs) # noqa: E501 def list_delivery_liquidates_with_http_info(self, settle, **kwargs): # noqa: E501 - """List liquidation history # 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 @@ -2690,8 +2775,8 @@ def list_delivery_liquidates_with_http_info(self, settle, **kwargs): # noqa: E5 :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) :param str contract: Futures contract - :param int limit: Maximum number of records to be returned in a single list - :param int at: Specify a liquidation timestamp + :param int limit: Maximum number of records returned in a single list + :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 @@ -2708,34 +2793,38 @@ def list_delivery_liquidates_with_http_info(self, settle, **kwargs): # noqa: E5 local_var_params = locals() - all_params = ['settle', 'contract', 'limit', 'at'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'settle', + 'contract', + 'limit', + '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_delivery_liquidates" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_delivery_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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `settle` when calling `list_delivery_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_delivery_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_delivery_liquidates`, must be a value greater than or equal to `1`" - ) # noqa: E501 + 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_delivery_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_delivery_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_delivery_liquidates`, must be a value greater than or equal to `1`") # noqa: E501 collection_formats = {} path_params = {} @@ -2757,14 +2846,14 @@ def list_delivery_liquidates_with_http_info(self, settle, **kwargs): # noqa: E5 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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( - '/delivery/{settle}/liquidates', - 'GET', + '/delivery/{settle}/liquidates', 'GET', path_params, query_params, header_params, @@ -2777,11 +2866,10 @@ def list_delivery_liquidates_with_http_info(self, settle, **kwargs): # noqa: E5 _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, - ) + collection_formats=collection_formats) def list_delivery_settlements(self, settle, **kwargs): # noqa: E501 - """List settlement history # noqa: E501 + """Query settlement records # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -2791,8 +2879,8 @@ def list_delivery_settlements(self, settle, **kwargs): # noqa: E501 :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) :param str contract: Futures contract - :param int limit: Maximum number of records to be returned in a single list - :param int at: Specify a settlement timestamp + :param int limit: Maximum number of records returned in a single list + :param int at: Specify settlement timestamp :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -2808,7 +2896,7 @@ def list_delivery_settlements(self, settle, **kwargs): # noqa: E501 return self.list_delivery_settlements_with_http_info(settle, **kwargs) # noqa: E501 def list_delivery_settlements_with_http_info(self, settle, **kwargs): # noqa: E501 - """List settlement history # noqa: E501 + """Query settlement records # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -2818,8 +2906,8 @@ def list_delivery_settlements_with_http_info(self, settle, **kwargs): # noqa: E :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) :param str contract: Futures contract - :param int limit: Maximum number of records to be returned in a single list - :param int at: Specify a settlement timestamp + :param int limit: Maximum number of records returned in a single list + :param int at: Specify settlement timestamp :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -2836,34 +2924,38 @@ def list_delivery_settlements_with_http_info(self, settle, **kwargs): # noqa: E local_var_params = locals() - all_params = ['settle', 'contract', 'limit', 'at'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'settle', + 'contract', + 'limit', + '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_delivery_settlements" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_delivery_settlements" % 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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `settle` when calling `list_delivery_settlements`" - ) # 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_delivery_settlements`, 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_delivery_settlements`, must be a value greater than or equal to `1`" - ) # noqa: E501 + 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_delivery_settlements`") # 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_delivery_settlements`, 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_delivery_settlements`, must be a value greater than or equal to `1`") # noqa: E501 collection_formats = {} path_params = {} @@ -2885,14 +2977,14 @@ def list_delivery_settlements_with_http_info(self, settle, **kwargs): # noqa: E body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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( - '/delivery/{settle}/settlements', - 'GET', + '/delivery/{settle}/settlements', 'GET', path_params, query_params, header_params, @@ -2905,11 +2997,145 @@ def list_delivery_settlements_with_http_info(self, settle, **kwargs): # noqa: E _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, + collection_formats=collection_formats) + + def list_delivery_risk_limit_tiers(self, settle, **kwargs): # noqa: E501 + """Query risk limit tiers # noqa: E501 + + When the 'contract' parameter is not passed, the default is to query the risk limits for the top 100 markets. 'Limit' and 'offset' correspond to pagination queries at the market level, not to the length of the returned array. This only takes effect when the contract parameter is empty. # 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_delivery_risk_limit_tiers(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 + :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.FuturesLimitRiskTiers] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_delivery_risk_limit_tiers_with_http_info(settle, **kwargs) # noqa: E501 + + def list_delivery_risk_limit_tiers_with_http_info(self, settle, **kwargs): # noqa: E501 + """Query risk limit tiers # noqa: E501 + + When the 'contract' parameter is not passed, the default is to query the risk limits for the top 100 markets. 'Limit' and 'offset' correspond to pagination queries at the market level, not to the length of the returned array. This only takes effect when the contract parameter is empty. # 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_delivery_risk_limit_tiers_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 + :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.FuturesLimitRiskTiers], 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' + ] + 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_delivery_risk_limit_tiers" % 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_delivery_risk_limit_tiers`") # 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_delivery_risk_limit_tiers`, 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_delivery_risk_limit_tiers`, 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_delivery_risk_limit_tiers`, 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 + + 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( + '/delivery/{settle}/risk_limit_tiers', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[FuturesLimitRiskTiers]', # 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_price_triggered_delivery_orders(self, settle, status, **kwargs): # noqa: E501 - """List all auto orders # noqa: E501 + """Query auto order list # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -2918,9 +3144,9 @@ def list_price_triggered_delivery_orders(self, settle, status, **kwargs): # noq :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param str status: Only list the orders with this status (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 to be returned in a single list + :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 @@ -2937,7 +3163,7 @@ def list_price_triggered_delivery_orders(self, settle, status, **kwargs): # noq return self.list_price_triggered_delivery_orders_with_http_info(settle, status, **kwargs) # noqa: E501 def list_price_triggered_delivery_orders_with_http_info(self, settle, status, **kwargs): # noqa: E501 - """List all auto orders # noqa: E501 + """Query auto order list # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -2946,9 +3172,9 @@ def list_price_triggered_delivery_orders_with_http_info(self, settle, status, ** :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param str status: Only list the orders with this status (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 to be returned in a single list + :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 @@ -2966,49 +3192,45 @@ def list_price_triggered_delivery_orders_with_http_info(self, settle, status, ** local_var_params = locals() - all_params = ['settle', 'status', 'contract', 'limit', 'offset'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'settle', + 'status', + 'contract', + '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_price_triggered_delivery_orders" % k + "Got an unexpected keyword argument '%s'" + " to method list_price_triggered_delivery_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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `settle` when calling `list_price_triggered_delivery_orders`" - ) # noqa: E501 + 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_price_triggered_delivery_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 local_var_params['status'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `status` when calling `list_price_triggered_delivery_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_price_triggered_delivery_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_price_triggered_delivery_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_price_triggered_delivery_orders`, must be a value greater than or equal to `0`" - ) # noqa: E501 + 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_price_triggered_delivery_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_price_triggered_delivery_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_price_triggered_delivery_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_price_triggered_delivery_orders`, must be a value greater than or equal to `0`") # noqa: E501 collection_formats = {} path_params = {} @@ -3032,14 +3254,14 @@ def list_price_triggered_delivery_orders_with_http_info(self, settle, status, ** body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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( - '/delivery/{settle}/price_orders', - 'GET', + '/delivery/{settle}/price_orders', 'GET', path_params, query_params, header_params, @@ -3052,11 +3274,10 @@ def list_price_triggered_delivery_orders_with_http_info(self, settle, status, ** _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, - ) + collection_formats=collection_formats) def create_price_triggered_delivery_order(self, settle, futures_price_triggered_order, **kwargs): # noqa: E501 - """Create a price-triggered order # noqa: E501 + """Create price-triggered order # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -3078,14 +3299,10 @@ def create_price_triggered_delivery_order(self, settle, futures_price_triggered_ returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.create_price_triggered_delivery_order_with_http_info( - settle, futures_price_triggered_order, **kwargs - ) # noqa: E501 + return self.create_price_triggered_delivery_order_with_http_info(settle, futures_price_triggered_order, **kwargs) # noqa: E501 - def create_price_triggered_delivery_order_with_http_info( - self, settle, futures_price_triggered_order, **kwargs - ): # noqa: E501 - """Create a price-triggered order # noqa: E501 + def create_price_triggered_delivery_order_with_http_info(self, settle, futures_price_triggered_order, **kwargs): # noqa: E501 + """Create price-triggered order # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -3111,31 +3328,35 @@ def create_price_triggered_delivery_order_with_http_info( local_var_params = locals() - all_params = ['settle', 'futures_price_triggered_order'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'settle', + 'futures_price_triggered_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_price_triggered_delivery_order" % k + "Got an unexpected keyword argument '%s'" + " to method create_price_triggered_delivery_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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `settle` when calling `create_price_triggered_delivery_order`" - ) # noqa: E501 + 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_price_triggered_delivery_order`") # noqa: E501 # verify the required parameter 'futures_price_triggered_order' is set - if self.api_client.client_side_validation and ( - 'futures_price_triggered_order' not in local_var_params - or local_var_params['futures_price_triggered_order'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `futures_price_triggered_order` when calling `create_price_triggered_delivery_order`" - ) # noqa: E501 + if self.api_client.client_side_validation and ('futures_price_triggered_order' not in local_var_params or # noqa: E501 + local_var_params['futures_price_triggered_order'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `futures_price_triggered_order` when calling `create_price_triggered_delivery_order`") # noqa: E501 collection_formats = {} @@ -3154,19 +3375,18 @@ def create_price_triggered_delivery_order_with_http_info( if 'futures_price_triggered_order' in local_var_params: body_params = local_var_params['futures_price_triggered_order'] # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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 + ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( - '/delivery/{settle}/price_orders', - 'POST', + '/delivery/{settle}/price_orders', 'POST', path_params, query_params, header_params, @@ -3179,11 +3399,10 @@ def create_price_triggered_delivery_order_with_http_info( _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, - ) + collection_formats=collection_formats) def cancel_price_triggered_delivery_order_list(self, settle, contract, **kwargs): # noqa: E501 - """Cancel all open orders # noqa: E501 + """Cancel all auto orders # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -3208,7 +3427,7 @@ def cancel_price_triggered_delivery_order_list(self, settle, contract, **kwargs) return self.cancel_price_triggered_delivery_order_list_with_http_info(settle, contract, **kwargs) # noqa: E501 def cancel_price_triggered_delivery_order_list_with_http_info(self, settle, contract, **kwargs): # noqa: E501 - """Cancel all open orders # noqa: E501 + """Cancel all auto orders # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -3234,8 +3453,18 @@ def cancel_price_triggered_delivery_order_list_with_http_info(self, settle, cont local_var_params = locals() - all_params = ['settle', 'contract'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'settle', + 'contract' + ] + 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: @@ -3246,19 +3475,13 @@ def cancel_price_triggered_delivery_order_list_with_http_info(self, settle, cont 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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `settle` when calling `cancel_price_triggered_delivery_order_list`" - ) # noqa: E501 + 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_delivery_order_list`") # noqa: E501 # verify the required parameter 'contract' is set - if self.api_client.client_side_validation and ( - 'contract' not in local_var_params or local_var_params['contract'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `contract` when calling `cancel_price_triggered_delivery_order_list`" - ) # noqa: E501 + 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 `cancel_price_triggered_delivery_order_list`") # noqa: E501 collection_formats = {} @@ -3277,14 +3500,14 @@ def cancel_price_triggered_delivery_order_list_with_http_info(self, settle, cont body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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( - '/delivery/{settle}/price_orders', - 'DELETE', + '/delivery/{settle}/price_orders', 'DELETE', path_params, query_params, header_params, @@ -3297,11 +3520,10 @@ def cancel_price_triggered_delivery_order_list_with_http_info(self, settle, cont _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, - ) + collection_formats=collection_formats) def get_price_triggered_delivery_order(self, settle, order_id, **kwargs): # noqa: E501 - """Get a single order # noqa: E501 + """Query single auto order details # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -3310,7 +3532,7 @@ def get_price_triggered_delivery_order(self, settle, order_id, **kwargs): # noq :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param str order_id: Retrieve the data of the order with the specified ID (required) + :param str 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. @@ -3326,7 +3548,7 @@ def get_price_triggered_delivery_order(self, settle, order_id, **kwargs): # noq return self.get_price_triggered_delivery_order_with_http_info(settle, order_id, **kwargs) # noqa: E501 def get_price_triggered_delivery_order_with_http_info(self, settle, order_id, **kwargs): # noqa: E501 - """Get a single order # noqa: E501 + """Query single auto order details # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -3335,7 +3557,7 @@ def get_price_triggered_delivery_order_with_http_info(self, settle, order_id, ** :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param str order_id: Retrieve the data of the order with the specified ID (required) + :param str 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 @@ -3352,30 +3574,35 @@ def get_price_triggered_delivery_order_with_http_info(self, settle, order_id, ** local_var_params = locals() - all_params = ['settle', 'order_id'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + 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_price_triggered_delivery_order" % k + "Got an unexpected keyword argument '%s'" + " to method get_price_triggered_delivery_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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `settle` when calling `get_price_triggered_delivery_order`" - ) # noqa: E501 + 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_price_triggered_delivery_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 local_var_params['order_id'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `order_id` when calling `get_price_triggered_delivery_order`" - ) # noqa: E501 + 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_price_triggered_delivery_order`") # noqa: E501 collection_formats = {} @@ -3394,14 +3621,14 @@ def get_price_triggered_delivery_order_with_http_info(self, settle, order_id, ** body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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( - '/delivery/{settle}/price_orders/{order_id}', - 'GET', + '/delivery/{settle}/price_orders/{order_id}', 'GET', path_params, query_params, header_params, @@ -3414,11 +3641,10 @@ def get_price_triggered_delivery_order_with_http_info(self, settle, order_id, ** _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, - ) + collection_formats=collection_formats) def cancel_price_triggered_delivery_order(self, settle, order_id, **kwargs): # noqa: E501 - """Cancel a single order # 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 @@ -3427,7 +3653,7 @@ def cancel_price_triggered_delivery_order(self, settle, order_id, **kwargs): # :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param str order_id: Retrieve the data of the order with the specified ID (required) + :param str 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. @@ -3443,7 +3669,7 @@ def cancel_price_triggered_delivery_order(self, settle, order_id, **kwargs): # return self.cancel_price_triggered_delivery_order_with_http_info(settle, order_id, **kwargs) # noqa: E501 def cancel_price_triggered_delivery_order_with_http_info(self, settle, order_id, **kwargs): # noqa: E501 - """Cancel a single order # 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 @@ -3452,7 +3678,7 @@ def cancel_price_triggered_delivery_order_with_http_info(self, settle, order_id, :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param str order_id: Retrieve the data of the order with the specified ID (required) + :param str 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 @@ -3469,30 +3695,35 @@ def cancel_price_triggered_delivery_order_with_http_info(self, settle, order_id, local_var_params = locals() - all_params = ['settle', 'order_id'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + 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 cancel_price_triggered_delivery_order" % k + "Got an unexpected keyword argument '%s'" + " to method cancel_price_triggered_delivery_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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `settle` when calling `cancel_price_triggered_delivery_order`" - ) # noqa: E501 + 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_delivery_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 local_var_params['order_id'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `order_id` when calling `cancel_price_triggered_delivery_order`" - ) # noqa: E501 + 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_delivery_order`") # noqa: E501 collection_formats = {} @@ -3511,14 +3742,14 @@ def cancel_price_triggered_delivery_order_with_http_info(self, settle, order_id, body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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( - '/delivery/{settle}/price_orders/{order_id}', - 'DELETE', + '/delivery/{settle}/price_orders/{order_id}', 'DELETE', path_params, query_params, header_params, @@ -3531,5 +3762,4 @@ def cancel_price_triggered_delivery_order_with_http_info(self, settle, order_id, _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, - ) + collection_formats=collection_formats) diff --git a/gate_api/api/earn_api.py b/gate_api/api/earn_api.py new file mode 100644 index 0000000..2076555 --- /dev/null +++ b/gate_api/api/earn_api.py @@ -0,0 +1,1209 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market 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 EarnApi(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 swap_eth2(self, eth2_swap, **kwargs): # noqa: E501 + """ETH2 swap # 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) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param Eth2Swap eth2_swap: (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.swap_eth2_with_http_info(eth2_swap, **kwargs) # noqa: E501 + + def swap_eth2_with_http_info(self, eth2_swap, **kwargs): # noqa: E501 + """ETH2 swap # 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) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param Eth2Swap eth2_swap: (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 = [ + 'eth2_swap' + ] + 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 swap_eth2" % 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 = [] + + header_params = {} + + form_params = [] + 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 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/earn/staking/eth2/swap', '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 rate_list_eth2(self, **kwargs): # noqa: E501 + """ETH2 historical return rate query # 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) + >>> 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.Eth2RateList] + :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 + + def rate_list_eth2_with_http_info(self, **kwargs): # noqa: E501 + """ETH2 historical return rate query # 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) + >>> 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.Eth2RateList], 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 rate_list_eth2" % 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/staking/eth2/rate_records', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[Eth2RateList]', # 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_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.list_dual_investment_plans(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int plan_id: Financial project 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: list[gate_api.DualGetPlans] + :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 + + 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.list_dual_investment_plans_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int plan_id: Financial project 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(list[gate_api.DualGetPlans], 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 list_dual_investment_plans" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + 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 = [] # noqa: E501 + + return self.api_client.call_api( + '/earn/dual/investment_plan', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + 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 + _preload_content=local_var_params.get('_preload_content', True), + _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 + + 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) + >>> 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. + :param _request_timeout: timeout setting for 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.DualGetOrders] + :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 + + def list_dual_orders_with_http_info(self, **kwargs): # noqa: E501 + """Dual Investment 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_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 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 + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.DualGetOrders], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + '_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_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 '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( + '/earn/dual/orders', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + 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 + _preload_content=local_var_params.get('_preload_content', True), + _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 + + 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) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param PlaceDualInvestmentOrder place_dual_investment_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: None + :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 + + def place_dual_order_with_http_info(self, place_dual_investment_order, **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.place_dual_order_with_http_info(place_dual_investment_order, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param PlaceDualInvestmentOrder place_dual_investment_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: None + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'place_dual_investment_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 place_dual_order" % 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 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + 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 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/earn/dual/orders', '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_structured_products(self, status, **kwargs): # noqa: E501 + """Structured 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.list_structured_products(status, 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 _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.StructuredGetProjectList] + :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 + + def list_structured_products_with_http_info(self, status, **kwargs): # noqa: E501 + """Structured 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.list_structured_products_with_http_info(status, 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 _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.StructuredGetProjectList], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'status', + 'type', + '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_structured_products" % 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 + + 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 = {} + + 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/structured/products', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[StructuredGetProjectList]', # 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_structured_orders(self, **kwargs): # noqa: E501 + """Structured Product 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_structured_orders(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 _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.StructuredOrderList] + :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 + + def list_structured_orders_with_http_info(self, **kwargs): # noqa: E501 + """Structured Product 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_structured_orders_with_http_info(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 _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.StructuredOrderList], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + '_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_structured_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_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 = {} + + 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/structured/orders', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[StructuredOrderList]', # 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 place_structured_order(self, structured_buy, **kwargs): # noqa: E501 + """Place Structured Product 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.place_structured_order(structured_buy, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param StructuredBuy structured_buy: (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.place_structured_order_with_http_info(structured_buy, **kwargs) # noqa: E501 + + def place_structured_order_with_http_info(self, structured_buy, **kwargs): # noqa: E501 + """Place Structured Product 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.place_structured_order_with_http_info(structured_buy, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param StructuredBuy structured_buy: (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 = [ + 'structured_buy' + ] + 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 place_structured_order" % 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 = [] + + header_params = {} + + form_params = [] + 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 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/earn/structured/orders', '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 find_coin(self, find_coin, **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) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param FindCoin find_coin: (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.find_coin_with_http_info(find_coin, **kwargs) # noqa: E501 + + def find_coin_with_http_info(self, find_coin, **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) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param FindCoin find_coin: (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 = [ + 'find_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 find_coin" % k + ) + 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 = [] + + header_params = {} + + form_params = [] + 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 + + return self.api_client.call_api( + '/earn/staking/coins', 'GET', + 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 swap_staking_coin(self, swap_coin, **kwargs): # noqa: E501 + """On-chain token swap for earned 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.swap_staking_coin(swap_coin, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param SwapCoin swap_coin: (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.SwapCoinStruct + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.swap_staking_coin_with_http_info(swap_coin, **kwargs) # noqa: E501 + + def swap_staking_coin_with_http_info(self, swap_coin, **kwargs): # noqa: E501 + """On-chain token swap for earned 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.swap_staking_coin_with_http_info(swap_coin, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param SwapCoin swap_coin: (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.SwapCoinStruct, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'swap_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 swap_staking_coin" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'swap_coin' is set + if self.api_client.client_side_validation and ('swap_coin' not in local_var_params or # noqa: E501 + local_var_params['swap_coin'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `swap_coin` when calling `swap_staking_coin`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'swap_coin' in local_var_params: + body_params = local_var_params['swap_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 + + return self.api_client.call_api( + '/earn/staking/swap', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='SwapCoinStruct', # 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 new file mode 100644 index 0000000..4d37fd4 --- /dev/null +++ b/gate_api/api/earn_uni_api.py @@ -0,0 +1,1338 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market 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 EarnUniApi(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_uni_currencies(self, **kwargs): # noqa: E501 + """Query lending 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.list_uni_currencies(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.UniCurrency] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_uni_currencies_with_http_info(**kwargs) # noqa: E501 + + def list_uni_currencies_with_http_info(self, **kwargs): # noqa: E501 + """Query lending 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.list_uni_currencies_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.UniCurrency], 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_uni_currencies" % 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( + '/earn/uni/currencies', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[UniCurrency]', # 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_uni_currency(self, currency, **kwargs): # noqa: E501 + """Query single lending currency 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_uni_currency(currency, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency: Currency (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.UniCurrency + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_uni_currency_with_http_info(currency, **kwargs) # noqa: E501 + + def get_uni_currency_with_http_info(self, currency, **kwargs): # noqa: E501 + """Query single lending currency 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_uni_currency_with_http_info(currency, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency: Currency (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.UniCurrency, 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 get_uni_currency" % k + ) + 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 `get_uni_currency`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'currency' in local_var_params: + path_params['currency'] = local_var_params['currency'] # 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( + '/earn/uni/currencies/{currency}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='UniCurrency', # 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_user_uni_lends(self, **kwargs): # noqa: E501 + """Query user's lending 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_user_uni_lends(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency: Query by specified currency name + :param int page: Page number + :param int limit: Maximum number of items returned. Default: 100, minimum: 1, 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: list[gate_api.UniLend] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_user_uni_lends_with_http_info(**kwargs) # noqa: E501 + + def list_user_uni_lends_with_http_info(self, **kwargs): # noqa: E501 + """Query user's lending 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_user_uni_lends_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 int page: Page number + :param int limit: Maximum number of items returned. Default: 100, minimum: 1, 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(list[gate_api.UniLend], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'currency', + '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_user_uni_lends" % 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_user_uni_lends`, 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_user_uni_lends`, 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_user_uni_lends`, 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 '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( + '/earn/uni/lends', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[UniLend]', # 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_uni_lend(self, create_uni_lend, **kwargs): # noqa: E501 + """Create lending or redemption # noqa: E501 + + Lending: When lending, a minimum lending rate must be set. After successful lending is determined on an hourly basis, earnings will be calculated based on the determined rate. Earnings for each hour will be settled at the top of the hour. If lending fails due to an excessively high interest rate, no interest will be earned for that hour. If funds are redeemed before the hourly for that hour. Priority: Under the same interest rate, wealth management products created or modified earlier will be prioritized for lending. Redemption: For funds that failed to be lent, redemption will be credited immediately. For funds successfully lent, they are entitled to the earnings for that hour, and redemption will be credited in the next hourly interval. Note: The two minutes before and after the hourly mark are the settlement period, during which lending and redemption are prohibited. # 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_uni_lend(create_uni_lend, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param CreateUniLend create_uni_lend: (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.create_uni_lend_with_http_info(create_uni_lend, **kwargs) # noqa: E501 + + def create_uni_lend_with_http_info(self, create_uni_lend, **kwargs): # noqa: E501 + """Create lending or redemption # noqa: E501 + + Lending: When lending, a minimum lending rate must be set. After successful lending is determined on an hourly basis, earnings will be calculated based on the determined rate. Earnings for each hour will be settled at the top of the hour. If lending fails due to an excessively high interest rate, no interest will be earned for that hour. If funds are redeemed before the hourly for that hour. Priority: Under the same interest rate, wealth management products created or modified earlier will be prioritized for lending. Redemption: For funds that failed to be lent, redemption will be credited immediately. For funds successfully lent, they are entitled to the earnings for that hour, and redemption will be credited in the next hourly interval. Note: The two minutes before and after the hourly mark are the settlement period, during which lending and redemption are prohibited. # 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_uni_lend_with_http_info(create_uni_lend, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param CreateUniLend create_uni_lend: (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 = [ + 'create_uni_lend' + ] + 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_uni_lend" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'create_uni_lend' is set + if self.api_client.client_side_validation and ('create_uni_lend' not in local_var_params or # noqa: E501 + local_var_params['create_uni_lend'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `create_uni_lend` when calling `create_uni_lend`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'create_uni_lend' in local_var_params: + body_params = local_var_params['create_uni_lend'] + # 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/uni/lends', '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 change_uni_lend(self, patch_uni_lend, **kwargs): # noqa: E501 + """Amend user lending information # noqa: E501 + + Currently only supports amending minimum interest rate (hourly) # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.change_uni_lend(patch_uni_lend, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param PatchUniLend patch_uni_lend: (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.change_uni_lend_with_http_info(patch_uni_lend, **kwargs) # noqa: E501 + + def change_uni_lend_with_http_info(self, patch_uni_lend, **kwargs): # noqa: E501 + """Amend user lending information # noqa: E501 + + Currently only supports amending minimum interest rate (hourly) # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.change_uni_lend_with_http_info(patch_uni_lend, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param PatchUniLend patch_uni_lend: (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 = [ + 'patch_uni_lend' + ] + 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 change_uni_lend" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'patch_uni_lend' is set + if self.api_client.client_side_validation and ('patch_uni_lend' not in local_var_params or # noqa: E501 + local_var_params['patch_uni_lend'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `patch_uni_lend` when calling `change_uni_lend`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'patch_uni_lend' in local_var_params: + body_params = local_var_params['patch_uni_lend'] + # 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/uni/lends', 'PATCH', + 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_uni_lend_records(self, **kwargs): # noqa: E501 + """Query lending transaction 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_uni_lend_records(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency: Query by specified currency name + :param int page: Page number + :param int limit: Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 + :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 type: Operation type: lend - Lend, redeem - Redeem + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.UniLendRecord] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_uni_lend_records_with_http_info(**kwargs) # noqa: E501 + + def list_uni_lend_records_with_http_info(self, **kwargs): # noqa: E501 + """Query lending transaction 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_uni_lend_records_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 int page: Page number + :param int limit: Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 + :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 type: Operation type: lend - Lend, redeem - Redeem + :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.UniLendRecord], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'currency', + 'page', + 'limit', + '_from', + 'to', + '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_uni_lend_records" % 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_uni_lend_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'] > 100: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `list_uni_lend_records`, 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_uni_lend_records`, 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 '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 '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 = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/earn/uni/lend_records', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[UniLendRecord]', # 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_uni_interest(self, currency, **kwargs): # noqa: E501 + """Query user's total interest income for specified currency # 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_uni_interest(currency, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency: Currency (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.UniLendInterest + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_uni_interest_with_http_info(currency, **kwargs) # noqa: E501 + + def get_uni_interest_with_http_info(self, currency, **kwargs): # noqa: E501 + """Query user's total interest income for specified currency # 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_uni_interest_with_http_info(currency, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency: Currency (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.UniLendInterest, 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 get_uni_interest" % k + ) + 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 `get_uni_interest`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'currency' in local_var_params: + path_params['currency'] = local_var_params['currency'] # 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( + '/earn/uni/interests/{currency}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='UniLendInterest', # 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_uni_interest_records(self, **kwargs): # noqa: E501 + """Query user dividend 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_uni_interest_records(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency: Query by specified currency name + :param int page: Page number + :param int limit: Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 + :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 _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.UniInterestRecord] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_uni_interest_records_with_http_info(**kwargs) # noqa: E501 + + def list_uni_interest_records_with_http_info(self, **kwargs): # noqa: E501 + """Query user dividend 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_uni_interest_records_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 int page: Page number + :param int limit: Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 + :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 _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.UniInterestRecord], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'currency', + 'page', + 'limit', + '_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_uni_interest_records" % 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_uni_interest_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'] > 100: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `list_uni_interest_records`, 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_uni_interest_records`, 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 '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 + + 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/uni/interest_records', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[UniInterestRecord]', # 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_uni_interest_status(self, currency, **kwargs): # noqa: E501 + """Query currency interest compounding 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.get_uni_interest_status(currency, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency: Currency (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.UniCurrencyInterest + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_uni_interest_status_with_http_info(currency, **kwargs) # noqa: E501 + + def get_uni_interest_status_with_http_info(self, currency, **kwargs): # noqa: E501 + """Query currency interest compounding 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.get_uni_interest_status_with_http_info(currency, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency: Currency (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.UniCurrencyInterest, 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 get_uni_interest_status" % k + ) + 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 `get_uni_interest_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'currency' in local_var_params: + path_params['currency'] = local_var_params['currency'] # 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( + '/earn/uni/interest_status/{currency}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='UniCurrencyInterest', # 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_uni_chart(self, _from, to, asset, **kwargs): # noqa: E501 + """UniLoan currency annualized trend chart # noqa: E501 + + Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-07-17 21:35+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_uni_chart(_from, to, asset, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int _from: Start timestamp in seconds, maximum span 30 days (required) + :param int to: End timestamp in seconds, maximum span 30 days (required) + :param str asset: Currency name (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.InlineResponse200] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_uni_chart_with_http_info(_from, to, asset, **kwargs) # noqa: E501 + + def list_uni_chart_with_http_info(self, _from, to, asset, **kwargs): # noqa: E501 + """UniLoan currency annualized trend chart # noqa: E501 + + Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-07-17 21:35+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_uni_chart_with_http_info(_from, to, asset, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int _from: Start timestamp in seconds, maximum span 30 days (required) + :param int to: End timestamp in seconds, maximum span 30 days (required) + :param str asset: Currency name (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.InlineResponse200], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + '_from', + 'to', + 'asset' + ] + 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_uni_chart" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # 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_uni_chart`") # noqa: E501 + # verify the required parameter 'to' is set + if self.api_client.client_side_validation and ('to' not in local_var_params or # noqa: E501 + local_var_params['to'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `to` when calling `list_uni_chart`") # noqa: E501 + # 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_uni_chart`") # 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 '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 + + 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/uni/chart', '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_uni_rate(self, **kwargs): # noqa: E501 + """Currency estimated annualized interest rate # noqa: E501 + + Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-07-17 21:35+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_uni_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: list[gate_api.InlineResponse2001] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_uni_rate_with_http_info(**kwargs) # noqa: E501 + + def list_uni_rate_with_http_info(self, **kwargs): # noqa: E501 + """Currency estimated annualized interest rate # noqa: E501 + + Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-07-17 21:35+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_uni_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(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 = [ + ] + 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_uni_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 = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/earn/uni/rate', '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) diff --git a/gate_api/api/flash_swap_api.py b/gate_api/api/flash_swap_api.py new file mode 100644 index 0000000..ffbba85 --- /dev/null +++ b/gate_api/api/flash_swap_api.py @@ -0,0 +1,648 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market 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 FlashSwapApi(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_flash_swap_currency_pair(self, **kwargs): # noqa: E501 + """List All Supported Currency Pairs In Flash Swap # noqa: E501 + + `BTC_GT` represents selling BTC and buying GT. The limits for each currency may vary across different currency pairs. It is not necessary that two currencies that can be swapped instantaneously can be exchanged with each other. For example, it is possible to sell BTC and buy GT, but it does not necessarily mean that GT can be sold to buy BTC. # 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_flash_swap_currency_pair(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency: Query by specified currency name + :param int page: Page number + :param int limit: Maximum number of items returned. Default: 1000, minimum: 1, maximum: 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.FlashSwapCurrencyPair] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_flash_swap_currency_pair_with_http_info(**kwargs) # noqa: E501 + + def list_flash_swap_currency_pair_with_http_info(self, **kwargs): # noqa: E501 + """List All Supported Currency Pairs In Flash Swap # noqa: E501 + + `BTC_GT` represents selling BTC and buying GT. The limits for each currency may vary across different currency pairs. It is not necessary that two currencies that can be swapped instantaneously can be exchanged with each other. For example, it is possible to sell BTC and buy GT, but it does not necessarily mean that GT can be sold to buy BTC. # 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_flash_swap_currency_pair_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 int page: Page number + :param int limit: Maximum number of items returned. Default: 1000, minimum: 1, maximum: 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.FlashSwapCurrencyPair], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'currency', + '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_flash_swap_currency_pair" % 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_flash_swap_currency_pair`, 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_flash_swap_currency_pair`, 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_flash_swap_currency_pair`, 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 '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( + '/flash_swap/currency_pairs', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[FlashSwapCurrencyPair]', # 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_flash_swap_orders(self, **kwargs): # noqa: E501 + """Query flash swap 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_flash_swap_orders(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int status: Flash swap order status `1` - success `2` - failed + :param str sell_currency: Asset name to sell - Retrieved from API `GET /flash_swap/currencies` for supported flash swap currencies + :param str buy_currency: Asset name to buy - Retrieved from API `GET /flash_swap/currencies` for supported flash swap currencies + :param bool reverse: Sort by ID in ascending or descending order, default `true` - `true`: ID descending order (most recent data first) - `false`: ID ascending order (oldest data first) + :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. + :param _request_timeout: timeout setting for 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.FlashSwapOrder] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_flash_swap_orders_with_http_info(**kwargs) # noqa: E501 + + def list_flash_swap_orders_with_http_info(self, **kwargs): # noqa: E501 + """Query flash swap 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_flash_swap_orders_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int status: Flash swap order status `1` - success `2` - failed + :param str sell_currency: Asset name to sell - Retrieved from API `GET /flash_swap/currencies` for supported flash swap currencies + :param str buy_currency: Asset name to buy - Retrieved from API `GET /flash_swap/currencies` for supported flash swap currencies + :param bool reverse: Sort by ID in ascending or descending order, default `true` - `true`: ID descending order (most recent data first) - `false`: ID ascending order (oldest data first) + :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 + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.FlashSwapOrder], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'status', + 'sell_currency', + 'buy_currency', + 'reverse', + '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_flash_swap_orders" % 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'] > 1000: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `list_flash_swap_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_flash_swap_orders`, 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_flash_swap_orders`, must be a value greater than or equal to `1`") # 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 'sell_currency' in local_var_params and local_var_params['sell_currency'] is not None: # noqa: E501 + query_params.append(('sell_currency', local_var_params['sell_currency'])) # noqa: E501 + if 'buy_currency' in local_var_params and local_var_params['buy_currency'] is not None: # noqa: E501 + query_params.append(('buy_currency', local_var_params['buy_currency'])) # noqa: E501 + if 'reverse' in local_var_params and local_var_params['reverse'] is not None: # noqa: E501 + query_params.append(('reverse', local_var_params['reverse'])) # 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 = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/flash_swap/orders', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[FlashSwapOrder]', # 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(self, flash_swap_order_request, **kwargs): # noqa: E501 + """Create a flash swap order # noqa: E501 + + Initiate a flash swap preview in advance because order creation requires a preview result # 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(flash_swap_order_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param FlashSwapOrderRequest flash_swap_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.FlashSwapOrder + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.create_flash_swap_order_with_http_info(flash_swap_order_request, **kwargs) # noqa: E501 + + def create_flash_swap_order_with_http_info(self, flash_swap_order_request, **kwargs): # noqa: E501 + """Create a flash swap order # noqa: E501 + + Initiate a flash swap preview in advance because order creation requires a preview result # 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_with_http_info(flash_swap_order_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param FlashSwapOrderRequest flash_swap_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.FlashSwapOrder, 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_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_flash_swap_order" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'flash_swap_order_request' is set + if self.api_client.client_side_validation and ('flash_swap_order_request' not in local_var_params or # noqa: E501 + local_var_params['flash_swap_order_request'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `flash_swap_order_request` when calling `create_flash_swap_order`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'flash_swap_order_request' in local_var_params: + body_params = local_var_params['flash_swap_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( + '/flash_swap/orders', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='FlashSwapOrder', # 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_flash_swap_order(self, order_id, **kwargs): # noqa: E501 + """Query single flash swap 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_flash_swap_order(order_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int order_id: Flash swap 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.FlashSwapOrder + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_flash_swap_order_with_http_info(order_id, **kwargs) # noqa: E501 + + def get_flash_swap_order_with_http_info(self, order_id, **kwargs): # noqa: E501 + """Query single flash swap 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_flash_swap_order_with_http_info(order_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int order_id: Flash swap 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.FlashSwapOrder, 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_flash_swap_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_flash_swap_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( + '/flash_swap/orders/{order_id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='FlashSwapOrder', # 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(self, flash_swap_preview_request, **kwargs): # noqa: E501 + """Flash swap order 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.preview_flash_swap_order(flash_swap_preview_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param FlashSwapPreviewRequest flash_swap_preview_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.FlashSwapOrderPreview + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.preview_flash_swap_order_with_http_info(flash_swap_preview_request, **kwargs) # noqa: E501 + + def preview_flash_swap_order_with_http_info(self, flash_swap_preview_request, **kwargs): # noqa: E501 + """Flash swap order 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.preview_flash_swap_order_with_http_info(flash_swap_preview_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param FlashSwapPreviewRequest flash_swap_preview_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.FlashSwapOrderPreview, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'flash_swap_preview_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 preview_flash_swap_order" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'flash_swap_preview_request' is set + if self.api_client.client_side_validation and ('flash_swap_preview_request' not in local_var_params or # noqa: E501 + local_var_params['flash_swap_preview_request'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `flash_swap_preview_request` when calling `preview_flash_swap_order`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'flash_swap_preview_request' in local_var_params: + body_params = local_var_params['flash_swap_preview_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( + '/flash_swap/orders/preview', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='FlashSwapOrderPreview', # 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 9144d20..5d20be4 100644 --- a/gate_api/api/futures_api.py +++ b/gate_api/api/futures_api.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -18,7 +18,10 @@ import six from gate_api.api_client import ApiClient -from gate_api.exceptions import ApiTypeError, ApiValueError # noqa: F401 +from gate_api.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) class FuturesApi(object): @@ -34,7 +37,7 @@ def __init__(self, api_client=None): self.api_client = api_client def list_futures_contracts(self, settle, **kwargs): # noqa: E501 - """List all futures contracts # noqa: E501 + """Query all futures contracts # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -43,6 +46,8 @@ def list_futures_contracts(self, settle, **kwargs): # noqa: E501 :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. @@ -58,7 +63,7 @@ def list_futures_contracts(self, settle, **kwargs): # noqa: E501 return self.list_futures_contracts_with_http_info(settle, **kwargs) # noqa: E501 def list_futures_contracts_with_http_info(self, settle, **kwargs): # noqa: E501 - """List all futures contracts # noqa: E501 + """Query all futures contracts # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -67,6 +72,8 @@ def list_futures_contracts_with_http_info(self, settle, **kwargs): # noqa: E501 :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 @@ -83,22 +90,39 @@ def list_futures_contracts_with_http_info(self, settle, **kwargs): # noqa: E501 local_var_params = locals() - all_params = ['settle'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + 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" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_futures_contracts" % 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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `settle` when calling `list_futures_contracts`" - ) # noqa: E501 - + 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`") # 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`, 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`, 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`, must be a value greater than or equal to `0`") # noqa: E501 collection_formats = {} path_params = {} @@ -106,6 +130,10 @@ def list_futures_contracts_with_http_info(self, settle, **kwargs): # noqa: E501 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 = {} @@ -114,14 +142,14 @@ def list_futures_contracts_with_http_info(self, settle, **kwargs): # noqa: E501 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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', - 'GET', + '/futures/{settle}/contracts', 'GET', path_params, query_params, header_params, @@ -134,11 +162,10 @@ def list_futures_contracts_with_http_info(self, settle, **kwargs): # noqa: E501 _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, - ) + collection_formats=collection_formats) def get_futures_contract(self, settle, contract, **kwargs): # noqa: E501 - """Get a single contract # noqa: E501 + """Query single contract information # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -163,7 +190,7 @@ def get_futures_contract(self, settle, contract, **kwargs): # noqa: E501 return self.get_futures_contract_with_http_info(settle, contract, **kwargs) # noqa: E501 def get_futures_contract_with_http_info(self, settle, contract, **kwargs): # noqa: E501 - """Get a single contract # noqa: E501 + """Query single contract information # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -189,28 +216,35 @@ def get_futures_contract_with_http_info(self, settle, contract, **kwargs): # no local_var_params = locals() - all_params = ['settle', 'contract'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'settle', + 'contract' + ] + 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_contract" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_futures_contract" % 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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `settle` when calling `get_futures_contract`" - ) # noqa: E501 + 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_contract`") # noqa: E501 # verify the required parameter 'contract' is set - if self.api_client.client_side_validation and ( - 'contract' not in local_var_params or local_var_params['contract'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `contract` when calling `get_futures_contract`" - ) # noqa: E501 + 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_futures_contract`") # noqa: E501 collection_formats = {} @@ -229,14 +263,14 @@ def get_futures_contract_with_http_info(self, settle, contract, **kwargs): # no body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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/{contract}', - 'GET', + '/futures/{settle}/contracts/{contract}', 'GET', path_params, query_params, header_params, @@ -249,11 +283,10 @@ def get_futures_contract_with_http_info(self, settle, contract, **kwargs): # no _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, - ) + collection_formats=collection_formats) def list_futures_order_book(self, settle, contract, **kwargs): # noqa: E501 - """Futures order book # noqa: E501 + """Query futures market depth information # noqa: E501 Bids will be sorted by price from high to low, while asks sorted reversely # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -264,9 +297,9 @@ 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: Order depth. 0 means no aggregation is applied. default to 0 - :param int limit: Maximum number of order depth data in asks or bids - :param bool with_id: Whether the order book update ID will be returned. This ID increases by 1 on every order book update + :param str interval: Price precision for depth aggregation, 0 means no aggregation, defaults to 0 if not specified + :param int limit: Number of depth levels + :param bool with_id: Whether to return depth update ID. This ID increments by 1 each time depth changes :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -282,7 +315,7 @@ def list_futures_order_book(self, settle, contract, **kwargs): # noqa: E501 return self.list_futures_order_book_with_http_info(settle, contract, **kwargs) # noqa: E501 def list_futures_order_book_with_http_info(self, settle, contract, **kwargs): # noqa: E501 - """Futures order book # noqa: E501 + """Query futures market depth information # noqa: E501 Bids will be sorted by price from high to low, while asks sorted reversely # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -293,9 +326,9 @@ 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: Order depth. 0 means no aggregation is applied. default to 0 - :param int limit: Maximum number of order depth data in asks or bids - :param bool with_id: Whether the order book update ID will be returned. This ID increases by 1 on every order book update + :param str interval: Price precision for depth aggregation, 0 means no aggregation, defaults to 0 if not specified + :param int limit: Number of depth levels + :param bool with_id: Whether to return depth update ID. This ID increments by 1 each time depth changes :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -312,41 +345,43 @@ def list_futures_order_book_with_http_info(self, settle, contract, **kwargs): # local_var_params = locals() - all_params = ['settle', 'contract', 'interval', 'limit', 'with_id'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'settle', + 'contract', + 'interval', + 'limit', + 'with_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_order_book" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_futures_order_book" % 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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `settle` when calling `list_futures_order_book`" - ) # noqa: E501 + 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_order_book`") # noqa: E501 # verify the required parameter 'contract' is set - if self.api_client.client_side_validation and ( - 'contract' not in local_var_params or local_var_params['contract'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `contract` when calling `list_futures_order_book`" - ) # noqa: E501 - - 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_futures_order_book`, 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_futures_order_book`, must be a value greater than or equal to `1`" - ) # noqa: E501 + 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 `list_futures_order_book`") # noqa: E501 + + 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_futures_order_book`, 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_futures_order_book`, must be a value greater than or equal to `1`") # noqa: E501 collection_formats = {} path_params = {} @@ -370,14 +405,14 @@ def list_futures_order_book_with_http_info(self, settle, contract, **kwargs): # body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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}/order_book', - 'GET', + '/futures/{settle}/order_book', 'GET', path_params, query_params, header_params, @@ -390,11 +425,10 @@ def list_futures_order_book_with_http_info(self, settle, contract, **kwargs): # _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, - ) + collection_formats=collection_formats) def list_futures_trades(self, settle, contract, **kwargs): # noqa: E501 - """Futures trading history # noqa: E501 + """Futures market transaction records # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -404,10 +438,11 @@ def list_futures_trades(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 int limit: Maximum number of records to be returned in a single list + :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. Use `from` and `to` instead to limit time range :param int _from: Specify starting time in Unix seconds. If not specified, `to` and `limit` will be used to limit response items. If items between `from` and `to` are more than `limit`, only `limit` number will be returned. - :param int to: Specify end time in Unix seconds, default to current time + :param int to: Specify end time in Unix seconds, default to current time. :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -423,7 +458,7 @@ def list_futures_trades(self, settle, contract, **kwargs): # noqa: E501 return self.list_futures_trades_with_http_info(settle, contract, **kwargs) # noqa: E501 def list_futures_trades_with_http_info(self, settle, contract, **kwargs): # noqa: E501 - """Futures trading history # noqa: E501 + """Futures market transaction records # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -433,10 +468,11 @@ def list_futures_trades_with_http_info(self, settle, contract, **kwargs): # noq :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) :param str contract: Futures contract (required) - :param int limit: Maximum number of records to be returned in a single list + :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. Use `from` and `to` instead to limit time range :param int _from: Specify starting time in Unix seconds. If not specified, `to` and `limit` will be used to limit response items. If items between `from` and `to` are more than `limit`, only `limit` number will be returned. - :param int to: Specify end time in Unix seconds, default to current time + :param int to: Specify end time in Unix seconds, default to current time. :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -453,41 +489,47 @@ def list_futures_trades_with_http_info(self, settle, contract, **kwargs): # noq local_var_params = locals() - all_params = ['settle', 'contract', 'limit', 'last_id', '_from', 'to'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'settle', + 'contract', + 'limit', + 'offset', + 'last_id', + '_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_futures_trades" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_futures_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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `settle` when calling `list_futures_trades`" - ) # noqa: E501 + 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_trades`") # noqa: E501 # verify the required parameter 'contract' is set - if self.api_client.client_side_validation and ( - 'contract' not in local_var_params or local_var_params['contract'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `contract` when calling `list_futures_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 `list_futures_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 `list_futures_trades`, must be a value greater than or equal to `1`" - ) # noqa: E501 + 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 `list_futures_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 `list_futures_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 `list_futures_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 `list_futures_trades`, must be a value greater than or equal to `0`") # noqa: E501 collection_formats = {} path_params = {} @@ -499,6 +541,8 @@ def list_futures_trades_with_http_info(self, settle, contract, **kwargs): # noq 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 '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 @@ -513,14 +557,14 @@ def list_futures_trades_with_http_info(self, settle, contract, **kwargs): # noq body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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}/trades', - 'GET', + '/futures/{settle}/trades', 'GET', path_params, query_params, header_params, @@ -533,11 +577,10 @@ def list_futures_trades_with_http_info(self, settle, contract, **kwargs): # noq _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, - ) + collection_formats=collection_formats) def list_futures_candlesticks(self, settle, contract, **kwargs): # noqa: E501 - """Get futures candlesticks # noqa: E501 + """Futures market K-line chart # noqa: E501 Return specified contract candlesticks. If prefix `contract` with `mark_`, the contract's mark price candlesticks are returned; if prefix with `index_`, index price candlesticks will be returned. Maximum of 2000 points are returned in one query. Be sure not to exceed the limit when specifying `from`, `to` and `interval` # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -549,9 +592,10 @@ def list_futures_candlesticks(self, settle, contract, **kwargs): # noqa: E501 :param str settle: Settle currency (required) :param str contract: Futures contract (required) :param int _from: Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified - :param int to: End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time - :param int limit: Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. - :param str interval: Interval time between data points + :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 timezone: Time zone: all/utc0/utc8, default utc0 :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -567,7 +611,7 @@ def list_futures_candlesticks(self, settle, contract, **kwargs): # noqa: E501 return self.list_futures_candlesticks_with_http_info(settle, contract, **kwargs) # noqa: E501 def list_futures_candlesticks_with_http_info(self, settle, contract, **kwargs): # noqa: E501 - """Get futures candlesticks # noqa: E501 + """Futures market K-line chart # noqa: E501 Return specified contract candlesticks. If prefix `contract` with `mark_`, the contract's mark price candlesticks are returned; if prefix with `index_`, index price candlesticks will be returned. Maximum of 2000 points are returned in one query. Be sure not to exceed the limit when specifying `from`, `to` and `interval` # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -579,9 +623,10 @@ def list_futures_candlesticks_with_http_info(self, settle, contract, **kwargs): :param str settle: Settle currency (required) :param str contract: Futures contract (required) :param int _from: Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified - :param int to: End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time - :param int limit: Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. - :param str interval: Interval time between data points + :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 timezone: Time zone: all/utc0/utc8, default utc0 :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -598,35 +643,43 @@ def list_futures_candlesticks_with_http_info(self, settle, contract, **kwargs): local_var_params = locals() - all_params = ['settle', 'contract', '_from', 'to', 'limit', 'interval'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'settle', + 'contract', + '_from', + 'to', + 'limit', + 'interval', + 'timezone' + ] + 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_candlesticks" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_futures_candlesticks" % 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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `settle` when calling `list_futures_candlesticks`" - ) # noqa: E501 + 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_candlesticks`") # noqa: E501 # verify the required parameter 'contract' is set - if self.api_client.client_side_validation and ( - 'contract' not in local_var_params or local_var_params['contract'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `contract` when calling `list_futures_candlesticks`" - ) # noqa: E501 - - if ( - self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 2000 - ): # noqa: E501 - raise ApiValueError( - "Invalid value for parameter `limit` when calling `list_futures_candlesticks`, must be a value less than or equal to `2000`" - ) # noqa: E501 + 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 `list_futures_candlesticks`") # noqa: E501 + + if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 2000: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `list_futures_candlesticks`, must be a value less than or equal to `2000`") # noqa: E501 collection_formats = {} path_params = {} @@ -644,6 +697,8 @@ def list_futures_candlesticks_with_http_info(self, settle, contract, **kwargs): query_params.append(('limit', local_var_params['limit'])) # noqa: E501 if 'interval' in local_var_params and local_var_params['interval'] is not None: # noqa: E501 query_params.append(('interval', local_var_params['interval'])) # noqa: E501 + if 'timezone' in local_var_params and local_var_params['timezone'] is not None: # noqa: E501 + query_params.append(('timezone', local_var_params['timezone'])) # noqa: E501 header_params = {} @@ -652,14 +707,14 @@ def list_futures_candlesticks_with_http_info(self, settle, contract, **kwargs): body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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}/candlesticks', - 'GET', + '/futures/{settle}/candlesticks', 'GET', path_params, query_params, header_params, @@ -672,11 +727,155 @@ def list_futures_candlesticks_with_http_info(self, settle, contract, **kwargs): _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, + collection_formats=collection_formats) + + 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 + 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) + >>> 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 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: Time interval between data points + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.FuturesPremiumIndex] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_futures_premium_index_with_http_info(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 + 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) + >>> 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 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: Time interval between data points + :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.FuturesPremiumIndex], 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', + 'interval' + ] + 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_premium_index" % 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_premium_index`") # 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 `list_futures_premium_index`") # noqa: E501 + + if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 2000: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `list_futures_premium_index`, must be a value less than or equal to `2000`") # 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 'interval' in local_var_params and local_var_params['interval'] is not None: # noqa: E501 + query_params.append(('interval', local_var_params['interval'])) # 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}/premium_index', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[FuturesPremiumIndex]', # 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_tickers(self, settle, **kwargs): # noqa: E501 - """List futures tickers # noqa: E501 + """Get all futures trading statistics # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -701,7 +900,7 @@ def list_futures_tickers(self, settle, **kwargs): # noqa: E501 return self.list_futures_tickers_with_http_info(settle, **kwargs) # noqa: E501 def list_futures_tickers_with_http_info(self, settle, **kwargs): # noqa: E501 - """List futures tickers # noqa: E501 + """Get all futures trading statistics # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -727,21 +926,31 @@ def list_futures_tickers_with_http_info(self, settle, **kwargs): # noqa: E501 local_var_params = locals() - all_params = ['settle', 'contract'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'settle', + 'contract' + ] + 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_tickers" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_futures_tickers" % 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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `settle` when calling `list_futures_tickers`" - ) # noqa: E501 + 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_tickers`") # noqa: E501 collection_formats = {} @@ -760,14 +969,14 @@ def list_futures_tickers_with_http_info(self, settle, **kwargs): # noqa: E501 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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}/tickers', - 'GET', + '/futures/{settle}/tickers', 'GET', path_params, query_params, header_params, @@ -780,11 +989,10 @@ def list_futures_tickers_with_http_info(self, settle, **kwargs): # noqa: E501 _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, - ) + collection_formats=collection_formats) def list_futures_funding_rate_history(self, settle, contract, **kwargs): # noqa: E501 - """Funding rate history # noqa: E501 + """Futures market historical funding rate # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -794,7 +1002,9 @@ def list_futures_funding_rate_history(self, settle, contract, **kwargs): # noqa :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) :param str contract: Futures contract (required) - :param int limit: Maximum number of records to be returned in a single list + :param int limit: Maximum number of records returned in a single list + :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 _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -810,7 +1020,7 @@ def list_futures_funding_rate_history(self, settle, contract, **kwargs): # noqa return self.list_futures_funding_rate_history_with_http_info(settle, contract, **kwargs) # noqa: E501 def list_futures_funding_rate_history_with_http_info(self, settle, contract, **kwargs): # noqa: E501 - """Funding rate history # noqa: E501 + """Futures market historical funding rate # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -820,7 +1030,9 @@ def list_futures_funding_rate_history_with_http_info(self, settle, contract, **k :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) :param str contract: Futures contract (required) - :param int limit: Maximum number of records to be returned in a single list + :param int limit: Maximum number of records returned in a single list + :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 _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -837,43 +1049,43 @@ def list_futures_funding_rate_history_with_http_info(self, settle, contract, **k local_var_params = locals() - all_params = ['settle', 'contract', 'limit'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'settle', + 'contract', + 'limit', + '_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_futures_funding_rate_history" % k + "Got an unexpected keyword argument '%s'" + " to method list_futures_funding_rate_history" % 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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `settle` when calling `list_futures_funding_rate_history`" - ) # noqa: E501 + 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_funding_rate_history`") # noqa: E501 # verify the required parameter 'contract' is set - if self.api_client.client_side_validation and ( - 'contract' not in local_var_params or local_var_params['contract'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `contract` when calling `list_futures_funding_rate_history`" - ) # 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_funding_rate_history`, 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_funding_rate_history`, must be a value greater than or equal to `1`" - ) # noqa: E501 + 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 `list_futures_funding_rate_history`") # 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_funding_rate_history`, 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_funding_rate_history`, must be a value greater than or equal to `1`") # noqa: E501 collection_formats = {} path_params = {} @@ -885,6 +1097,10 @@ def list_futures_funding_rate_history_with_http_info(self, settle, contract, **k 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 '_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 = {} @@ -893,14 +1109,14 @@ def list_futures_funding_rate_history_with_http_info(self, settle, contract, **k body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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}/funding_rate', - 'GET', + '/futures/{settle}/funding_rate', 'GET', path_params, query_params, header_params, @@ -913,11 +1129,10 @@ def list_futures_funding_rate_history_with_http_info(self, settle, contract, **k _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, - ) + collection_formats=collection_formats) def list_futures_insurance_ledger(self, settle, **kwargs): # noqa: E501 - """Futures insurance balance history # noqa: E501 + """Futures market insurance fund history # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -926,7 +1141,7 @@ def list_futures_insurance_ledger(self, settle, **kwargs): # noqa: E501 :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param int limit: Maximum number of records to be returned in a single list + :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. @@ -942,7 +1157,7 @@ def list_futures_insurance_ledger(self, settle, **kwargs): # noqa: E501 return self.list_futures_insurance_ledger_with_http_info(settle, **kwargs) # noqa: E501 def list_futures_insurance_ledger_with_http_info(self, settle, **kwargs): # noqa: E501 - """Futures insurance balance history # noqa: E501 + """Futures market insurance fund history # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -951,7 +1166,7 @@ def list_futures_insurance_ledger_with_http_info(self, settle, **kwargs): # noq :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param int limit: Maximum number of records to be returned in a single list + :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 @@ -968,36 +1183,36 @@ def list_futures_insurance_ledger_with_http_info(self, settle, **kwargs): # noq local_var_params = locals() - all_params = ['settle', 'limit'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'settle', + '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_futures_insurance_ledger" % k + "Got an unexpected keyword argument '%s'" + " to method list_futures_insurance_ledger" % 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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `settle` when calling `list_futures_insurance_ledger`" - ) # 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_insurance_ledger`, 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_insurance_ledger`, must be a value greater than or equal to `1`" - ) # noqa: E501 + 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_insurance_ledger`") # 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_insurance_ledger`, 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_insurance_ledger`, must be a value greater than or equal to `1`") # noqa: E501 collection_formats = {} path_params = {} @@ -1015,14 +1230,14 @@ def list_futures_insurance_ledger_with_http_info(self, settle, **kwargs): # noq body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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}/insurance', - 'GET', + '/futures/{settle}/insurance', 'GET', path_params, query_params, header_params, @@ -1035,11 +1250,10 @@ def list_futures_insurance_ledger_with_http_info(self, settle, **kwargs): # noq _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, - ) + collection_formats=collection_formats) def list_contract_stats(self, settle, contract, **kwargs): # noqa: E501 - """Futures stats # noqa: E501 + """Futures statistics # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -1067,7 +1281,7 @@ def list_contract_stats(self, settle, contract, **kwargs): # noqa: E501 return self.list_contract_stats_with_http_info(settle, contract, **kwargs) # noqa: E501 def list_contract_stats_with_http_info(self, settle, contract, **kwargs): # noqa: E501 - """Futures stats # noqa: E501 + """Futures statistics # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -1096,41 +1310,43 @@ def list_contract_stats_with_http_info(self, settle, contract, **kwargs): # noq local_var_params = locals() - all_params = ['settle', 'contract', '_from', 'interval', 'limit'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'settle', + 'contract', + '_from', + 'interval', + '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_contract_stats" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_contract_stats" % 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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `settle` when calling `list_contract_stats`" - ) # noqa: E501 + 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_contract_stats`") # noqa: E501 # verify the required parameter 'contract' is set - if self.api_client.client_side_validation and ( - 'contract' not in local_var_params or local_var_params['contract'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `contract` when calling `list_contract_stats`" - ) # 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_contract_stats`, 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_contract_stats`, must be a value greater than or equal to `1`" - ) # noqa: E501 + 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 `list_contract_stats`") # 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_contract_stats`, 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_contract_stats`, must be a value greater than or equal to `1`") # noqa: E501 collection_formats = {} path_params = {} @@ -1154,14 +1370,14 @@ def list_contract_stats_with_http_info(self, settle, contract, **kwargs): # noq body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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}/contract_stats', - 'GET', + '/futures/{settle}/contract_stats', 'GET', path_params, query_params, header_params, @@ -1174,24 +1390,19 @@ def list_contract_stats_with_http_info(self, settle, contract, **kwargs): # noq _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, - ) + collection_formats=collection_formats) - def list_liquidated_orders(self, settle, **kwargs): # noqa: E501 - """Retrieve liquidation history # noqa: E501 + def get_index_constituents(self, settle, index, **kwargs): # noqa: E501 + """Query index constituents # noqa: E501 - Interval between `from` and `to` cannot exceeds 3600. Some private fields will not be returned in public endpoints. Refer to field description for detail. # 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_liquidated_orders(settle, async_req=True) + >>> thread = api.get_index_constituents(settle, index, 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 - :param int to: End timestamp - :param int limit: Maximum number of records to be returned in a single list + :param str index: Index name (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -1199,28 +1410,24 @@ def list_liquidated_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.FuturesLiquidate] + :rtype: gate_api.FuturesIndexConstituents :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.list_liquidated_orders_with_http_info(settle, **kwargs) # noqa: E501 + return self.get_index_constituents_with_http_info(settle, index, **kwargs) # noqa: E501 - def list_liquidated_orders_with_http_info(self, settle, **kwargs): # noqa: E501 - """Retrieve liquidation history # noqa: E501 + def get_index_constituents_with_http_info(self, settle, index, **kwargs): # noqa: E501 + """Query index constituents # noqa: E501 - Interval between `from` and `to` cannot exceeds 3600. Some private fields will not be returned in public endpoints. Refer to field description for detail. # 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_liquidated_orders_with_http_info(settle, async_req=True) + >>> thread = api.get_index_constituents_with_http_info(settle, index, 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 - :param int to: End timestamp - :param int limit: Maximum number of records to be returned in a single list + :param str index: Index name (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -1230,56 +1437,52 @@ def list_liquidated_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.FuturesLiquidate], status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(gate_api.FuturesIndexConstituents, 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'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'settle', + 'index' + ] + 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_liquidated_orders" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_index_constituents" % 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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `settle` when calling `list_liquidated_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_liquidated_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_liquidated_orders`, must be a value greater than or equal to `1`" - ) # noqa: E501 + 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_index_constituents`") # noqa: E501 + # verify the required parameter 'index' is set + if self.api_client.client_side_validation and ('index' not in local_var_params or # noqa: E501 + local_var_params['index'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `index` when calling `get_index_constituents`") # noqa: E501 + collection_formats = {} path_params = {} if 'settle' in local_var_params: path_params['settle'] = local_var_params['settle'] # noqa: E501 + if 'index' in local_var_params: + path_params['index'] = local_var_params['index'] # 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 header_params = {} @@ -1288,39 +1491,43 @@ def list_liquidated_orders_with_http_info(self, settle, **kwargs): # noqa: E501 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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}/liq_orders', - 'GET', + '/futures/{settle}/index_constituents/{index}', '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='FuturesIndexConstituents', # 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, - ) + collection_formats=collection_formats) - def list_futures_accounts(self, settle, **kwargs): # noqa: E501 - """Query futures account # noqa: E501 + def list_liquidated_orders(self, settle, **kwargs): # noqa: E501 + """Query liquidation order history # noqa: E501 + The time interval between from and to is maximum 3600. Some private fields are not returned by public interfaces, refer to field descriptions 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.list_futures_accounts(settle, async_req=True) + >>> thread = api.list_liquidated_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 _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 _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -1328,23 +1535,28 @@ def list_futures_accounts(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: gate_api.FuturesAccount + :rtype: list[gate_api.FuturesLiqOrder] :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.list_futures_accounts_with_http_info(settle, **kwargs) # noqa: E501 + return self.list_liquidated_orders_with_http_info(settle, **kwargs) # noqa: E501 - def list_futures_accounts_with_http_info(self, settle, **kwargs): # noqa: E501 - """Query futures account # noqa: E501 + def list_liquidated_orders_with_http_info(self, settle, **kwargs): # noqa: E501 + """Query liquidation order history # noqa: E501 + The time interval between from and to is maximum 3600. Some private fields are not returned by public interfaces, refer to field descriptions 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.list_futures_accounts_with_http_info(settle, async_req=True) + >>> thread = api.list_liquidated_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 _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 _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -1354,29 +1566,46 @@ def list_futures_accounts_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(gate_api.FuturesAccount, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(list[gate_api.FuturesLiqOrder], status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ local_var_params = locals() - all_params = ['settle'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'settle', + 'contract', + '_from', + 'to', + '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_futures_accounts" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_liquidated_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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `settle` when calling `list_futures_accounts`" - ) # noqa: E501 - + 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_liquidated_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_liquidated_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_liquidated_orders`, must be a value greater than or equal to `1`") # noqa: E501 collection_formats = {} path_params = {} @@ -1384,6 +1613,14 @@ def list_futures_accounts_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 '_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 header_params = {} @@ -1392,43 +1629,42 @@ def list_futures_accounts_with_http_info(self, settle, **kwargs): # noqa: E501 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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( - '/futures/{settle}/accounts', - 'GET', + '/futures/{settle}/liq_orders', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='FuturesAccount', # noqa: E501 + response_type='list[FuturesLiqOrder]', # 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, - ) + collection_formats=collection_formats) - def list_futures_account_book(self, settle, **kwargs): # noqa: E501 - """Query account book # noqa: E501 + def list_futures_risk_limit_tiers(self, settle, **kwargs): # noqa: E501 + """Query risk limit tiers # noqa: E501 + When the 'contract' parameter is not passed, the default is to query the risk limits for the top 100 markets. 'Limit' and 'offset' correspond to pagination queries at the market level, not to the length of the returned array. This only takes effect when the contract parameter is empty. # 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_account_book(settle, async_req=True) + >>> thread = api.list_futures_risk_limit_tiers(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 to be returned in a single list - :param int _from: Start timestamp - :param int to: End timestamp - :param str type: Changing Type: - dnw: Deposit & Withdraw - pnl: Profit & Loss by reducing position - fee: Trading fee - refr: Referrer rebate - fund: Funding - point_dnw: POINT Deposit & Withdraw - point_fee: POINT Trading fee - point_refr: POINT Referrer rebate + :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 _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -1436,27 +1672,27 @@ def list_futures_account_book(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.FuturesAccountBook] + :rtype: list[gate_api.FuturesLimitRiskTiers] :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.list_futures_account_book_with_http_info(settle, **kwargs) # noqa: E501 + return self.list_futures_risk_limit_tiers_with_http_info(settle, **kwargs) # noqa: E501 - def list_futures_account_book_with_http_info(self, settle, **kwargs): # noqa: E501 - """Query account book # noqa: E501 + def list_futures_risk_limit_tiers_with_http_info(self, settle, **kwargs): # noqa: E501 + """Query risk limit tiers # noqa: E501 + When the 'contract' parameter is not passed, the default is to query the risk limits for the top 100 markets. 'Limit' and 'offset' correspond to pagination queries at the market level, not to the length of the returned array. This only takes effect when the contract parameter is empty. # 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_account_book_with_http_info(settle, async_req=True) + >>> thread = api.list_futures_risk_limit_tiers_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 to be returned in a single list - :param int _from: Start timestamp - :param int to: End timestamp - :param str type: Changing Type: - dnw: Deposit & Withdraw - pnl: Profit & Loss by reducing position - fee: Trading fee - refr: Referrer rebate - fund: Funding - point_dnw: POINT Deposit & Withdraw - point_fee: POINT Trading fee - point_refr: POINT Referrer rebate + :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 _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -1466,41 +1702,47 @@ def list_futures_account_book_with_http_info(self, settle, **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.FuturesAccountBook], status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(list[gate_api.FuturesLimitRiskTiers], status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ local_var_params = locals() - all_params = ['settle', 'limit', '_from', 'to', 'type'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'settle', + 'contract', + '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_account_book" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_futures_risk_limit_tiers" % 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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `settle` when calling `list_futures_account_book`" - ) # 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_account_book`, 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_account_book`, must be a value greater than or equal to `1`" - ) # noqa: E501 + 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_risk_limit_tiers`") # 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_risk_limit_tiers`, 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_risk_limit_tiers`, 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_risk_limit_tiers`, must be a value greater than or equal to `0`") # noqa: E501 collection_formats = {} path_params = {} @@ -1508,14 +1750,12 @@ def list_futures_account_book_with_http_info(self, settle, **kwargs): # noqa: E 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 '_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 '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 = {} @@ -1524,35 +1764,34 @@ def list_futures_account_book_with_http_info(self, settle, **kwargs): # noqa: E body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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( - '/futures/{settle}/account_book', - 'GET', + '/futures/{settle}/risk_limit_tiers', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[FuturesAccountBook]', # noqa: E501 + response_type='list[FuturesLimitRiskTiers]', # 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, - ) + collection_formats=collection_formats) - def list_positions(self, settle, **kwargs): # noqa: E501 - """List all positions of a user # noqa: E501 + def list_futures_accounts(self, settle, **kwargs): # noqa: E501 + """Get futures account # 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_positions(settle, async_req=True) + >>> thread = api.list_futures_accounts(settle, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously @@ -1564,19 +1803,19 @@ def list_positions(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.Position] + :rtype: gate_api.FuturesAccount :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.list_positions_with_http_info(settle, **kwargs) # noqa: E501 + return self.list_futures_accounts_with_http_info(settle, **kwargs) # noqa: E501 - def list_positions_with_http_info(self, settle, **kwargs): # noqa: E501 - """List all positions of a user # noqa: E501 + def list_futures_accounts_with_http_info(self, settle, **kwargs): # noqa: E501 + """Get futures account # 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_positions_with_http_info(settle, async_req=True) + >>> thread = api.list_futures_accounts_with_http_info(settle, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously @@ -1590,26 +1829,37 @@ def list_positions_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.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. """ local_var_params = locals() - all_params = ['settle'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'settle' + ] + 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_positions" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_futures_accounts" % 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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError("Missing the required parameter `settle` when calling `list_positions`") # noqa: E501 + 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_accounts`") # noqa: E501 collection_formats = {} @@ -1626,65 +1876,76 @@ def list_positions_with_http_info(self, settle, **kwargs): # noqa: E501 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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}/positions', - 'GET', + '/futures/{settle}/accounts', 'GET', 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 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - ) + collection_formats=collection_formats) - def get_position(self, settle, contract, **kwargs): # noqa: E501 - """Get single position # noqa: E501 + def list_futures_account_book(self, settle, **kwargs): # noqa: E501 + """Query futures account change history # noqa: E501 + If the contract field is passed, only records containing this field after 2023-10-30 can be filtered. # 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_futures_account_book(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 (required) - :param _preload_content: if False, the urllib3.HTTPResponse object will + :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 type: Change types: - dnw: Deposit and withdrawal - pnl: Profit and loss from position reduction - fee: Trading fees - refr: Referrer rebates - fund: Funding fees - point_dnw: Point card deposit and withdrawal - point_fee: Point card trading fees - point_refr: Point card referrer rebates - bonus_offset: Trial fund deduction + :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for 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.Position + :rtype: list[gate_api.FuturesAccountBook] :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_futures_account_book_with_http_info(settle, **kwargs) # noqa: E501 - def get_position_with_http_info(self, settle, contract, **kwargs): # noqa: E501 - """Get single position # noqa: E501 + def list_futures_account_book_with_http_info(self, settle, **kwargs): # noqa: E501 + """Query futures account change history # noqa: E501 + If the contract field is passed, only records containing this field after 2023-10-30 can be filtered. # 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_futures_account_book_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 (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 type: Change types: - dnw: Deposit and withdrawal - pnl: Profit and loss from position reduction - fee: Trading fees - refr: Referrer rebates - fund: Funding fees - point_dnw: Point card deposit and withdrawal - point_fee: Point card trading fees - point_refr: Point card referrer rebates - bonus_offset: Trial fund deduction :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -1694,41 +1955,69 @@ 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.FuturesAccountBook], status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ local_var_params = locals() - all_params = ['settle', 'contract'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'settle', + 'contract', + 'limit', + 'offset', + '_from', + 'to', + '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_position" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_futures_account_book" % 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 local_var_params['settle'] is None # noqa: E501 - ): # 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 local_var_params['contract'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError("Missing the required parameter `contract` when calling `get_position`") # noqa: E501 - + 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_account_book`") # 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_account_book`, 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_account_book`, 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_account_book`, 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 '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 '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 = {} @@ -1737,41 +2026,41 @@ def get_position_with_http_info(self, settle, contract, **kwargs): # noqa: E501 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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}/positions/{contract}', - 'GET', + '/futures/{settle}/account_book', '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[FuturesAccountBook]', # 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, - ) + collection_formats=collection_formats) - def update_position_margin(self, settle, contract, change, **kwargs): # noqa: E501 - """Update position margin # noqa: E501 + def list_positions(self, settle, **kwargs): # noqa: E501 + """Get user 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.update_position_margin(settle, contract, change, async_req=True) + >>> thread = api.list_positions(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 (required) - :param str change: Margin change. Use positive number to increase margin, negative number otherwise. (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 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. @@ -1779,25 +2068,26 @@ def update_position_margin(self, settle, contract, change, **kwargs): # noqa: E 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.Position] :return: If the method is called asynchronously, 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.list_positions_with_http_info(settle, **kwargs) # noqa: E501 - def update_position_margin_with_http_info(self, settle, contract, change, **kwargs): # noqa: E501 - """Update position margin # noqa: E501 + def list_positions_with_http_info(self, settle, **kwargs): # noqa: E501 + """Get user 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.update_position_margin_with_http_info(settle, contract, change, async_req=True) + >>> thread = api.list_positions_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 (required) - :param str change: Margin change. Use positive number to increase margin, negative number otherwise. (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 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 @@ -1807,54 +2097,60 @@ def update_position_margin_with_http_info(self, settle, contract, change, **kwar 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.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'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'settle', + 'holding', + '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 update_position_margin" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_positions" % 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 local_var_params['settle'] is None # noqa: E501 - ): # 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 local_var_params['contract'] is None # noqa: E501 - ): # 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 local_var_params['change'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `change` when calling `update_position_margin`" - ) # noqa: E501 + 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_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'] < 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 + raise ApiValueError("Invalid value for parameter `offset` when calling `list_positions`, 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 '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 'holding' in local_var_params and local_var_params['holding'] is not None: # noqa: E501 + query_params.append(('holding', local_var_params['holding'])) # 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 = {} @@ -1863,42 +2159,39 @@ def update_position_margin_with_http_info(self, settle, contract, change, **kwar body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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}/positions/{contract}/margin', - 'POST', + '/futures/{settle}/positions', '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[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, - ) + collection_formats=collection_formats) - def update_position_leverage(self, settle, contract, leverage, **kwargs): # noqa: E501 - """Update position leverage # noqa: E501 + def get_position(self, settle, contract, **kwargs): # noqa: E501 + """Get single position 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.update_position_leverage(settle, contract, leverage, 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 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. @@ -1911,21 +2204,19 @@ def update_position_leverage(self, settle, contract, leverage, **kwargs): # noq 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_position_with_http_info(settle, contract, **kwargs) # noqa: E501 - def update_position_leverage_with_http_info(self, settle, contract, leverage, **kwargs): # noqa: E501 - """Update position leverage # noqa: E501 + def get_position_with_http_info(self, settle, contract, **kwargs): # noqa: E501 + """Get single position 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.update_position_leverage_with_http_info(settle, contract, leverage, 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 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 @@ -1942,35 +2233,35 @@ def update_position_leverage_with_http_info(self, settle, contract, leverage, ** 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']) + all_params = [ + 'settle', + 'contract' + ] + 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_leverage" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " 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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `settle` when calling `update_position_leverage`" - ) # noqa: E501 + 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 # verify the required parameter 'contract' is set - if self.api_client.client_side_validation and ( - 'contract' not in local_var_params or local_var_params['contract'] is None # noqa: E501 - ): # 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 local_var_params['leverage'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `leverage` when calling `update_position_leverage`" - ) # noqa: E501 + 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 collection_formats = {} @@ -1981,12 +2272,6 @@ 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 header_params = {} @@ -1995,14 +2280,14 @@ def update_position_leverage_with_http_info(self, settle, contract, leverage, ** body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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}/positions/{contract}/leverage', - 'POST', + '/futures/{settle}/positions/{contract}', 'GET', path_params, query_params, header_params, @@ -2015,21 +2300,20 @@ def update_position_leverage_with_http_info(self, settle, contract, leverage, ** _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, - ) + 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_position_margin(self, settle, contract, change, **kwargs): # noqa: E501 + """Update position 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_position_risk_limit(settle, contract, risk_limit, 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 str contract: Futures contract (required) - :param str risk_limit: New position risk limit (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. @@ -2042,20 +2326,20 @@ 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_position_margin_with_http_info(settle, contract, change, **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_position_margin_with_http_info(self, settle, contract, change, **kwargs): # noqa: E501 + """Update position 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_position_risk_limit_with_http_info(settle, contract, risk_limit, 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 str contract: Futures contract (required) - :param str risk_limit: New position risk limit (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 @@ -2072,37 +2356,40 @@ def update_position_risk_limit_with_http_info(self, settle, contract, risk_limit local_var_params = locals() - all_params = ['settle', 'contract', 'risk_limit'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'settle', + 'contract', + 'change' + ] + 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_risk_limit" % k + "Got an unexpected keyword argument '%s'" + " 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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `settle` when calling `update_position_risk_limit`" - ) # noqa: E501 + 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 # verify the required parameter 'contract' is set - if self.api_client.client_side_validation and ( - 'contract' not in local_var_params or local_var_params['contract'] is None # noqa: E501 - ): # 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 local_var_params['risk_limit'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `risk_limit` when calling `update_position_risk_limit`" - ) # noqa: E501 + 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 = {} @@ -2113,8 +2400,8 @@ 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 '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 = {} @@ -2123,14 +2410,14 @@ def update_position_risk_limit_with_http_info(self, settle, contract, risk_limit body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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}/positions/{contract}/risk_limit', - 'POST', + '/futures/{settle}/positions/{contract}/margin', 'POST', path_params, query_params, header_params, @@ -2143,21 +2430,22 @@ def update_position_risk_limit_with_http_info(self, settle, contract, risk_limit _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, - ) + collection_formats=collection_formats) - def set_dual_mode(self, settle, dual_mode, **kwargs): # noqa: E501 - """Enable or disable dual mode # noqa: E501 + def update_position_leverage(self, settle, contract, leverage, **kwargs): # noqa: E501 + """Update position leverage # noqa: E501 - Before setting dual mode, make sure all positions are closed and no orders are open # 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_leverage(settle, contract, leverage, 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 dual mode (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 int pid: Product ID :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -2165,25 +2453,27 @@ 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_leverage_with_http_info(settle, contract, leverage, **kwargs) # noqa: E501 - def set_dual_mode_with_http_info(self, settle, dual_mode, **kwargs): # noqa: E501 - """Enable or disable dual mode # noqa: E501 + def update_position_leverage_with_http_info(self, settle, contract, leverage, **kwargs): # noqa: E501 + """Update position leverage # noqa: E501 - Before setting dual mode, make sure all positions are closed and no orders are open # 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_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 bool dual_mode: Whether to enable dual mode (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 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 @@ -2193,41 +2483,65 @@ 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. """ local_var_params = locals() - all_params = ['settle', 'dual_mode'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'settle', + 'contract', + 'leverage', + 'cross_leverage_limit', + 'pid' + ] + 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_dual_mode" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " 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 local_var_params['settle'] is None # noqa: E501 - ): # 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 local_var_params['dual_mode'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError("Missing the required parameter `dual_mode` when calling `set_dual_mode`") # noqa: E501 + 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 + # 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 '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 + 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 = {} @@ -2236,40 +2550,39 @@ def set_dual_mode_with_http_info(self, settle, dual_mode, **kwargs): # noqa: E5 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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_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='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 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - ) + collection_formats=collection_formats) - def get_dual_mode_position(self, settle, contract, **kwargs): # noqa: E501 - """Retrieve position detail in dual mode # noqa: E501 + def update_position_cross_mode(self, settle, futures_position_cross_mode, **kwargs): # noqa: E501 + """Switch Position 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_dual_mode_position(settle, contract, 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 str contract: Futures contract (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. @@ -2277,24 +2590,24 @@ def get_dual_mode_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: 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.get_dual_mode_position_with_http_info(settle, contract, **kwargs) # noqa: E501 + return self.update_position_cross_mode_with_http_info(settle, futures_position_cross_mode, **kwargs) # noqa: E501 - def get_dual_mode_position_with_http_info(self, settle, contract, **kwargs): # noqa: E501 - """Retrieve position detail in dual 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 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_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 str contract: Futures contract (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 @@ -2304,43 +2617,48 @@ def get_dual_mode_position_with_http_info(self, settle, contract, **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.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. """ local_var_params = locals() - all_params = ['settle', 'contract'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'settle', + 'futures_position_cross_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 get_dual_mode_position" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " 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 local_var_params['settle'] is None # noqa: E501 - ): # 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 local_var_params['contract'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `contract` when calling `get_dual_mode_position`" - ) # noqa: E501 + 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 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 = [] @@ -2350,43 +2668,46 @@ def get_dual_mode_position_with_http_info(self, settle, contract, **kwargs): # 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 + 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}/positions/cross_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='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, - ) + collection_formats=collection_formats) - def update_dual_mode_position_margin(self, settle, contract, change, dual_side, **kwargs): # noqa: E501 - """Update position margin in dual mode # noqa: E501 + 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 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_dual_comp_position_cross_mode(settle, inline_object, 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. Use positive number to increase margin, negative number otherwise. (required) - :param str dual_side: Long or short position (required) + :param InlineObject inline_object: (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -2399,25 +2720,19 @@ def update_dual_mode_position_margin(self, settle, contract, change, dual_side, 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_dual_comp_position_cross_mode_with_http_info(settle, inline_object, **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 dual mode # 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 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_dual_comp_position_cross_mode_with_http_info(settle, inline_object, 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. Use positive number to increase margin, negative number otherwise. (required) - :param str dual_side: Long or short position (required) + :param InlineObject inline_object: (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -2434,58 +2749,43 @@ def update_dual_mode_position_margin_with_http_info( local_var_params = locals() - all_params = ['settle', 'contract', 'change', 'dual_side'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'settle', + 'inline_object' + ] + 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 + "Got an unexpected keyword argument '%s'" + " 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 local_var_params['settle'] is None # noqa: E501 - ): # 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 local_var_params['contract'] is None # noqa: E501 - ): # 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 local_var_params['change'] is None # noqa: E501 - ): # 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 local_var_params['dual_side'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `dual_side` when calling `update_dual_mode_position_margin`" - ) # noqa: E501 + 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 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 = {} @@ -2493,15 +2793,21 @@ def update_dual_mode_position_margin_with_http_info( 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 + 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}/margin', - 'POST', + '/futures/{settle}/dual_comp/positions/cross_mode', 'POST', path_params, query_params, header_params, @@ -2514,21 +2820,20 @@ def update_dual_mode_position_margin_with_http_info( _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, - ) + collection_formats=collection_formats) - def update_dual_mode_position_leverage(self, settle, contract, leverage, **kwargs): # noqa: E501 - """Update position leverage in dual mode # noqa: E501 + def update_position_risk_limit(self, settle, contract, risk_limit, **kwargs): # noqa: E501 + """Update position risk 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_leverage(settle, contract, leverage, 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 leverage: New position leverage (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. @@ -2536,27 +2841,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.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 + return self.update_position_risk_limit_with_http_info(settle, contract, risk_limit, **kwargs) # noqa: E501 - def update_dual_mode_position_leverage_with_http_info(self, settle, contract, leverage, **kwargs): # noqa: E501 - """Update position leverage in dual 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 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.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 leverage: New position leverage (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 @@ -2566,44 +2869,47 @@ 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.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'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + 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_leverage" % k + "Got an unexpected keyword argument '%s'" + " 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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `settle` when calling `update_dual_mode_position_leverage`" - ) # noqa: E501 + 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 # verify the required parameter 'contract' is set - if self.api_client.client_side_validation and ( - 'contract' not in local_var_params or local_var_params['contract'] is None # noqa: E501 - ): # 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 local_var_params['leverage'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `leverage` when calling `update_dual_mode_position_leverage`" - ) # noqa: E501 + 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 collection_formats = {} @@ -2614,8 +2920,8 @@ def update_dual_mode_position_leverage_with_http_info(self, settle, contract, le 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 '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 = {} @@ -2624,41 +2930,40 @@ def update_dual_mode_position_leverage_with_http_info(self, settle, contract, le body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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', + '/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 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - ) + collection_formats=collection_formats) - def update_dual_mode_position_risk_limit(self, settle, contract, risk_limit, **kwargs): # noqa: E501 - """Update position risk limit in dual 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_risk_limit(settle, contract, risk_limit, 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 risk_limit: New position risk limit (required) + :param bool dual_mode: Whether to enable dual mode (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -2666,27 +2971,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_dual_mode_with_http_info(settle, dual_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 dual 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_risk_limit_with_http_info(settle, contract, risk_limit, 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 risk_limit: New position risk limit (required) + :param bool dual_mode: Whether to enable dual 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 @@ -2696,44 +2999,163 @@ 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. + """ + + local_var_params = locals() + + all_params = [ + 'settle', + 'dual_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 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 `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 + + 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 = {} + + 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_mode', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + 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 + _preload_content=local_var_params.get('_preload_content', True), + _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 dual 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) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str settle: Settle currency (required) + :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. + :param _request_timeout: timeout setting for 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.get_dual_mode_position_with_http_info(settle, contract, **kwargs) # noqa: E501 + + def get_dual_mode_position_with_http_info(self, settle, contract, **kwargs): # noqa: E501 + """Get position information in dual 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) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str settle: Settle currency (required) + :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 + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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']) + all_params = [ + 'settle', + 'contract' + ] + 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 + "Got an unexpected keyword argument '%s'" + " 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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `settle` when calling `update_dual_mode_position_risk_limit`" - ) # noqa: E501 + 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 local_var_params['contract'] is None # noqa: E501 - ): # 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 local_var_params['risk_limit'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `risk_limit` when calling `update_dual_mode_position_risk_limit`" - ) # noqa: E501 + 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 = {} @@ -2744,8 +3166,6 @@ def update_dual_mode_position_risk_limit_with_http_info(self, settle, contract, 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 = {} @@ -2754,46 +3174,1829 @@ def update_dual_mode_position_risk_limit_with_http_info(self, settle, contract, body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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 dual 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 dual 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 dual 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 dual 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 dual 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_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 dual 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_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 + 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, contract, **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, 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 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 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, contract, **kwargs) # noqa: E501 + + def cancel_futures_orders_with_http_info(self, settle, contract, **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, 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 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 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', + 'contract', + 'x_gate_exptime', + '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 + # 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 `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 '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.FuturesOrder] + :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.FuturesOrder], 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[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_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: 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 _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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: 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 _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: 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 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: 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 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: 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 _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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: 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 _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' + ] + 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 = [] + + 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 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) + >>> 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 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) + >>> 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}/dual_comp/positions/{contract}/risk_limit', - 'POST', + '/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[Position]', # noqa: E501 + 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, - ) + collection_formats=collection_formats) - def list_futures_orders(self, settle, contract, status, **kwargs): # noqa: E501 - """List futures orders # noqa: E501 + def list_position_close(self, settle, **kwargs): # noqa: E501 + """Query position close history # noqa: E501 - Zero-fill order cannot be retrieved for 60 seconds after 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.list_futures_orders(settle, contract, status, 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 (required) - :param str status: Only list the orders with this status (required) - :param int limit: Maximum number of records to be returned in a single list + :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: Specify list staring point using the `id` of last record in previous list-query results - :param int count_total: Whether to return total number matched. Default to 0(no return) + :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. @@ -2801,30 +5004,30 @@ def list_futures_orders(self, settle, contract, 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.PositionClose] :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, contract, status, **kwargs) # noqa: E501 + return self.list_position_close_with_http_info(settle, **kwargs) # noqa: E501 - def list_futures_orders_with_http_info(self, settle, contract, status, **kwargs): # noqa: E501 - """List futures orders # noqa: E501 + def list_position_close_with_http_info(self, settle, **kwargs): # noqa: E501 + """Query position close history # noqa: E501 - Zero-fill order cannot be retrieved for 60 seconds after 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.list_futures_orders_with_http_info(settle, contract, status, 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 (required) - :param str status: Only list the orders with this status (required) - :param int limit: Maximum number of records to be returned in a single list + :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: Specify list staring point using the `id` of last record in previous list-query results - :param int count_total: Whether to return total number matched. Default to 0(no return) + :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 @@ -2834,61 +5037,51 @@ def list_futures_orders_with_http_info(self, settle, contract, status, **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.FuturesOrder], status_code(int), headers(HTTPHeaderDict)) + :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', 'status', 'limit', 'offset', 'last_id', 'count_total'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + 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_futures_orders" % k) + 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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `settle` when calling `list_futures_orders`" - ) # noqa: E501 - # verify the required parameter 'contract' is set - if self.api_client.client_side_validation and ( - 'contract' not in local_var_params or local_var_params['contract'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `contract` 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 local_var_params['status'] is None # noqa: E501 - ): # 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 + 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 = {} @@ -2898,16 +5091,18 @@ def list_futures_orders_with_http_info(self, settle, contract, status, **kwargs) 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 'count_total' in local_var_params and local_var_params['count_total'] is not None: # noqa: E501 - query_params.append(('count_total', local_var_params['count_total'])) # 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 = {} @@ -2916,41 +5111,44 @@ def list_futures_orders_with_http_info(self, settle, contract, status, **kwargs) body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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', + '/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[FuturesOrder]', # noqa: E501 + 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, - ) + collection_formats=collection_formats) - def create_futures_order(self, settle, futures_order, **kwargs): # noqa: E501 - """Create a futures order # noqa: E501 + def list_liquidates(self, settle, **kwargs): # noqa: E501 + """Query liquidation history # noqa: E501 - Zero-fill order cannot be retrieved for 60 seconds after 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.create_futures_order(settle, futures_order, 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 FuturesOrder futures_order: (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. @@ -2958,25 +5156,29 @@ 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: list[gate_api.FuturesLiquidate] :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.list_liquidates_with_http_info(settle, **kwargs) # noqa: E501 - def create_futures_order_with_http_info(self, settle, futures_order, **kwargs): # noqa: E501 - """Create a futures order # noqa: E501 + def list_liquidates_with_http_info(self, settle, **kwargs): # noqa: E501 + """Query liquidation history # noqa: E501 - Zero-fill order cannot be retrieved for 60 seconds after 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.create_futures_order_with_http_info(settle, futures_order, 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 FuturesOrder futures_order: (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 @@ -2986,36 +5188,50 @@ 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(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', 'futures_order'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + 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 create_futures_order" % k) + 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 local_var_params['settle'] is None # noqa: E501 - ): # 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 local_var_params['futures_order'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `futures_order` when calling `create_futures_order`" - ) # noqa: E501 + 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 = {} @@ -3023,6 +5239,18 @@ def create_futures_order_with_http_info(self, settle, futures_order, **kwargs): 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 = {} @@ -3030,50 +5258,45 @@ def create_futures_order_with_http_info(self, settle, futures_order, **kwargs): 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 + 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', - 'POST', + '/futures/{settle}/liquidates', '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[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, - ) + collection_formats=collection_formats) - def cancel_futures_orders(self, settle, contract, **kwargs): # noqa: E501 - """Cancel all `open` orders matched # noqa: E501 + def list_auto_deleverages(self, settle, **kwargs): # noqa: E501 + """Query ADL auto-deleveraging order information # noqa: E501 - Zero-fill order cannot be retrieved for 60 seconds after 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, contract, 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 (required) - :param str side: All bids or asks. Both included if not specified + :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. @@ -3081,26 +5304,29 @@ def cancel_futures_orders(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: list[gate_api.FuturesOrder] + :rtype: list[gate_api.FuturesAutoDeleverage] :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, contract, **kwargs) # noqa: E501 + return self.list_auto_deleverages_with_http_info(settle, **kwargs) # noqa: E501 - def cancel_futures_orders_with_http_info(self, settle, contract, **kwargs): # noqa: E501 - """Cancel all `open` orders matched # noqa: E501 + def list_auto_deleverages_with_http_info(self, settle, **kwargs): # noqa: E501 + """Query ADL auto-deleveraging order information # noqa: E501 - Zero-fill order cannot be retrieved for 60 seconds after 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, contract, 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 (required) - :param str side: All bids or asks. Both included if not specified + :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 @@ -3110,36 +5336,50 @@ def cancel_futures_orders_with_http_info(self, settle, contract, **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.FuturesOrder], status_code(int), headers(HTTPHeaderDict)) + :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', 'side'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + 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 cancel_futures_orders" % k) + 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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `settle` when calling `cancel_futures_orders`" - ) # noqa: E501 - # verify the required parameter 'contract' is set - if self.api_client.client_side_validation and ( - 'contract' not in local_var_params or local_var_params['contract'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `contract` when calling `cancel_futures_orders`" - ) # noqa: E501 - + 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 = {} @@ -3149,8 +5389,16 @@ def cancel_futures_orders_with_http_info(self, settle, contract, **kwargs): # n 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 '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 = {} @@ -3159,41 +5407,40 @@ def cancel_futures_orders_with_http_info(self, settle, contract, **kwargs): # n body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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', + '/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 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - ) + collection_formats=collection_formats) - def get_futures_order(self, settle, order_id, **kwargs): # noqa: E501 - """Get a single order # noqa: E501 + def countdown_cancel_all_futures(self, settle, countdown_cancel_all_futures_task, **kwargs): # noqa: E501 + """Countdown cancel orders # noqa: E501 - Zero-fill order cannot be retrieved for 60 seconds after cancellation # 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.get_futures_order(settle, order_id, 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 str order_id: Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) + :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. @@ -3201,25 +5448,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: gate_api.TriggerTime :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.countdown_cancel_all_futures_with_http_info(settle, countdown_cancel_all_futures_task, **kwargs) # noqa: E501 - def get_futures_order_with_http_info(self, settle, order_id, **kwargs): # noqa: E501 - """Get a single 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 - Zero-fill order cannot be retrieved for 60 seconds after cancellation # 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.get_futures_order_with_http_info(settle, order_id, 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 str order_id: Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) + :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 @@ -3229,43 +5476,48 @@ 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(gate_api.TriggerTime, 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']) + all_params = [ + 'settle', + 'countdown_cancel_all_futures_task' + ] + 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) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " 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 local_var_params['settle'] is None # noqa: E501 - ): # 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 local_var_params['order_id'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `order_id` when calling `get_futures_order`" - ) # noqa: E501 + 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 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 = [] @@ -3275,41 +5527,46 @@ def get_futures_order_with_http_info(self, settle, order_id, **kwargs): # noqa: 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 + 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}', - 'GET', + '/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 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - ) + collection_formats=collection_formats) - def cancel_futures_order(self, settle, order_id, **kwargs): # noqa: E501 - """Cancel a single order # noqa: E501 + def get_futures_fee(self, settle, **kwargs): # noqa: E501 + """Query futures market trading fee 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.cancel_futures_order(settle, order_id, 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 order_id: Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) + :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. @@ -3317,24 +5574,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: 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_order_with_http_info(settle, order_id, **kwargs) # noqa: E501 + return self.get_futures_fee_with_http_info(settle, **kwargs) # noqa: E501 - def cancel_futures_order_with_http_info(self, settle, order_id, **kwargs): # noqa: E501 - """Cancel a single order # noqa: E501 + def get_futures_fee_with_http_info(self, settle, **kwargs): # noqa: E501 + """Query futures market trading fee 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.cancel_futures_order_with_http_info(settle, order_id, 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 order_id: Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) + :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 @@ -3344,45 +5601,48 @@ 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(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', 'order_id'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'settle', + 'contract' + ] + 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) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " 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 local_var_params['settle'] is None # noqa: E501 - ): # 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 local_var_params['order_id'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `order_id` when calling `cancel_futures_order`" - ) # noqa: E501 + 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 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 '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 = {} @@ -3391,45 +5651,41 @@ def cancel_futures_order_with_http_info(self, settle, order_id, **kwargs): # no body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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', + '/futures/{settle}/fee', '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='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 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - ) + collection_formats=collection_formats) - def get_my_trades(self, settle, **kwargs): # noqa: E501 - """List personal trading history # 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, maximum 20 records per 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_my_trades(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 order: Futures order ID, return related data only if specified - :param int limit: Maximum number of records to be returned in a single list - :param int offset: List offset, starting from 0 - :param str last_id: Specify list staring point using the `id` of last record in previous list-query results - :param int count_total: Whether to return total number matched. Default to 0(no return) + :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. @@ -3437,29 +5693,26 @@ 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: list[gate_api.FutureCancelOrderResult] :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.cancel_batch_future_orders_with_http_info(settle, request_body, **kwargs) # noqa: E501 - def get_my_trades_with_http_info(self, settle, **kwargs): # noqa: E501 - """List personal trading history # 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, maximum 20 records per 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_my_trades_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 order: Futures order ID, return related data only if specified - :param int limit: Maximum number of records to be returned in a single list - :param int offset: List offset, starting from 0 - :param str last_id: Specify list staring point using the `id` of last record in previous list-query results - :param int count_total: Whether to return total number matched. Default to 0(no return) + :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 @@ -3469,45 +5722,44 @@ 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(list[gate_api.FutureCancelOrderResult], 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', 'count_total'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'settle', + 'request_body', + '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 get_my_trades" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " 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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError("Missing the required parameter `settle` when calling `get_my_trades`") # noqa: E501 + 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 - 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 = {} @@ -3515,64 +5767,57 @@ 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 - if 'count_total' in local_var_params and local_var_params['count_total'] is not None: # noqa: E501 - query_params.append(('count_total', local_var_params['count_total'])) # 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 + 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}/batch_cancel_orders', '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='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 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - ) + collection_formats=collection_formats) - def list_position_close(self, settle, **kwargs): # noqa: E501 - """List position close history # noqa: E501 + def amend_batch_future_orders(self, settle, batch_amend_order_req, **kwargs): # noqa: E501 + """Batch modify orders by specified IDs # noqa: E501 + Multiple different order IDs can be specified, maximum 10 orders per 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.list_position_close(settle, 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 str contract: Futures contract, return related data only if specified - :param int limit: Maximum number of records to be returned in a single list - :param int offset: List offset, starting from 0 - :param int _from: Start timestamp - :param int to: End timestamp + :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 data. Default is True. @@ -3580,28 +5825,26 @@ 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: list[gate_api.BatchFuturesOrder] :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.amend_batch_future_orders_with_http_info(settle, batch_amend_order_req, **kwargs) # noqa: E501 - def list_position_close_with_http_info(self, settle, **kwargs): # noqa: E501 - """List position close history # 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 + Multiple different order IDs can be specified, maximum 10 orders per 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.list_position_close_with_http_info(settle, 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 str contract: Futures contract, return related data only if specified - :param int limit: Maximum number of records to be returned in a single list - :param int offset: List offset, starting from 0 - :param int _from: Start timestamp - :param int to: End timestamp + :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 :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -3611,47 +5854,44 @@ 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(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', 'contract', 'limit', 'offset', '_from', 'to'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'settle', + 'batch_amend_order_req', + '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 list_position_close" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " 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 local_var_params['settle'] is None # noqa: E501 - ): # 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 + 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 + collection_formats = {} path_params = {} @@ -3659,60 +5899,56 @@ def list_position_close_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 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'] # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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}/position_close', - 'GET', + '/futures/{settle}/batch_amend_orders', 'POST', 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='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, - ) + collection_formats=collection_formats) - def list_liquidates(self, settle, **kwargs): # noqa: E501 - """List liquidation history # noqa: E501 + def get_futures_risk_limit_table(self, settle, table_id, **kwargs): # noqa: E501 + """Query risk limit table by table_id # 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.list_liquidates(settle, 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 contract: Futures contract, return related data only if specified - :param int limit: Maximum number of records to be returned in a single list - :param int at: Specify a liquidation timestamp + :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. @@ -3720,26 +5956,25 @@ 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: list[gate_api.FuturesRiskLimitTier] :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_futures_risk_limit_table_with_http_info(settle, table_id, **kwargs) # noqa: E501 - def list_liquidates_with_http_info(self, settle, **kwargs): # noqa: E501 - """List liquidation history # 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 + 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.list_liquidates_with_http_info(settle, 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 contract: Futures contract, return related data only if specified - :param int limit: Maximum number of records to be returned in a single list - :param int at: Specify a liquidation timestamp + :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 @@ -3749,39 +5984,43 @@ 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(list[gate_api.FuturesRiskLimitTier], 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', 'at'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'settle', + 'table_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_liquidates" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " 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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError("Missing the required parameter `settle` when calling `list_liquidates`") # noqa: E501 + 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 - 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 collection_formats = {} path_params = {} @@ -3789,12 +6028,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 '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 '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 = {} @@ -3803,31 +6038,30 @@ def list_liquidates_with_http_info(self, settle, **kwargs): # noqa: E501 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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( - '/futures/{settle}/liquidates', - '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='list[FuturesLiquidate]', # 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 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - ) + collection_formats=collection_formats) def list_price_triggered_orders(self, settle, status, **kwargs): # noqa: E501 - """List all auto orders # noqa: E501 + """Query auto order list # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -3836,9 +6070,9 @@ def list_price_triggered_orders(self, settle, status, **kwargs): # noqa: E501 :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param str status: Only list the orders with this status (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 to be returned in a single list + :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 @@ -3855,7 +6089,7 @@ def list_price_triggered_orders(self, settle, status, **kwargs): # noqa: E501 return self.list_price_triggered_orders_with_http_info(settle, status, **kwargs) # noqa: E501 def list_price_triggered_orders_with_http_info(self, settle, status, **kwargs): # noqa: E501 - """List all auto orders # noqa: E501 + """Query auto order list # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -3864,9 +6098,9 @@ def list_price_triggered_orders_with_http_info(self, settle, status, **kwargs): :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param str status: Only list the orders with this status (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 to be returned in a single list + :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 @@ -3884,49 +6118,45 @@ def list_price_triggered_orders_with_http_info(self, settle, status, **kwargs): local_var_params = locals() - all_params = ['settle', 'status', 'contract', 'limit', 'offset'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'settle', + 'status', + 'contract', + '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_price_triggered_orders" % k + "Got an unexpected keyword argument '%s'" + " to method list_price_triggered_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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `settle` when calling `list_price_triggered_orders`" - ) # noqa: E501 + 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_price_triggered_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 local_var_params['status'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `status` when calling `list_price_triggered_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_price_triggered_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_price_triggered_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_price_triggered_orders`, must be a value greater than or equal to `0`" - ) # noqa: E501 + 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_price_triggered_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_price_triggered_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_price_triggered_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_price_triggered_orders`, must be a value greater than or equal to `0`") # noqa: E501 collection_formats = {} path_params = {} @@ -3950,14 +6180,14 @@ def list_price_triggered_orders_with_http_info(self, settle, status, **kwargs): body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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}/price_orders', - 'GET', + '/futures/{settle}/price_orders', 'GET', path_params, query_params, header_params, @@ -3970,11 +6200,10 @@ def list_price_triggered_orders_with_http_info(self, settle, status, **kwargs): _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, - ) + collection_formats=collection_formats) def create_price_triggered_order(self, settle, futures_price_triggered_order, **kwargs): # noqa: E501 - """Create a price-triggered order # noqa: E501 + """Create price-triggered order # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -3996,14 +6225,10 @@ def create_price_triggered_order(self, settle, futures_price_triggered_order, ** returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.create_price_triggered_order_with_http_info( - settle, futures_price_triggered_order, **kwargs - ) # noqa: E501 + return self.create_price_triggered_order_with_http_info(settle, futures_price_triggered_order, **kwargs) # noqa: E501 - def create_price_triggered_order_with_http_info( - self, settle, futures_price_triggered_order, **kwargs - ): # noqa: E501 - """Create a price-triggered order # noqa: E501 + def create_price_triggered_order_with_http_info(self, settle, futures_price_triggered_order, **kwargs): # noqa: E501 + """Create price-triggered order # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -4029,31 +6254,35 @@ def create_price_triggered_order_with_http_info( local_var_params = locals() - all_params = ['settle', 'futures_price_triggered_order'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'settle', + 'futures_price_triggered_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_price_triggered_order" % k + "Got an unexpected keyword argument '%s'" + " to method create_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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `settle` when calling `create_price_triggered_order`" - ) # noqa: E501 + 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_price_triggered_order`") # noqa: E501 # verify the required parameter 'futures_price_triggered_order' is set - if self.api_client.client_side_validation and ( - 'futures_price_triggered_order' not in local_var_params - or local_var_params['futures_price_triggered_order'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `futures_price_triggered_order` when calling `create_price_triggered_order`" - ) # noqa: E501 + if self.api_client.client_side_validation and ('futures_price_triggered_order' not in local_var_params or # noqa: E501 + local_var_params['futures_price_triggered_order'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `futures_price_triggered_order` when calling `create_price_triggered_order`") # noqa: E501 collection_formats = {} @@ -4072,19 +6301,18 @@ def create_price_triggered_order_with_http_info( if 'futures_price_triggered_order' in local_var_params: body_params = local_var_params['futures_price_triggered_order'] # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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 + ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( - '/futures/{settle}/price_orders', - 'POST', + '/futures/{settle}/price_orders', 'POST', path_params, query_params, header_params, @@ -4097,20 +6325,19 @@ def create_price_triggered_order_with_http_info( _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, - ) + collection_formats=collection_formats) - def cancel_price_triggered_order_list(self, settle, contract, **kwargs): # noqa: E501 - """Cancel all open orders # noqa: E501 + def cancel_price_triggered_order_list(self, settle, **kwargs): # noqa: E501 + """Cancel all auto 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_price_triggered_order_list(settle, contract, async_req=True) + >>> thread = api.cancel_price_triggered_order_list(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 (required) + :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. @@ -4123,19 +6350,19 @@ def cancel_price_triggered_order_list(self, settle, contract, **kwargs): # noqa returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.cancel_price_triggered_order_list_with_http_info(settle, contract, **kwargs) # noqa: E501 + return self.cancel_price_triggered_order_list_with_http_info(settle, **kwargs) # noqa: E501 - def cancel_price_triggered_order_list_with_http_info(self, settle, contract, **kwargs): # noqa: E501 - """Cancel all open orders # noqa: E501 + def cancel_price_triggered_order_list_with_http_info(self, settle, **kwargs): # noqa: E501 + """Cancel all auto 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_price_triggered_order_list_with_http_info(settle, contract, async_req=True) + >>> thread = api.cancel_price_triggered_order_list_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 (required) + :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 @@ -4152,30 +6379,31 @@ def cancel_price_triggered_order_list_with_http_info(self, settle, contract, **k local_var_params = locals() - all_params = ['settle', 'contract'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'settle', + 'contract' + ] + 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_price_triggered_order_list" % k + "Got an unexpected keyword argument '%s'" + " to method cancel_price_triggered_order_list" % 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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `settle` when calling `cancel_price_triggered_order_list`" - ) # noqa: E501 - # verify the required parameter 'contract' is set - if self.api_client.client_side_validation and ( - 'contract' not in local_var_params or local_var_params['contract'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `contract` when calling `cancel_price_triggered_order_list`" - ) # noqa: E501 + 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_list`") # noqa: E501 collection_formats = {} @@ -4194,14 +6422,14 @@ def cancel_price_triggered_order_list_with_http_info(self, settle, contract, **k body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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}/price_orders', - 'DELETE', + '/futures/{settle}/price_orders', 'DELETE', path_params, query_params, header_params, @@ -4214,11 +6442,10 @@ def cancel_price_triggered_order_list_with_http_info(self, settle, contract, **k _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, - ) + collection_formats=collection_formats) def get_price_triggered_order(self, settle, order_id, **kwargs): # noqa: E501 - """Get a single order # noqa: E501 + """Query single auto order details # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -4227,7 +6454,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: Retrieve the data of the order with the specified ID (required) + :param str 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. @@ -4243,7 +6470,7 @@ def get_price_triggered_order(self, settle, order_id, **kwargs): # noqa: E501 return self.get_price_triggered_order_with_http_info(settle, order_id, **kwargs) # noqa: E501 def get_price_triggered_order_with_http_info(self, settle, order_id, **kwargs): # noqa: E501 - """Get a single order # noqa: E501 + """Query single auto order details # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -4252,7 +6479,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: Retrieve the data of the order with the specified ID (required) + :param str 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 @@ -4269,28 +6496,35 @@ def get_price_triggered_order_with_http_info(self, settle, order_id, **kwargs): local_var_params = locals() - all_params = ['settle', 'order_id'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + 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_price_triggered_order" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `settle` when calling `get_price_triggered_order`" - ) # noqa: E501 + 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_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 local_var_params['order_id'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `order_id` when calling `get_price_triggered_order`" - ) # noqa: E501 + 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_price_triggered_order`") # noqa: E501 collection_formats = {} @@ -4309,14 +6543,14 @@ def get_price_triggered_order_with_http_info(self, settle, order_id, **kwargs): body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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}/price_orders/{order_id}', - 'GET', + '/futures/{settle}/price_orders/{order_id}', 'GET', path_params, query_params, header_params, @@ -4329,11 +6563,10 @@ def get_price_triggered_order_with_http_info(self, settle, order_id, **kwargs): _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, - ) + collection_formats=collection_formats) def cancel_price_triggered_order(self, settle, order_id, **kwargs): # noqa: E501 - """Cancel a single order # 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 @@ -4342,7 +6575,7 @@ def cancel_price_triggered_order(self, settle, order_id, **kwargs): # noqa: E50 :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param str order_id: Retrieve the data of the order with the specified ID (required) + :param str 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. @@ -4358,7 +6591,7 @@ def cancel_price_triggered_order(self, settle, order_id, **kwargs): # noqa: E50 return self.cancel_price_triggered_order_with_http_info(settle, order_id, **kwargs) # noqa: E501 def cancel_price_triggered_order_with_http_info(self, settle, order_id, **kwargs): # noqa: E501 - """Cancel a single order # 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 @@ -4367,7 +6600,7 @@ def cancel_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: Retrieve the data of the order with the specified ID (required) + :param str 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 @@ -4384,30 +6617,35 @@ def cancel_price_triggered_order_with_http_info(self, settle, order_id, **kwargs local_var_params = locals() - all_params = ['settle', 'order_id'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + 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 cancel_price_triggered_order" % k + "Got an unexpected keyword argument '%s'" + " 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 local_var_params['settle'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `settle` when calling `cancel_price_triggered_order`" - ) # noqa: E501 + 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 local_var_params['order_id'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `order_id` when calling `cancel_price_triggered_order`" - ) # noqa: E501 + 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 collection_formats = {} @@ -4426,14 +6664,14 @@ def cancel_price_triggered_order_with_http_info(self, settle, order_id, **kwargs body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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}/price_orders/{order_id}', - 'DELETE', + '/futures/{settle}/price_orders/{order_id}', 'DELETE', path_params, query_params, header_params, @@ -4446,5 +6684,4 @@ def cancel_price_triggered_order_with_http_info(self, settle, order_id, **kwargs _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, - ) + collection_formats=collection_formats) diff --git a/gate_api/api/margin_api.py b/gate_api/api/margin_api.py index 5cc7507..9464f10 100644 --- a/gate_api/api/margin_api.py +++ b/gate_api/api/margin_api.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -18,7 +18,10 @@ import six from gate_api.api_client import ApiClient -from gate_api.exceptions import ApiTypeError, ApiValueError # noqa: F401 +from gate_api.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) class MarginApi(object): @@ -33,309 +36,6 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def list_margin_currency_pairs(self, **kwargs): # noqa: E501 - """List all supported currency pairs supported in margin trading # 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_margin_currency_pairs(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.MarginCurrencyPair] - :return: If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - return self.list_margin_currency_pairs_with_http_info(**kwargs) # noqa: E501 - - def list_margin_currency_pairs_with_http_info(self, **kwargs): # noqa: E501 - """List all supported currency pairs supported in margin trading # 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_margin_currency_pairs_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.MarginCurrencyPair], 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_margin_currency_pairs" % 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( - '/margin/currency_pairs', - 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[MarginCurrencyPair]', # 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_margin_currency_pair(self, currency_pair, **kwargs): # noqa: E501 - """Query one single margin currency pair # 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_margin_currency_pair(currency_pair, async_req=True) - >>> result = thread.get() - - :param bool async_req: execute request asynchronously - :param str currency_pair: Margin currency 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.MarginCurrencyPair - :return: If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - return self.get_margin_currency_pair_with_http_info(currency_pair, **kwargs) # noqa: E501 - - def get_margin_currency_pair_with_http_info(self, currency_pair, **kwargs): # noqa: E501 - """Query one single margin currency pair # 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_margin_currency_pair_with_http_info(currency_pair, async_req=True) - >>> result = thread.get() - - :param bool async_req: execute request asynchronously - :param str currency_pair: Margin currency 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.MarginCurrencyPair, 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 get_margin_currency_pair" % k) - local_var_params[k] = v - del local_var_params['kwargs'] - # verify the required parameter 'currency_pair' is set - if self.api_client.client_side_validation and ( - 'currency_pair' not in local_var_params or local_var_params['currency_pair'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `currency_pair` when calling `get_margin_currency_pair`" - ) # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'currency_pair' in local_var_params: - path_params['currency_pair'] = local_var_params['currency_pair'] # 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( - '/margin/currency_pairs/{currency_pair}', - 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='MarginCurrencyPair', # 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_funding_book(self, currency, **kwargs): # noqa: E501 - """Order book of lending loans # 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_funding_book(currency, async_req=True) - >>> result = thread.get() - - :param bool async_req: execute request asynchronously - :param str currency: Retrieve data of the specified currency (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.FundingBookItem] - :return: If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - return self.list_funding_book_with_http_info(currency, **kwargs) # noqa: E501 - - def list_funding_book_with_http_info(self, currency, **kwargs): # noqa: E501 - """Order book of lending loans # 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_funding_book_with_http_info(currency, async_req=True) - >>> result = thread.get() - - :param bool async_req: execute request asynchronously - :param str currency: Retrieve data of the specified currency (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.FundingBookItem], 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_funding_book" % k) - 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 local_var_params['currency'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `currency` when calling `list_funding_book`" - ) # 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 - - 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( - '/margin/funding_book', - 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[FundingBookItem]', # 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_margin_accounts(self, **kwargs): # noqa: E501 """Margin account list # noqa: E501 @@ -361,1954 +61,14 @@ def list_margin_accounts(self, **kwargs): # noqa: E501 return self.list_margin_accounts_with_http_info(**kwargs) # noqa: E501 def list_margin_accounts_with_http_info(self, **kwargs): # noqa: E501 - """Margin account 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_margin_accounts_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.MarginAccount], 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 list_margin_accounts" % 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( - '/margin/accounts', - 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[MarginAccount]', # 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_margin_account_book(self, **kwargs): # noqa: E501 - """List margin account balance change history # noqa: E501 - - Only transferals from and to margin account are provided for now. Time range allows 30 days at most # 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_margin_account_book(async_req=True) - >>> result = thread.get() - - :param bool async_req: execute request asynchronously - :param str currency: List records related to specified currency only. If specified, `currency_pair` is also required. - :param str currency_pair: List records related to specified currency pair. Used in combination with `currency`. Ignored if `currency` is not provided - :param int _from: Start timestamp of the query - :param int to: Time range ending, default to current time - :param int page: Page number - :param int limit: Maximum number of records to be 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.MarginAccountBook] - :return: If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - return self.list_margin_account_book_with_http_info(**kwargs) # noqa: E501 - - def list_margin_account_book_with_http_info(self, **kwargs): # noqa: E501 - """List margin account balance change history # noqa: E501 - - Only transferals from and to margin account are provided for now. Time range allows 30 days at most # 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_margin_account_book_with_http_info(async_req=True) - >>> result = thread.get() - - :param bool async_req: execute request asynchronously - :param str currency: List records related to specified currency only. If specified, `currency_pair` is also required. - :param str currency_pair: List records related to specified currency pair. Used in combination with `currency`. Ignored if `currency` is not provided - :param int _from: Start timestamp of the query - :param int to: Time range ending, default to current time - :param int page: Page number - :param int limit: Maximum number of records to be 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.MarginAccountBook], status_code(int), headers(HTTPHeaderDict)) - :return: If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = ['currency', 'currency_pair', '_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_margin_account_book" % 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_margin_account_book`, 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'] > 500 - ): # noqa: E501 - raise ApiValueError( - "Invalid value for parameter `limit` when calling `list_margin_account_book`, 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 `list_margin_account_book`, 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 '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 '_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( - '/margin/account_book', - 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[MarginAccountBook]', # 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_funding_accounts(self, **kwargs): # noqa: E501 - """Funding account 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_funding_accounts(async_req=True) - >>> result = thread.get() - - :param bool async_req: execute request asynchronously - :param str currency: Retrieve data of the specified currency - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for 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.FundingAccount] - :return: If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - return self.list_funding_accounts_with_http_info(**kwargs) # noqa: E501 - - def list_funding_accounts_with_http_info(self, **kwargs): # noqa: E501 - """Funding account 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_funding_accounts_with_http_info(async_req=True) - >>> result = thread.get() - - :param bool async_req: execute request asynchronously - :param str currency: Retrieve data of the specified currency - :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.FundingAccount], 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_funding_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( - '/margin/funding_accounts', - 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[FundingAccount]', # 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_loans(self, status, side, **kwargs): # noqa: E501 - """List all loans # 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_loans(status, side, async_req=True) - >>> result = thread.get() - - :param bool async_req: execute request asynchronously - :param str status: Loan status (required) - :param str side: Lend or borrow (required) - :param str currency: Retrieve data of the specified currency - :param str currency_pair: Currency pair - :param str sort_by: Specify which field is used to sort. `create_time` or `rate` is supported. Default to `create_time` - :param bool reverse_sort: Whether to sort in descending order. Default to `true` - :param int page: Page number - :param int limit: Maximum number of records to be 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.Loan] - :return: If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - return self.list_loans_with_http_info(status, side, **kwargs) # noqa: E501 - - def list_loans_with_http_info(self, status, side, **kwargs): # noqa: E501 - """List all loans # 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_loans_with_http_info(status, side, async_req=True) - >>> result = thread.get() - - :param bool async_req: execute request asynchronously - :param str status: Loan status (required) - :param str side: Lend or borrow (required) - :param str currency: Retrieve data of the specified currency - :param str currency_pair: Currency pair - :param str sort_by: Specify which field is used to sort. `create_time` or `rate` is supported. Default to `create_time` - :param bool reverse_sort: Whether to sort in descending order. Default to `true` - :param int page: Page number - :param int limit: Maximum number of records to be 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.Loan], status_code(int), headers(HTTPHeaderDict)) - :return: If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = ['status', 'side', 'currency', 'currency_pair', 'sort_by', 'reverse_sort', '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_loans" % 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 local_var_params['status'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError("Missing the required parameter `status` when calling `list_loans`") # noqa: E501 - # verify the required parameter 'side' is set - if self.api_client.client_side_validation and ( - 'side' not in local_var_params or local_var_params['side'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError("Missing the required parameter `side` when calling `list_loans`") # 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_loans`, 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_loans`, 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_loans`, must be a value greater than or equal to `1`" - ) # 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 '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 '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 '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 '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 'reverse_sort' in local_var_params and local_var_params['reverse_sort'] is not None: # noqa: E501 - query_params.append(('reverse_sort', local_var_params['reverse_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 '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( - '/margin/loans', - 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[Loan]', # 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_loan(self, loan, **kwargs): # noqa: E501 - """Lend or borrow # 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_loan(loan, async_req=True) - >>> result = thread.get() - - :param bool async_req: execute request asynchronously - :param Loan loan: (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.Loan - :return: If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - return self.create_loan_with_http_info(loan, **kwargs) # noqa: E501 - - def create_loan_with_http_info(self, loan, **kwargs): # noqa: E501 - """Lend or borrow # 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_loan_with_http_info(loan, async_req=True) - >>> result = thread.get() - - :param bool async_req: execute request asynchronously - :param Loan loan: (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.Loan, status_code(int), headers(HTTPHeaderDict)) - :return: If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = ['loan'] - 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_loan" % k) - local_var_params[k] = v - del local_var_params['kwargs'] - # verify the required parameter 'loan' is set - if self.api_client.client_side_validation and ( - 'loan' not in local_var_params or local_var_params['loan'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError("Missing the required parameter `loan` when calling `create_loan`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'loan' in local_var_params: - body_params = local_var_params['loan'] - # 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( - '/margin/loans', - 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Loan', # 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 merge_loans(self, currency, ids, **kwargs): # noqa: E501 - """Merge multiple lending loans # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.merge_loans(currency, ids, async_req=True) - >>> result = thread.get() - - :param bool async_req: execute request asynchronously - :param str currency: Retrieve data of the specified currency (required) - :param str ids: A comma-separated (,) list of IDs of the loans lent. Maximum of 20 IDs are allowed in a 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.Loan - :return: If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - return self.merge_loans_with_http_info(currency, ids, **kwargs) # noqa: E501 - - def merge_loans_with_http_info(self, currency, ids, **kwargs): # noqa: E501 - """Merge multiple lending loans # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.merge_loans_with_http_info(currency, ids, async_req=True) - >>> result = thread.get() - - :param bool async_req: execute request asynchronously - :param str currency: Retrieve data of the specified currency (required) - :param str ids: A comma-separated (,) list of IDs of the loans lent. Maximum of 20 IDs are allowed in a 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.Loan, status_code(int), headers(HTTPHeaderDict)) - :return: If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = ['currency', 'ids'] - 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 merge_loans" % k) - 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 local_var_params['currency'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError("Missing the required parameter `currency` when calling `merge_loans`") # noqa: E501 - # verify the required parameter 'ids' is set - if self.api_client.client_side_validation and ( - 'ids' not in local_var_params or local_var_params['ids'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError("Missing the required parameter `ids` when calling `merge_loans`") # 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 'ids' in local_var_params and local_var_params['ids'] is not None: # noqa: E501 - query_params.append(('ids', local_var_params['ids'])) # 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( - '/margin/merged_loans', - 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Loan', # 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_loan(self, loan_id, side, **kwargs): # noqa: E501 - """Retrieve one single loan detail # 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_loan(loan_id, side, async_req=True) - >>> result = thread.get() - - :param bool async_req: execute request asynchronously - :param str loan_id: Loan ID (required) - :param str side: Lend or borrow (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.Loan - :return: If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - return self.get_loan_with_http_info(loan_id, side, **kwargs) # noqa: E501 - - def get_loan_with_http_info(self, loan_id, side, **kwargs): # noqa: E501 - """Retrieve one single loan detail # 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_loan_with_http_info(loan_id, side, async_req=True) - >>> result = thread.get() - - :param bool async_req: execute request asynchronously - :param str loan_id: Loan ID (required) - :param str side: Lend or borrow (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.Loan, status_code(int), headers(HTTPHeaderDict)) - :return: If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = ['loan_id', '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 get_loan" % k) - local_var_params[k] = v - del local_var_params['kwargs'] - # verify the required parameter 'loan_id' is set - if self.api_client.client_side_validation and ( - 'loan_id' not in local_var_params or local_var_params['loan_id'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError("Missing the required parameter `loan_id` when calling `get_loan`") # noqa: E501 - # verify the required parameter 'side' is set - if self.api_client.client_side_validation and ( - 'side' not in local_var_params or local_var_params['side'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError("Missing the required parameter `side` when calling `get_loan`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'loan_id' in local_var_params: - path_params['loan_id'] = local_var_params['loan_id'] # noqa: E501 - - query_params = [] - 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( - '/margin/loans/{loan_id}', - 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Loan', # 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_loan(self, loan_id, currency, **kwargs): # noqa: E501 - """Cancel lending loan # noqa: E501 - - Only lent loans can be cancelled # 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_loan(loan_id, currency, async_req=True) - >>> result = thread.get() - - :param bool async_req: execute request asynchronously - :param str loan_id: Loan ID (required) - :param str currency: Retrieve data of the specified currency (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.Loan - :return: If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - return self.cancel_loan_with_http_info(loan_id, currency, **kwargs) # noqa: E501 - - def cancel_loan_with_http_info(self, loan_id, currency, **kwargs): # noqa: E501 - """Cancel lending loan # noqa: E501 - - Only lent loans can be cancelled # 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_loan_with_http_info(loan_id, currency, async_req=True) - >>> result = thread.get() - - :param bool async_req: execute request asynchronously - :param str loan_id: Loan ID (required) - :param str currency: Retrieve data of the specified currency (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.Loan, status_code(int), headers(HTTPHeaderDict)) - :return: If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = ['loan_id', '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 cancel_loan" % k) - local_var_params[k] = v - del local_var_params['kwargs'] - # verify the required parameter 'loan_id' is set - if self.api_client.client_side_validation and ( - 'loan_id' not in local_var_params or local_var_params['loan_id'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError("Missing the required parameter `loan_id` when calling `cancel_loan`") # noqa: E501 - # verify the required parameter 'currency' is set - if self.api_client.client_side_validation and ( - 'currency' not in local_var_params or local_var_params['currency'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError("Missing the required parameter `currency` when calling `cancel_loan`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'loan_id' in local_var_params: - path_params['loan_id'] = local_var_params['loan_id'] # noqa: E501 - - 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( - '/margin/loans/{loan_id}', - 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Loan', # 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_loan(self, loan_id, loan_patch, **kwargs): # noqa: E501 - """Modify a loan # noqa: E501 - - Only `auto_renew` modification is supported currently # 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_loan(loan_id, loan_patch, async_req=True) - >>> result = thread.get() - - :param bool async_req: execute request asynchronously - :param str loan_id: Loan ID (required) - :param LoanPatch loan_patch: (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.Loan - :return: If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - return self.update_loan_with_http_info(loan_id, loan_patch, **kwargs) # noqa: E501 - - def update_loan_with_http_info(self, loan_id, loan_patch, **kwargs): # noqa: E501 - """Modify a loan # noqa: E501 - - Only `auto_renew` modification is supported currently # 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_loan_with_http_info(loan_id, loan_patch, async_req=True) - >>> result = thread.get() - - :param bool async_req: execute request asynchronously - :param str loan_id: Loan ID (required) - :param LoanPatch loan_patch: (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.Loan, status_code(int), headers(HTTPHeaderDict)) - :return: If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = ['loan_id', 'loan_patch'] - 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_loan" % k) - local_var_params[k] = v - del local_var_params['kwargs'] - # verify the required parameter 'loan_id' is set - if self.api_client.client_side_validation and ( - 'loan_id' not in local_var_params or local_var_params['loan_id'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError("Missing the required parameter `loan_id` when calling `update_loan`") # noqa: E501 - # verify the required parameter 'loan_patch' is set - if self.api_client.client_side_validation and ( - 'loan_patch' not in local_var_params or local_var_params['loan_patch'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError("Missing the required parameter `loan_patch` when calling `update_loan`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'loan_id' in local_var_params: - path_params['loan_id'] = local_var_params['loan_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'loan_patch' in local_var_params: - body_params = local_var_params['loan_patch'] - # 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( - '/margin/loans/{loan_id}', - 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Loan', # 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_loan_repayments(self, loan_id, **kwargs): # noqa: E501 - """List loan repayment 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_loan_repayments(loan_id, async_req=True) - >>> result = thread.get() - - :param bool async_req: execute request asynchronously - :param str loan_id: Loan 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.Repayment] - :return: If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - return self.list_loan_repayments_with_http_info(loan_id, **kwargs) # noqa: E501 - - def list_loan_repayments_with_http_info(self, loan_id, **kwargs): # noqa: E501 - """List loan repayment 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_loan_repayments_with_http_info(loan_id, async_req=True) - >>> result = thread.get() - - :param bool async_req: execute request asynchronously - :param str loan_id: Loan 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.Repayment], status_code(int), headers(HTTPHeaderDict)) - :return: If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = ['loan_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_loan_repayments" % k) - local_var_params[k] = v - del local_var_params['kwargs'] - # verify the required parameter 'loan_id' is set - if self.api_client.client_side_validation and ( - 'loan_id' not in local_var_params or local_var_params['loan_id'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `loan_id` when calling `list_loan_repayments`" - ) # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'loan_id' in local_var_params: - path_params['loan_id'] = local_var_params['loan_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( - '/margin/loans/{loan_id}/repayment', - 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[Repayment]', # 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 repay_loan(self, loan_id, repay_request, **kwargs): # noqa: E501 - """Repay a loan # 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_loan(loan_id, repay_request, async_req=True) - >>> result = thread.get() - - :param bool async_req: execute request asynchronously - :param str loan_id: Loan ID (required) - :param RepayRequest repay_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.Loan - :return: If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - return self.repay_loan_with_http_info(loan_id, repay_request, **kwargs) # noqa: E501 - - def repay_loan_with_http_info(self, loan_id, repay_request, **kwargs): # noqa: E501 - """Repay a loan # 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_loan_with_http_info(loan_id, repay_request, async_req=True) - >>> result = thread.get() - - :param bool async_req: execute request asynchronously - :param str loan_id: Loan ID (required) - :param RepayRequest repay_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.Loan, status_code(int), headers(HTTPHeaderDict)) - :return: If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = ['loan_id', 'repay_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 repay_loan" % k) - local_var_params[k] = v - del local_var_params['kwargs'] - # verify the required parameter 'loan_id' is set - if self.api_client.client_side_validation and ( - 'loan_id' not in local_var_params or local_var_params['loan_id'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError("Missing the required parameter `loan_id` when calling `repay_loan`") # noqa: E501 - # verify the required parameter 'repay_request' is set - if self.api_client.client_side_validation and ( - 'repay_request' not in local_var_params or local_var_params['repay_request'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `repay_request` when calling `repay_loan`" - ) # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'loan_id' in local_var_params: - path_params['loan_id'] = local_var_params['loan_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'repay_request' in local_var_params: - body_params = local_var_params['repay_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( - '/margin/loans/{loan_id}/repayment', - 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Loan', # 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_loan_records(self, loan_id, **kwargs): # noqa: E501 - """List repayment records of a specific loan # 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_loan_records(loan_id, async_req=True) - >>> result = thread.get() - - :param bool async_req: execute request asynchronously - :param str loan_id: Loan ID (required) - :param str status: Loan record status - :param int page: Page number - :param int limit: Maximum number of records to be 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.LoanRecord] - :return: If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - return self.list_loan_records_with_http_info(loan_id, **kwargs) # noqa: E501 - - def list_loan_records_with_http_info(self, loan_id, **kwargs): # noqa: E501 - """List repayment records of a specific loan # 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_loan_records_with_http_info(loan_id, async_req=True) - >>> result = thread.get() - - :param bool async_req: execute request asynchronously - :param str loan_id: Loan ID (required) - :param str status: Loan record status - :param int page: Page number - :param int limit: Maximum number of records to be 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.LoanRecord], status_code(int), headers(HTTPHeaderDict)) - :return: If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = ['loan_id', 'status', '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_loan_records" % k) - local_var_params[k] = v - del local_var_params['kwargs'] - # verify the required parameter 'loan_id' is set - if self.api_client.client_side_validation and ( - 'loan_id' not in local_var_params or local_var_params['loan_id'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `loan_id` when calling `list_loan_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_loan_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_loan_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_loan_records`, must be a value greater than or equal to `1`" - ) # noqa: E501 - collection_formats = {} - - path_params = {} - - query_params = [] - if 'loan_id' in local_var_params and local_var_params['loan_id'] is not None: # noqa: E501 - query_params.append(('loan_id', local_var_params['loan_id'])) # 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 = {} - - 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( - '/margin/loan_records', - 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[LoanRecord]', # 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_loan_record(self, loan_record_id, loan_id, **kwargs): # noqa: E501 - """Get one single loan record # 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_loan_record(loan_record_id, loan_id, async_req=True) - >>> result = thread.get() - - :param bool async_req: execute request asynchronously - :param str loan_record_id: Loan record ID (required) - :param str loan_id: Loan 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.LoanRecord - :return: If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - return self.get_loan_record_with_http_info(loan_record_id, loan_id, **kwargs) # noqa: E501 - - def get_loan_record_with_http_info(self, loan_record_id, loan_id, **kwargs): # noqa: E501 - """Get one single loan record # 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_loan_record_with_http_info(loan_record_id, loan_id, async_req=True) - >>> result = thread.get() - - :param bool async_req: execute request asynchronously - :param str loan_record_id: Loan record ID (required) - :param str loan_id: Loan 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.LoanRecord, status_code(int), headers(HTTPHeaderDict)) - :return: If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = ['loan_record_id', 'loan_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_loan_record" % k) - local_var_params[k] = v - del local_var_params['kwargs'] - # verify the required parameter 'loan_record_id' is set - if self.api_client.client_side_validation and ( - 'loan_record_id' not in local_var_params or local_var_params['loan_record_id'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `loan_record_id` when calling `get_loan_record`" - ) # noqa: E501 - # verify the required parameter 'loan_id' is set - if self.api_client.client_side_validation and ( - 'loan_id' not in local_var_params or local_var_params['loan_id'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError("Missing the required parameter `loan_id` when calling `get_loan_record`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'loan_record_id' in local_var_params: - path_params['loan_record_id'] = local_var_params['loan_record_id'] # noqa: E501 - - query_params = [] - if 'loan_id' in local_var_params and local_var_params['loan_id'] is not None: # noqa: E501 - query_params.append(('loan_id', local_var_params['loan_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( - '/margin/loan_records/{loan_record_id}', - 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='LoanRecord', # 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_loan_record(self, loan_record_id, loan_patch, **kwargs): # noqa: E501 - """Modify a loan record # noqa: E501 - - Only `auto_renew` modification is supported currently # 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_loan_record(loan_record_id, loan_patch, async_req=True) - >>> result = thread.get() - - :param bool async_req: execute request asynchronously - :param str loan_record_id: Loan record ID (required) - :param LoanPatch loan_patch: (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.LoanRecord - :return: If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - return self.update_loan_record_with_http_info(loan_record_id, loan_patch, **kwargs) # noqa: E501 - - def update_loan_record_with_http_info(self, loan_record_id, loan_patch, **kwargs): # noqa: E501 - """Modify a loan record # noqa: E501 - - Only `auto_renew` modification is supported currently # 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_loan_record_with_http_info(loan_record_id, loan_patch, async_req=True) - >>> result = thread.get() - - :param bool async_req: execute request asynchronously - :param str loan_record_id: Loan record ID (required) - :param LoanPatch loan_patch: (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.LoanRecord, status_code(int), headers(HTTPHeaderDict)) - :return: If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = ['loan_record_id', 'loan_patch'] - 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_loan_record" % k) - local_var_params[k] = v - del local_var_params['kwargs'] - # verify the required parameter 'loan_record_id' is set - if self.api_client.client_side_validation and ( - 'loan_record_id' not in local_var_params or local_var_params['loan_record_id'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `loan_record_id` when calling `update_loan_record`" - ) # noqa: E501 - # verify the required parameter 'loan_patch' is set - if self.api_client.client_side_validation and ( - 'loan_patch' not in local_var_params or local_var_params['loan_patch'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `loan_patch` when calling `update_loan_record`" - ) # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'loan_record_id' in local_var_params: - path_params['loan_record_id'] = local_var_params['loan_record_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'loan_patch' in local_var_params: - body_params = local_var_params['loan_patch'] - # 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( - '/margin/loan_records/{loan_record_id}', - 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='LoanRecord', # 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_repay_status(self, **kwargs): # noqa: E501 - """Retrieve user auto repayment 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_auto_repay_status(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.AutoRepaySetting - :return: If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - return self.get_auto_repay_status_with_http_info(**kwargs) # noqa: E501 - - def get_auto_repay_status_with_http_info(self, **kwargs): # noqa: E501 - """Retrieve user auto repayment 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_auto_repay_status_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.AutoRepaySetting, 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_auto_repay_status" % 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( - '/margin/auto_repay', - 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='AutoRepaySetting', # 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_auto_repay(self, status, **kwargs): # noqa: E501 - """Update user's auto repayment 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.set_auto_repay(status, async_req=True) - >>> result = thread.get() - - :param bool async_req: execute request asynchronously - :param str status: New auto repayment status. `on` - enabled, `off` - disabled (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.AutoRepaySetting - :return: If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - return self.set_auto_repay_with_http_info(status, **kwargs) # noqa: E501 - - def set_auto_repay_with_http_info(self, status, **kwargs): # noqa: E501 - """Update user's auto repayment 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.set_auto_repay_with_http_info(status, async_req=True) - >>> result = thread.get() - - :param bool async_req: execute request asynchronously - :param str status: New auto repayment status. `on` - enabled, `off` - disabled (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.AutoRepaySetting, status_code(int), headers(HTTPHeaderDict)) - :return: If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = ['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 set_auto_repay" % 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 local_var_params['status'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError("Missing the required parameter `status` when calling `set_auto_repay`") # 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 - - 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( - '/margin/auto_repay', - 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='AutoRepaySetting', # 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_margin_transferable(self, currency, **kwargs): # noqa: E501 - """Get the max transferable amount for a specific margin currency # 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_margin_transferable(currency, async_req=True) - >>> result = thread.get() - - :param bool async_req: execute request asynchronously - :param str currency: Retrieve data of the specified currency (required) - :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: gate_api.MarginTransferable - :return: If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - return self.get_margin_transferable_with_http_info(currency, **kwargs) # noqa: E501 - - def get_margin_transferable_with_http_info(self, currency, **kwargs): # noqa: E501 - """Get the max transferable amount for a specific margin currency # 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_margin_transferable_with_http_info(currency, async_req=True) - >>> result = thread.get() - - :param bool async_req: execute request asynchronously - :param str currency: Retrieve data of the specified currency (required) - :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(gate_api.MarginTransferable, status_code(int), headers(HTTPHeaderDict)) - :return: If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = ['currency', '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 get_margin_transferable" % k) - 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 local_var_params['currency'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `currency` when calling `get_margin_transferable`" - ) # 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 '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( - '/margin/transferable', - 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='MarginTransferable', # 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_margin_borrowable(self, currency, **kwargs): # noqa: E501 - """Get the max borrowable amount for a specific margin currency # 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_margin_borrowable(currency, async_req=True) - >>> result = thread.get() - - :param bool async_req: execute request asynchronously - :param str currency: Retrieve data of the specified currency (required) - :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: gate_api.MarginBorrowable - :return: If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - return self.get_margin_borrowable_with_http_info(currency, **kwargs) # noqa: E501 - - def get_margin_borrowable_with_http_info(self, currency, **kwargs): # noqa: E501 - """Get the max borrowable amount for a specific margin currency # noqa: E501 + """Margin account 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_margin_borrowable_with_http_info(currency, async_req=True) + >>> thread = api.list_margin_accounts_with_http_info(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str currency: Retrieve data of the specified currency (required) :param str currency_pair: Currency pair :param _return_http_data_only: response data without head status code and headers @@ -2319,36 +79,39 @@ def get_margin_borrowable_with_http_info(self, currency, **kwargs): # noqa: E50 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: tuple(gate_api.MarginBorrowable, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(list[gate_api.MarginAccount], status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ local_var_params = locals() - all_params = ['currency', 'currency_pair'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + 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 get_margin_borrowable" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_margin_accounts" % k + ) 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 local_var_params['currency'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `currency` when calling `get_margin_borrowable`" - ) # 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 '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 @@ -2359,38 +122,45 @@ def get_margin_borrowable_with_http_info(self, currency, **kwargs): # noqa: E50 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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( - '/margin/borrowable', - 'GET', + '/margin/accounts', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='MarginBorrowable', # noqa: E501 + response_type='list[MarginAccount]', # 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, - ) + collection_formats=collection_formats) - def list_cross_margin_currencies(self, **kwargs): # noqa: E501 - """Currencies supported by cross margin. # noqa: E501 + def list_margin_account_book(self, **kwargs): # noqa: E501 + """Query margin account balance change history # noqa: E501 + Currently only provides transfer history to and from margin accounts. Query time range cannot exceed 30 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.list_cross_margin_currencies(async_req=True) + >>> thread = api.list_margin_account_book(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously + :param str currency: Query history for specified currency. If `currency` is specified, `currency_pair` must also be specified. + :param str currency_pair: Specify margin account currency pair. Used in combination with `currency`. Ignored if `currency` is not specified + :param str type: Query by specified account change type. If not specified, all change types will be included. + :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 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. @@ -2398,22 +168,30 @@ def list_cross_margin_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.CrossMarginCurrency] + :rtype: list[gate_api.MarginAccountBook] :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.list_cross_margin_currencies_with_http_info(**kwargs) # noqa: E501 + return self.list_margin_account_book_with_http_info(**kwargs) # noqa: E501 - def list_cross_margin_currencies_with_http_info(self, **kwargs): # noqa: E501 - """Currencies supported by cross margin. # noqa: E501 + def list_margin_account_book_with_http_info(self, **kwargs): # noqa: E501 + """Query margin account balance change history # noqa: E501 + Currently only provides transfer history to and from margin accounts. Query time range cannot exceed 30 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.list_cross_margin_currencies_with_http_info(async_req=True) + >>> thread = api.list_margin_account_book_with_http_info(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously + :param str currency: Query history for specified currency. If `currency` is specified, `currency_pair` must also be specified. + :param str currency_pair: Specify margin account currency pair. Used in combination with `currency`. Ignored if `currency` is not specified + :param str type: Query by specified account change type. If not specified, all change types will be included. + :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 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 @@ -2423,29 +201,65 @@ def list_cross_margin_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.CrossMarginCurrency], status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(list[gate_api.MarginAccountBook], 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']) + all_params = [ + 'currency', + 'currency_pair', + 'type', + '_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_cross_margin_currencies" % k + "Got an unexpected keyword argument '%s'" + " to method list_margin_account_book" % 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_margin_account_book`, 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'] > 500: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `list_margin_account_book`, 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 `list_margin_account_book`, 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 '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 '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 '_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 = {} @@ -2454,39 +268,38 @@ def list_cross_margin_currencies_with_http_info(self, **kwargs): # noqa: E501 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 # Authentication setting - auth_settings = [] # noqa: E501 + auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( - '/margin/cross/currencies', - 'GET', + '/margin/account_book', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[CrossMarginCurrency]', # noqa: E501 + response_type='list[MarginAccountBook]', # 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, - ) + collection_formats=collection_formats) - def get_cross_margin_currency(self, currency, **kwargs): # noqa: E501 - """Retrieve detail of one single currency supported by cross margin # noqa: E501 + def list_funding_accounts(self, **kwargs): # noqa: E501 + """Funding account 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_cross_margin_currency(currency, async_req=True) + >>> thread = api.list_funding_accounts(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str currency: Currency name (required) + :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. @@ -2494,23 +307,23 @@ def get_cross_margin_currency(self, currency, **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.CrossMarginCurrency + :rtype: list[gate_api.FundingAccount] :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.get_cross_margin_currency_with_http_info(currency, **kwargs) # noqa: E501 + return self.list_funding_accounts_with_http_info(**kwargs) # noqa: E501 - def get_cross_margin_currency_with_http_info(self, currency, **kwargs): # noqa: E501 - """Retrieve detail of one single currency supported by cross margin # noqa: E501 + def list_funding_accounts_with_http_info(self, **kwargs): # noqa: E501 + """Funding account 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_cross_margin_currency_with_http_info(currency, async_req=True) + >>> thread = api.list_funding_accounts_with_http_info(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str currency: Currency name (required) + :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 @@ -2520,36 +333,41 @@ def get_cross_margin_currency_with_http_info(self, currency, **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.CrossMarginCurrency, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(list[gate_api.FundingAccount], 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']) + 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 get_cross_margin_currency" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_funding_accounts" % k + ) 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 local_var_params['currency'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `currency` when calling `get_cross_margin_currency`" - ) # noqa: E501 collection_formats = {} path_params = {} - if 'currency' in local_var_params: - path_params['currency'] = local_var_params['currency'] # noqa: E501 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 = {} @@ -2558,35 +376,34 @@ def get_cross_margin_currency_with_http_info(self, currency, **kwargs): # noqa: body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 # Authentication setting - auth_settings = [] # noqa: E501 + auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( - '/margin/cross/currencies/{currency}', - 'GET', + '/margin/funding_accounts', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='CrossMarginCurrency', # noqa: E501 + response_type='list[FundingAccount]', # 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, - ) + collection_formats=collection_formats) - def get_cross_margin_account(self, **kwargs): # noqa: E501 - """Retrieve cross margin account # noqa: E501 + def get_auto_repay_status(self, **kwargs): # noqa: E501 + """Query user auto repayment settings # 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_cross_margin_account(async_req=True) + >>> thread = api.get_auto_repay_status(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously @@ -2597,19 +414,19 @@ def get_cross_margin_account(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.CrossMarginAccount + :rtype: gate_api.AutoRepaySetting :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.get_cross_margin_account_with_http_info(**kwargs) # noqa: E501 + return self.get_auto_repay_status_with_http_info(**kwargs) # noqa: E501 - def get_cross_margin_account_with_http_info(self, **kwargs): # noqa: E501 - """Retrieve cross margin account # noqa: E501 + def get_auto_repay_status_with_http_info(self, **kwargs): # noqa: E501 + """Query user auto repayment settings # 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_cross_margin_account_with_http_info(async_req=True) + >>> thread = api.get_auto_repay_status_with_http_info(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously @@ -2622,19 +439,30 @@ def get_cross_margin_account_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.CrossMarginAccount, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(gate_api.AutoRepaySetting, 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']) + 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_cross_margin_account" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_auto_repay_status" % k + ) local_var_params[k] = v del local_var_params['kwargs'] @@ -2651,45 +479,38 @@ def get_cross_margin_account_with_http_info(self, **kwargs): # noqa: E501 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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( - '/margin/cross/accounts', - 'GET', + '/margin/auto_repay', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='CrossMarginAccount', # noqa: E501 + response_type='AutoRepaySetting', # 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, - ) + collection_formats=collection_formats) - def list_cross_margin_account_book(self, **kwargs): # noqa: E501 - """Retrieve cross margin account change history # noqa: E501 + def set_auto_repay(self, status, **kwargs): # noqa: E501 + """Update user auto repayment settings # noqa: E501 - Record time range cannot exceed 30 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.list_cross_margin_account_book(async_req=True) + >>> thread = api.set_auto_repay(status, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str currency: Filter by currency - :param int _from: Start timestamp of the query - :param int to: Time range ending, default to current time - :param int page: Page number - :param int limit: Maximum number of records to be returned in a single list - :param str type: Only retrieve changes of the specified type. All types will be returned if not specified. + :param str status: Whether to enable auto repayment: `on` - enabled, `off` - disabled (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -2697,29 +518,23 @@ def list_cross_margin_account_book(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.CrossMarginAccountBook] + :rtype: gate_api.AutoRepaySetting :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.list_cross_margin_account_book_with_http_info(**kwargs) # noqa: E501 + return self.set_auto_repay_with_http_info(status, **kwargs) # noqa: E501 - def list_cross_margin_account_book_with_http_info(self, **kwargs): # noqa: E501 - """Retrieve cross margin account change history # noqa: E501 + def set_auto_repay_with_http_info(self, status, **kwargs): # noqa: E501 + """Update user auto repayment settings # noqa: E501 - Record time range cannot exceed 30 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.list_cross_margin_account_book_with_http_info(async_req=True) + >>> thread = api.set_auto_repay_with_http_info(status, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str currency: Filter by currency - :param int _from: Start timestamp of the query - :param int to: Time range ending, default to current time - :param int page: Page number - :param int limit: Maximum number of records to be returned in a single list - :param str type: Only retrieve changes of the specified type. All types will be returned if not specified. + :param str status: Whether to enable auto repayment: `on` - enabled, `off` - disabled (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -2729,59 +544,45 @@ def list_cross_margin_account_book_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.CrossMarginAccountBook], status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(gate_api.AutoRepaySetting, status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ local_var_params = locals() - all_params = ['currency', '_from', 'to', 'page', 'limit', 'type'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + '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_cross_margin_account_book" % k + "Got an unexpected keyword argument '%s'" + " to method set_auto_repay" % 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 `set_auto_repay`") # 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_cross_margin_account_book`, 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_cross_margin_account_book`, 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_cross_margin_account_book`, 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 '_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 '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 header_params = {} @@ -2790,44 +591,39 @@ def list_cross_margin_account_book_with_http_info(self, **kwargs): # noqa: E501 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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( - '/margin/cross/account_book', - 'GET', + '/margin/auto_repay', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[CrossMarginAccountBook]', # noqa: E501 + response_type='AutoRepaySetting', # 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, - ) + collection_formats=collection_formats) - def list_cross_margin_loans(self, status, **kwargs): # noqa: E501 - """List cross margin borrow history # noqa: E501 + def get_margin_transferable(self, currency, **kwargs): # noqa: E501 + """Get maximum transferable amount for isolated margin # noqa: E501 - Sort by creation time in descending order by default. Set `reverse=false` to return ascending results. # 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_cross_margin_loans(status, async_req=True) + >>> thread = api.get_margin_transferable(currency, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param int status: Filter by status. Supported values are 2 and 3. (required) - :param str currency: Filter by currency - :param int limit: Maximum number of records to be returned in a single list - :param int offset: List offset, starting from 0 - :param bool reverse: Whether to sort in descending order, which is the default. Set `reverse=false` to return ascending results + :param str currency: Query by specified currency name (required) + :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. @@ -2835,28 +631,24 @@ def list_cross_margin_loans(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.CrossMarginLoan] + :rtype: gate_api.MarginTransferable :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.list_cross_margin_loans_with_http_info(status, **kwargs) # noqa: E501 + return self.get_margin_transferable_with_http_info(currency, **kwargs) # noqa: E501 - def list_cross_margin_loans_with_http_info(self, status, **kwargs): # noqa: E501 - """List cross margin borrow history # noqa: E501 + def get_margin_transferable_with_http_info(self, currency, **kwargs): # noqa: E501 + """Get maximum transferable amount for isolated margin # noqa: E501 - Sort by creation time in descending order by default. Set `reverse=false` to return ascending results. # 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_cross_margin_loans_with_http_info(status, async_req=True) + >>> thread = api.get_margin_transferable_with_http_info(currency, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param int status: Filter by status. Supported values are 2 and 3. (required) - :param str currency: Filter by currency - :param int limit: Maximum number of records to be returned in a single list - :param int offset: List offset, starting from 0 - :param bool reverse: Whether to sort in descending order, which is the default. Set `reverse=false` to return ascending results + :param str currency: Query by specified currency name (required) + :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 @@ -2866,62 +658,48 @@ def list_cross_margin_loans_with_http_info(self, status, **kwargs): # noqa: E50 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: tuple(list[gate_api.CrossMarginLoan], status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(gate_api.MarginTransferable, status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ local_var_params = locals() - all_params = ['status', 'currency', 'limit', 'offset', 'reverse'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'currency', + '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 list_cross_margin_loans" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_margin_transferable" % 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 local_var_params['status'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `status` when calling `list_cross_margin_loans`" - ) # 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_cross_margin_loans`, 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_cross_margin_loans`, 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_cross_margin_loans`, must be a value greater than or equal to `0`" - ) # noqa: E501 + # 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 `get_margin_transferable`") # 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 '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 '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 'reverse' in local_var_params and local_var_params['reverse'] is not None: # noqa: E501 - query_params.append(('reverse', local_var_params['reverse'])) # noqa: E501 + 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 = {} @@ -2930,40 +708,38 @@ def list_cross_margin_loans_with_http_info(self, status, **kwargs): # noqa: E50 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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( - '/margin/cross/loans', - 'GET', + '/margin/transferable', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[CrossMarginLoan]', # noqa: E501 + response_type='MarginTransferable', # 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, - ) + collection_formats=collection_formats) - def create_cross_margin_loan(self, cross_margin_loan, **kwargs): # noqa: E501 - """Create a cross margin borrow loan # noqa: E501 + def get_user_margin_tier(self, currency_pair, **kwargs): # noqa: E501 + """Query user's own leverage lending tiers in current market # noqa: E501 - Borrow amount cannot be less than currency minimum borrow 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.create_cross_margin_loan(cross_margin_loan, async_req=True) + >>> thread = api.get_user_margin_tier(currency_pair, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param CrossMarginLoan cross_margin_loan: (required) + :param str currency_pair: Currency pair (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -2971,24 +747,23 @@ def create_cross_margin_loan(self, cross_margin_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.CrossMarginLoan + :rtype: list[gate_api.MarginLeverageTier] :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.create_cross_margin_loan_with_http_info(cross_margin_loan, **kwargs) # noqa: E501 + return self.get_user_margin_tier_with_http_info(currency_pair, **kwargs) # noqa: E501 - def create_cross_margin_loan_with_http_info(self, cross_margin_loan, **kwargs): # noqa: E501 - """Create a cross margin borrow loan # noqa: E501 + def get_user_margin_tier_with_http_info(self, currency_pair, **kwargs): # noqa: E501 + """Query user's own leverage lending tiers in current market # noqa: E501 - Borrow amount cannot be less than currency minimum borrow 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.create_cross_margin_loan_with_http_info(cross_margin_loan, async_req=True) + >>> thread = api.get_user_margin_tier_with_http_info(currency_pair, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param CrossMarginLoan cross_margin_loan: (required) + :param str currency_pair: Currency 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 @@ -2998,34 +773,45 @@ def create_cross_margin_loan_with_http_info(self, cross_margin_loan, **kwargs): number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: tuple(gate_api.CrossMarginLoan, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(list[gate_api.MarginLeverageTier], status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ local_var_params = locals() - all_params = ['cross_margin_loan'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + 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 create_cross_margin_loan" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_user_margin_tier" % k + ) local_var_params[k] = v del local_var_params['kwargs'] - # verify the required parameter 'cross_margin_loan' is set - if self.api_client.client_side_validation and ( - 'cross_margin_loan' not in local_var_params or local_var_params['cross_margin_loan'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `cross_margin_loan` when calling `create_cross_margin_loan`" - ) # noqa: E501 + # verify the required parameter 'currency_pair' is set + if self.api_client.client_side_validation and ('currency_pair' not in local_var_params or # noqa: E501 + local_var_params['currency_pair'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `currency_pair` when calling `get_user_margin_tier`") # 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 header_params = {} @@ -3033,47 +819,39 @@ def create_cross_margin_loan_with_http_info(self, cross_margin_loan, **kwargs): local_var_files = {} body_params = None - if 'cross_margin_loan' in local_var_params: - body_params = local_var_params['cross_margin_loan'] # 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 + 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( - '/margin/cross/loans', - 'POST', + '/margin/user/loan_margin_tiers', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='CrossMarginLoan', # noqa: E501 + response_type='list[MarginLeverageTier]', # 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, - ) + collection_formats=collection_formats) - def get_cross_margin_loan(self, loan_id, **kwargs): # noqa: E501 - """Retrieve single borrow loan detail # noqa: E501 + def get_market_margin_tier(self, currency_pair, **kwargs): # noqa: E501 + """Query current market leverage lending tiers # 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_cross_margin_loan(loan_id, async_req=True) + >>> thread = api.get_market_margin_tier(currency_pair, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str loan_id: Borrow loan ID (required) + :param str currency_pair: Currency pair (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -3081,23 +859,23 @@ def get_cross_margin_loan(self, loan_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.CrossMarginLoan + :rtype: list[gate_api.MarginLeverageTier] :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.get_cross_margin_loan_with_http_info(loan_id, **kwargs) # noqa: E501 + return self.get_market_margin_tier_with_http_info(currency_pair, **kwargs) # noqa: E501 - def get_cross_margin_loan_with_http_info(self, loan_id, **kwargs): # noqa: E501 - """Retrieve single borrow loan detail # noqa: E501 + def get_market_margin_tier_with_http_info(self, currency_pair, **kwargs): # noqa: E501 + """Query current market leverage lending tiers # 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_cross_margin_loan_with_http_info(loan_id, async_req=True) + >>> thread = api.get_market_margin_tier_with_http_info(currency_pair, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str loan_id: Borrow loan ID (required) + :param str currency_pair: Currency 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 @@ -3107,36 +885,45 @@ def get_cross_margin_loan_with_http_info(self, loan_id, **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.CrossMarginLoan, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(list[gate_api.MarginLeverageTier], status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ local_var_params = locals() - all_params = ['loan_id'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + 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 get_cross_margin_loan" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_market_margin_tier" % k + ) local_var_params[k] = v del local_var_params['kwargs'] - # verify the required parameter 'loan_id' is set - if self.api_client.client_side_validation and ( - 'loan_id' not in local_var_params or local_var_params['loan_id'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `loan_id` when calling `get_cross_margin_loan`" - ) # noqa: E501 + # verify the required parameter 'currency_pair' is set + if self.api_client.client_side_validation and ('currency_pair' not in local_var_params or # noqa: E501 + local_var_params['currency_pair'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `currency_pair` when calling `get_market_margin_tier`") # noqa: E501 collection_formats = {} path_params = {} - if 'loan_id' in local_var_params: - path_params['loan_id'] = local_var_params['loan_id'] # noqa: E501 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 = {} @@ -3145,44 +932,38 @@ def get_cross_margin_loan_with_http_info(self, loan_id, **kwargs): # noqa: E501 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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( - '/margin/cross/loans/{loan_id}', - 'GET', + '/margin/loan_margin_tiers', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='CrossMarginLoan', # noqa: E501 + response_type='list[MarginLeverageTier]', # 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, - ) + collection_formats=collection_formats) - def list_cross_margin_repayments(self, **kwargs): # noqa: E501 - """Retrieve cross margin repayments # noqa: E501 + def set_user_market_leverage(self, margin_market_leverage, **kwargs): # noqa: E501 + """Set user market leverage multiplier # noqa: E501 - Sort by creation time in descending order by default. Set `reverse=false` to return ascending results. # 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_cross_margin_repayments(async_req=True) + >>> thread = api.set_user_market_leverage(margin_market_leverage, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str currency: - :param str loan_id: - :param int limit: Maximum number of records to be returned in a single list - :param int offset: List offset, starting from 0 - :param bool reverse: Whether to sort in descending order, which is the default. Set `reverse=false` to return ascending results + :param MarginMarketLeverage margin_market_leverage: (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -3190,28 +971,23 @@ def list_cross_margin_repayments(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.CrossMarginRepayment] + :rtype: None :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.list_cross_margin_repayments_with_http_info(**kwargs) # noqa: E501 + return self.set_user_market_leverage_with_http_info(margin_market_leverage, **kwargs) # noqa: E501 - def list_cross_margin_repayments_with_http_info(self, **kwargs): # noqa: E501 - """Retrieve cross margin repayments # noqa: E501 + def set_user_market_leverage_with_http_info(self, margin_market_leverage, **kwargs): # noqa: E501 + """Set user market leverage multiplier # noqa: E501 - Sort by creation time in descending order by default. Set `reverse=false` to return ascending results. # 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_cross_margin_repayments_with_http_info(async_req=True) + >>> thread = api.set_user_market_leverage_with_http_info(margin_market_leverage, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str currency: - :param str loan_id: - :param int limit: Maximum number of records to be returned in a single list - :param int offset: List offset, starting from 0 - :param bool reverse: Whether to sort in descending order, which is the default. Set `reverse=false` to return ascending results + :param MarginMarketLeverage margin_market_leverage: (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -3221,57 +997,43 @@ def list_cross_margin_repayments_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.CrossMarginRepayment], status_code(int), headers(HTTPHeaderDict)) + :rtype: None :return: If the method is called asynchronously, returns the request thread. """ local_var_params = locals() - all_params = ['currency', 'loan_id', 'limit', 'offset', 'reverse'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'margin_market_leverage' + ] + 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_cross_margin_repayments" % k + "Got an unexpected keyword argument '%s'" + " to method set_user_market_leverage" % k ) local_var_params[k] = v del local_var_params['kwargs'] + # verify the required parameter 'margin_market_leverage' is set + if self.api_client.client_side_validation and ('margin_market_leverage' not in local_var_params or # noqa: E501 + local_var_params['margin_market_leverage'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `margin_market_leverage` when calling `set_user_market_leverage`") # 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_cross_margin_repayments`, 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_cross_margin_repayments`, 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_cross_margin_repayments`, must be a value greater than or equal to `0`" - ) # 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 'loan_id' in local_var_params and local_var_params['loan_id'] is not None: # noqa: E501 - query_params.append(('loan_id', local_var_params['loan_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 '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 'reverse' in local_var_params and local_var_params['reverse'] is not None: # noqa: E501 - query_params.append(('reverse', local_var_params['reverse'])) # noqa: E501 header_params = {} @@ -3279,40 +1041,42 @@ def list_cross_margin_repayments_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(['application/json']) # noqa: E501 + if 'margin_market_leverage' in local_var_params: + body_params = local_var_params['margin_market_leverage'] + # 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( - '/margin/cross/repayments', - 'GET', + '/margin/leverage/user_market_setting', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[CrossMarginRepayment]', # 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 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - ) + collection_formats=collection_formats) - def repay_cross_margin_loan(self, cross_margin_repay_request, **kwargs): # noqa: E501 - """Repay cross margin loan # noqa: E501 + def list_margin_user_account(self, **kwargs): # noqa: E501 + """Query user's isolated margin account list # noqa: E501 + Supports querying risk ratio isolated accounts and margin ratio isolated 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.repay_cross_margin_loan(cross_margin_repay_request, async_req=True) + >>> thread = api.list_margin_user_account(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param CrossMarginRepayRequest cross_margin_repay_request: (required) + :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. @@ -3320,23 +1084,24 @@ def repay_cross_margin_loan(self, cross_margin_repay_request, **kwargs): # noqa number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: list[gate_api.CrossMarginLoan] + :rtype: list[gate_api.MarginAccount] :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.repay_cross_margin_loan_with_http_info(cross_margin_repay_request, **kwargs) # noqa: E501 + return self.list_margin_user_account_with_http_info(**kwargs) # noqa: E501 - def repay_cross_margin_loan_with_http_info(self, cross_margin_repay_request, **kwargs): # noqa: E501 - """Repay cross margin loan # noqa: E501 + def list_margin_user_account_with_http_info(self, **kwargs): # noqa: E501 + """Query user's isolated margin account list # noqa: E501 + Supports querying risk ratio isolated accounts and margin ratio isolated 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.repay_cross_margin_loan_with_http_info(cross_margin_repay_request, async_req=True) + >>> thread = api.list_margin_user_account_with_http_info(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param CrossMarginRepayRequest cross_margin_repay_request: (required) + :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 @@ -3346,35 +1111,41 @@ def repay_cross_margin_loan_with_http_info(self, cross_margin_repay_request, **k number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: tuple(list[gate_api.CrossMarginLoan], status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(list[gate_api.MarginAccount], status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ local_var_params = locals() - all_params = ['cross_margin_repay_request'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + 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 repay_cross_margin_loan" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_margin_user_account" % k + ) local_var_params[k] = v del local_var_params['kwargs'] - # verify the required parameter 'cross_margin_repay_request' is set - if self.api_client.client_side_validation and ( - 'cross_margin_repay_request' not in local_var_params - or local_var_params['cross_margin_repay_request'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `cross_margin_repay_request` when calling `repay_cross_margin_loan`" - ) # 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 header_params = {} @@ -3382,47 +1153,44 @@ def repay_cross_margin_loan_with_http_info(self, cross_margin_repay_request, **k local_var_files = {} body_params = None - if 'cross_margin_repay_request' in local_var_params: - body_params = local_var_params['cross_margin_repay_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 + 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( - '/margin/cross/repayments', - 'POST', + '/margin/user/account', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[CrossMarginLoan]', # noqa: E501 + response_type='list[MarginAccount]', # 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, - ) + collection_formats=collection_formats) - def get_cross_margin_transferable(self, currency, **kwargs): # noqa: E501 - """Get the max transferable amount for a specific cross margin currency # noqa: E501 + def list_cross_margin_loans(self, status, **kwargs): # noqa: E501 + """Query cross margin borrow history (deprecated) # noqa: E501 + Sorted by creation time in descending order by default. Set `reverse=false` for 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.get_cross_margin_transferable(currency, async_req=True) + >>> thread = api.list_cross_margin_loans(status, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str currency: Retrieve data of the specified currency (required) + :param int status: Filter by status. Supported values are 2 and 3. (deprecated.) (required) + :param str currency: Query by specified currency, includes all currencies if not specified + :param int limit: Maximum number of records returned in a single list + :param int offset: List offset, starting from 0 + :param bool reverse: Whether to sort in descending order, which is the default. Set `reverse=false` to return ascending results :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -3430,23 +1198,28 @@ def get_cross_margin_transferable(self, currency, **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.CrossMarginTransferable + :rtype: list[gate_api.CrossMarginLoan] :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.get_cross_margin_transferable_with_http_info(currency, **kwargs) # noqa: E501 + return self.list_cross_margin_loans_with_http_info(status, **kwargs) # noqa: E501 - def get_cross_margin_transferable_with_http_info(self, currency, **kwargs): # noqa: E501 - """Get the max transferable amount for a specific cross margin currency # noqa: E501 + def list_cross_margin_loans_with_http_info(self, status, **kwargs): # noqa: E501 + """Query cross margin borrow history (deprecated) # noqa: E501 + Sorted by creation time in descending order by default. Set `reverse=false` for 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.get_cross_margin_transferable_with_http_info(currency, async_req=True) + >>> thread = api.list_cross_margin_loans_with_http_info(status, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str currency: Retrieve data of the specified currency (required) + :param int status: Filter by status. Supported values are 2 and 3. (deprecated.) (required) + :param str currency: Query by specified currency, includes all currencies if not specified + :param int limit: Maximum number of records returned in a single list + :param int offset: List offset, starting from 0 + :param bool reverse: Whether to sort in descending order, which is the default. Set `reverse=false` to return ascending results :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -3456,38 +1229,63 @@ def get_cross_margin_transferable_with_http_info(self, currency, **kwargs): # n number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: tuple(gate_api.CrossMarginTransferable, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(list[gate_api.CrossMarginLoan], 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']) + all_params = [ + 'status', + 'currency', + 'limit', + 'offset', + 'reverse' + ] + 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_cross_margin_transferable" % k + "Got an unexpected keyword argument '%s'" + " to method list_cross_margin_loans" % k ) 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 local_var_params['currency'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `currency` when calling `get_cross_margin_transferable`" - ) # 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_cross_margin_loans`") # 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_cross_margin_loans`, 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_cross_margin_loans`, 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_cross_margin_loans`, must be a value greater than or equal to `0`") # 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 '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 '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 'reverse' in local_var_params and local_var_params['reverse'] is not None: # noqa: E501 + query_params.append(('reverse', local_var_params['reverse'])) # noqa: E501 header_params = {} @@ -3496,39 +1294,43 @@ def get_cross_margin_transferable_with_http_info(self, currency, **kwargs): # n body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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( - '/margin/cross/transferable', - 'GET', + '/margin/cross/loans', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='CrossMarginTransferable', # noqa: E501 + response_type='list[CrossMarginLoan]', # 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, - ) + collection_formats=collection_formats) - def get_cross_margin_borrowable(self, currency, **kwargs): # noqa: E501 - """Get the max borrowable amount for a specific cross margin currency # noqa: E501 + def list_cross_margin_repayments(self, **kwargs): # noqa: E501 + """Retrieve cross margin repayments. (deprecated) # noqa: E501 + Sorted by creation time in descending order by default. Set `reverse=false` for 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.get_cross_margin_borrowable(currency, async_req=True) + >>> thread = api.list_cross_margin_repayments(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str currency: Retrieve data of the specified currency (required) + :param str currency: + :param str loan_id: + :param int limit: Maximum number of records returned in a single list + :param int offset: List offset, starting from 0 + :param bool reverse: Whether to sort in descending order, which is the default. Set `reverse=false` to return ascending results :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -3536,23 +1338,28 @@ def get_cross_margin_borrowable(self, currency, **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.CrossMarginBorrowable + :rtype: list[gate_api.CrossMarginRepayment] :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.get_cross_margin_borrowable_with_http_info(currency, **kwargs) # noqa: E501 + return self.list_cross_margin_repayments_with_http_info(**kwargs) # noqa: E501 - def get_cross_margin_borrowable_with_http_info(self, currency, **kwargs): # noqa: E501 - """Get the max borrowable amount for a specific cross margin currency # noqa: E501 + def list_cross_margin_repayments_with_http_info(self, **kwargs): # noqa: E501 + """Retrieve cross margin repayments. (deprecated) # noqa: E501 + Sorted by creation time in descending order by default. Set `reverse=false` for 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.get_cross_margin_borrowable_with_http_info(currency, async_req=True) + >>> thread = api.list_cross_margin_repayments_with_http_info(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str currency: Retrieve data of the specified currency (required) + :param str currency: + :param str loan_id: + :param int limit: Maximum number of records returned in a single list + :param int offset: List offset, starting from 0 + :param bool reverse: Whether to sort in descending order, which is the default. Set `reverse=false` to return ascending results :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -3562,31 +1369,44 @@ def get_cross_margin_borrowable_with_http_info(self, currency, **kwargs): # noq number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: tuple(gate_api.CrossMarginBorrowable, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(list[gate_api.CrossMarginRepayment], 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']) + all_params = [ + 'currency', + 'loan_id', + 'limit', + 'offset', + 'reverse' + ] + 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_cross_margin_borrowable" % k + "Got an unexpected keyword argument '%s'" + " to method list_cross_margin_repayments" % k ) 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 local_var_params['currency'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `currency` when calling `get_cross_margin_borrowable`" - ) # 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_cross_margin_repayments`, 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_cross_margin_repayments`, 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_cross_margin_repayments`, must be a value greater than or equal to `0`") # noqa: E501 collection_formats = {} path_params = {} @@ -3594,6 +1414,14 @@ def get_cross_margin_borrowable_with_http_info(self, currency, **kwargs): # noq 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 'loan_id' in local_var_params and local_var_params['loan_id'] is not None: # noqa: E501 + query_params.append(('loan_id', local_var_params['loan_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 '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 'reverse' in local_var_params and local_var_params['reverse'] is not None: # noqa: E501 + query_params.append(('reverse', local_var_params['reverse'])) # noqa: E501 header_params = {} @@ -3602,25 +1430,24 @@ def get_cross_margin_borrowable_with_http_info(self, currency, **kwargs): # noq body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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( - '/margin/cross/borrowable', - 'GET', + '/margin/cross/repayments', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='CrossMarginBorrowable', # noqa: E501 + response_type='list[CrossMarginRepayment]', # 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, - ) + collection_formats=collection_formats) diff --git a/gate_api/api/margin_uni_api.py b/gate_api/api/margin_uni_api.py new file mode 100644 index 0000000..6ba4bde --- /dev/null +++ b/gate_api/api/margin_uni_api.py @@ -0,0 +1,1008 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market 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 MarginUniApi(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_uni_currency_pairs(self, **kwargs): # noqa: E501 + """List lending markets # 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_uni_currency_pairs(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.UniCurrencyPair] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_uni_currency_pairs_with_http_info(**kwargs) # noqa: E501 + + def list_uni_currency_pairs_with_http_info(self, **kwargs): # noqa: E501 + """List lending markets # 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_uni_currency_pairs_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.UniCurrencyPair], 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_uni_currency_pairs" % 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( + '/margin/uni/currency_pairs', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[UniCurrencyPair]', # 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_uni_currency_pair(self, currency_pair, **kwargs): # noqa: E501 + """Get lending market 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_uni_currency_pair(currency_pair, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency_pair: Currency 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.UniCurrencyPair + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_uni_currency_pair_with_http_info(currency_pair, **kwargs) # noqa: E501 + + def get_uni_currency_pair_with_http_info(self, currency_pair, **kwargs): # noqa: E501 + """Get lending market 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_uni_currency_pair_with_http_info(currency_pair, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency_pair: Currency 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.UniCurrencyPair, 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 get_uni_currency_pair" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'currency_pair' is set + if self.api_client.client_side_validation and ('currency_pair' not in local_var_params or # noqa: E501 + local_var_params['currency_pair'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `currency_pair` when calling `get_uni_currency_pair`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'currency_pair' in local_var_params: + path_params['currency_pair'] = local_var_params['currency_pair'] # 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( + '/margin/uni/currency_pairs/{currency_pair}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='UniCurrencyPair', # 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_margin_uni_estimate_rate(self, currencies, **kwargs): # noqa: E501 + """Estimate interest rate for isolated margin currencies # noqa: E501 + + Interest rates change hourly based on lending depth, so completely accurate rates cannot be provided. # 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_margin_uni_estimate_rate(currencies, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param list[str] currencies: Array of currency names to query, maximum 10 (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: dict + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_margin_uni_estimate_rate_with_http_info(currencies, **kwargs) # noqa: E501 + + def get_margin_uni_estimate_rate_with_http_info(self, currencies, **kwargs): # noqa: E501 + """Estimate interest rate for isolated margin currencies # noqa: E501 + + Interest rates change hourly based on lending depth, so completely accurate rates cannot be provided. # 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_margin_uni_estimate_rate_with_http_info(currencies, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param list[str] currencies: Array of currency names to query, maximum 10 (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(dict, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'currencies' + ] + 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_margin_uni_estimate_rate" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'currencies' is set + if self.api_client.client_side_validation and ('currencies' not in local_var_params or # noqa: E501 + local_var_params['currencies'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `currencies` when calling `get_margin_uni_estimate_rate`") # noqa: E501 + + if self.api_client.client_side_validation and ('currencies' in local_var_params and # noqa: E501 + len(local_var_params['currencies']) > 10): # noqa: E501 + raise ApiValueError("Invalid value for parameter `currencies` when calling `get_margin_uni_estimate_rate`, number of items must be less than or equal to `10`") # noqa: E501 + if self.api_client.client_side_validation and ('currencies' in local_var_params and # noqa: E501 + len(local_var_params['currencies']) < 1): # noqa: E501 + raise ApiValueError("Invalid value for parameter `currencies` when calling `get_margin_uni_estimate_rate`, number of items must be greater than or equal to `1`") # noqa: E501 + collection_formats = {} + + path_params = {} + + query_params = [] + if 'currencies' in local_var_params and local_var_params['currencies'] is not None: # noqa: E501 + query_params.append(('currencies', local_var_params['currencies'])) # noqa: E501 + collection_formats['currencies'] = 'multi' # 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( + '/margin/uni/estimate_rate', '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 list_uni_loans(self, **kwargs): # noqa: E501 + """Query loans # 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_uni_loans(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency_pair: Currency pair + :param str currency: Query by specified currency name + :param int page: Page number + :param int limit: Maximum number of items returned. Default: 100, minimum: 1, 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: list[gate_api.UniLoan] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_uni_loans_with_http_info(**kwargs) # noqa: E501 + + def list_uni_loans_with_http_info(self, **kwargs): # noqa: E501 + """Query loans # 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_uni_loans_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency_pair: Currency pair + :param str currency: Query by specified currency name + :param int page: Page number + :param int limit: Maximum number of items returned. Default: 100, minimum: 1, 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(list[gate_api.UniLoan], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'currency_pair', + 'currency', + '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_uni_loans" % 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_uni_loans`, 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_uni_loans`, 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_uni_loans`, 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 '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 '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( + '/margin/uni/loans', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[UniLoan]', # 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_uni_loan(self, create_uni_loan, **kwargs): # noqa: E501 + """Borrow or repay # 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_uni_loan(create_uni_loan, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param CreateUniLoan create_uni_loan: (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.create_uni_loan_with_http_info(create_uni_loan, **kwargs) # noqa: E501 + + def create_uni_loan_with_http_info(self, create_uni_loan, **kwargs): # noqa: E501 + """Borrow or repay # 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_uni_loan_with_http_info(create_uni_loan, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param CreateUniLoan create_uni_loan: (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 = [ + 'create_uni_loan' + ] + 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_uni_loan" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'create_uni_loan' is set + if self.api_client.client_side_validation and ('create_uni_loan' not in local_var_params or # noqa: E501 + local_var_params['create_uni_loan'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `create_uni_loan` when calling `create_uni_loan`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'create_uni_loan' in local_var_params: + body_params = local_var_params['create_uni_loan'] + # 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( + '/margin/uni/loans', '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_uni_loan_records(self, **kwargs): # noqa: E501 + """Query loan 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_uni_loan_records(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str type: Type: `borrow` - borrow, `repay` - repay + :param str currency: Query by specified currency name + :param str currency_pair: Currency pair + :param int page: Page number + :param int limit: Maximum number of items returned. Default: 100, minimum: 1, 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: list[gate_api.UniLoanRecord] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_uni_loan_records_with_http_info(**kwargs) # noqa: E501 + + def list_uni_loan_records_with_http_info(self, **kwargs): # noqa: E501 + """Query loan 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_uni_loan_records_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str type: Type: `borrow` - borrow, `repay` - repay + :param str currency: Query by specified currency name + :param str currency_pair: Currency pair + :param int page: Page number + :param int limit: Maximum number of items returned. Default: 100, minimum: 1, 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(list[gate_api.UniLoanRecord], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'type', + 'currency', + 'currency_pair', + '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_uni_loan_records" % 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_uni_loan_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'] > 100: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `list_uni_loan_records`, 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_uni_loan_records`, 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 '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 '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 '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( + '/margin/uni/loan_records', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[UniLoanRecord]', # 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_uni_loan_interest_records(self, **kwargs): # noqa: E501 + """Query interest deduction 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_uni_loan_interest_records(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency_pair: Currency pair + :param str currency: Query by specified currency name + :param int page: Page number + :param int limit: Maximum number of records returned in a single list + :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 _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.UniLoanInterestRecord] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_uni_loan_interest_records_with_http_info(**kwargs) # noqa: E501 + + def list_uni_loan_interest_records_with_http_info(self, **kwargs): # noqa: E501 + """Query interest deduction 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_uni_loan_interest_records_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency_pair: Currency pair + :param str currency: Query by specified currency name + :param int page: Page number + :param int limit: Maximum number of records returned in a single list + :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 _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.UniLoanInterestRecord], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'currency_pair', + 'currency', + 'page', + 'limit', + '_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_uni_loan_interest_records" % 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_uni_loan_interest_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_uni_loan_interest_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_uni_loan_interest_records`, 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 '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 '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 + + 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( + '/margin/uni/interest_records', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[UniLoanInterestRecord]', # 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_uni_borrowable(self, currency, currency_pair, **kwargs): # noqa: E501 + """Query maximum borrowable amount by currency # 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_uni_borrowable(currency, currency_pair, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency: Query by specified currency name (required) + :param str currency_pair: Currency 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.MaxUniBorrowable + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_uni_borrowable_with_http_info(currency, currency_pair, **kwargs) # noqa: E501 + + def get_uni_borrowable_with_http_info(self, currency, currency_pair, **kwargs): # noqa: E501 + """Query maximum borrowable amount by currency # 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_uni_borrowable_with_http_info(currency, currency_pair, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency: Query by specified currency name (required) + :param str currency_pair: Currency 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.MaxUniBorrowable, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'currency', + '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 get_uni_borrowable" % k + ) + 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 `get_uni_borrowable`") # noqa: E501 + # verify the required parameter 'currency_pair' is set + if self.api_client.client_side_validation and ('currency_pair' not in local_var_params or # noqa: E501 + local_var_params['currency_pair'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `currency_pair` when calling `get_uni_borrowable`") # 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 '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( + '/margin/uni/borrowable', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='MaxUniBorrowable', # 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/multi_collateral_loan_api.py b/gate_api/api/multi_collateral_loan_api.py new file mode 100644 index 0000000..4578f3f --- /dev/null +++ b/gate_api/api/multi_collateral_loan_api.py @@ -0,0 +1,1461 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market 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 MultiCollateralLoanApi(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_multi_collateral_orders(self, **kwargs): # noqa: E501 + """Query multi-currency collateral 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_multi_collateral_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 sort: Sort type: `time_desc` - Created time descending (default), `ltv_asc` - Collateral ratio ascending, `ltv_desc` - Collateral ratio descending. + :param str order_type: Order type: current - Query current orders, fixed - Query fixed orders, defaults to current orders if not 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: list[gate_api.MultiCollateralOrder] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_multi_collateral_orders_with_http_info(**kwargs) # noqa: E501 + + def list_multi_collateral_orders_with_http_info(self, **kwargs): # noqa: E501 + """Query multi-currency collateral 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_multi_collateral_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 sort: Sort type: `time_desc` - Created time descending (default), `ltv_asc` - Collateral ratio ascending, `ltv_desc` - Collateral ratio descending. + :param str order_type: Order type: current - Query current orders, fixed - Query fixed orders, defaults to current orders 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 + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.MultiCollateralOrder], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'page', + 'limit', + 'sort', + 'order_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_multi_collateral_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_multi_collateral_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'] > 100: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `list_multi_collateral_orders`, 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_multi_collateral_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 '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 '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 + + 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( + '/loan/multi_collateral/orders', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[MultiCollateralOrder]', # 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_multi_collateral(self, create_multi_collateral_order, **kwargs): # noqa: E501 + """Place multi-currency collateral 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_multi_collateral(create_multi_collateral_order, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param CreateMultiCollateralOrder create_multi_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_multi_collateral_with_http_info(create_multi_collateral_order, **kwargs) # noqa: E501 + + def create_multi_collateral_with_http_info(self, create_multi_collateral_order, **kwargs): # noqa: E501 + """Place multi-currency collateral 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_multi_collateral_with_http_info(create_multi_collateral_order, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param CreateMultiCollateralOrder create_multi_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_multi_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_multi_collateral" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'create_multi_collateral_order' is set + if self.api_client.client_side_validation and ('create_multi_collateral_order' not in local_var_params or # noqa: E501 + local_var_params['create_multi_collateral_order'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `create_multi_collateral_order` when calling `create_multi_collateral`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'create_multi_collateral_order' in local_var_params: + body_params = local_var_params['create_multi_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/multi_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_multi_collateral_order_detail(self, order_id, **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.get_multi_collateral_order_detail(order_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str order_id: Order 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. + :param _request_timeout: timeout setting for 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.MultiCollateralOrder + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_multi_collateral_order_detail_with_http_info(order_id, **kwargs) # noqa: E501 + + def get_multi_collateral_order_detail_with_http_info(self, order_id, **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.get_multi_collateral_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 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 + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.MultiCollateralOrder, 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_multi_collateral_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_multi_collateral_order_detail`") # 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( + '/loan/multi_collateral/orders/{order_id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='MultiCollateralOrder', # 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_multi_repay_records(self, type, **kwargs): # noqa: E501 + """Query multi-currency collateral repayment 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_multi_repay_records(type, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str type: Operation type: repay - Regular repayment, liquidate - Liquidation (required) + :param str borrow_currency: Borrowed currency + :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. + :param _request_timeout: timeout setting for 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.MultiRepayRecord] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_multi_repay_records_with_http_info(type, **kwargs) # noqa: E501 + + def list_multi_repay_records_with_http_info(self, type, **kwargs): # noqa: E501 + """Query multi-currency collateral repayment 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_multi_repay_records_with_http_info(type, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str type: Operation type: repay - Regular repayment, liquidate - Liquidation (required) + :param str borrow_currency: Borrowed currency + :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 + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.MultiRepayRecord], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'type', + 'borrow_currency', + 'page', + 'limit', + '_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_multi_repay_records" % 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_multi_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_multi_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'] > 100: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `list_multi_repay_records`, 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_multi_repay_records`, 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 '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 '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 + + 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( + '/loan/multi_collateral/repay', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[MultiRepayRecord]', # 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 repay_multi_collateral_loan(self, repay_multi_loan, **kwargs): # noqa: E501 + """Multi-currency collateral repayment # 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_multi_collateral_loan(repay_multi_loan, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param RepayMultiLoan repay_multi_loan: (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.MultiRepayResp + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.repay_multi_collateral_loan_with_http_info(repay_multi_loan, **kwargs) # noqa: E501 + + def repay_multi_collateral_loan_with_http_info(self, repay_multi_loan, **kwargs): # noqa: E501 + """Multi-currency collateral repayment # 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_multi_collateral_loan_with_http_info(repay_multi_loan, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param RepayMultiLoan repay_multi_loan: (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.MultiRepayResp, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'repay_multi_loan' + ] + 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 repay_multi_collateral_loan" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'repay_multi_loan' is set + if self.api_client.client_side_validation and ('repay_multi_loan' not in local_var_params or # noqa: E501 + local_var_params['repay_multi_loan'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `repay_multi_loan` when calling `repay_multi_collateral_loan`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'repay_multi_loan' in local_var_params: + body_params = local_var_params['repay_multi_loan'] + # 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/multi_collateral/repay', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='MultiRepayResp', # 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_multi_collateral_records(self, **kwargs): # noqa: E501 + """Query collateral adjustment 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_multi_collateral_records(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 collateral_currency: Collateral currency + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.MultiCollateralRecord] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_multi_collateral_records_with_http_info(**kwargs) # noqa: E501 + + def list_multi_collateral_records_with_http_info(self, **kwargs): # noqa: E501 + """Query collateral adjustment 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_multi_collateral_records_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 int _from: Start timestamp for the query + :param int to: End timestamp for the query, defaults to current time if not specified + :param str collateral_currency: Collateral currency + :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.MultiCollateralRecord], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'page', + 'limit', + '_from', + 'to', + 'collateral_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_multi_collateral_records" % 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_multi_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'] > 100: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `list_multi_collateral_records`, 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_multi_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 '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 = {} + + 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( + '/loan/multi_collateral/mortgage', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[MultiCollateralRecord]', # 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 operate_multi_collateral(self, collateral_adjust, **kwargs): # noqa: E501 + """Add or withdraw collateral # 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_multi_collateral(collateral_adjust, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param CollateralAdjust collateral_adjust: (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.CollateralAdjustRes + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.operate_multi_collateral_with_http_info(collateral_adjust, **kwargs) # noqa: E501 + + def operate_multi_collateral_with_http_info(self, collateral_adjust, **kwargs): # noqa: E501 + """Add or withdraw collateral # 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_multi_collateral_with_http_info(collateral_adjust, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param CollateralAdjust collateral_adjust: (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.CollateralAdjustRes, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'collateral_adjust' + ] + 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 operate_multi_collateral" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'collateral_adjust' is set + if self.api_client.client_side_validation and ('collateral_adjust' not in local_var_params or # noqa: E501 + local_var_params['collateral_adjust'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `collateral_adjust` when calling `operate_multi_collateral`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'collateral_adjust' in local_var_params: + body_params = local_var_params['collateral_adjust'] + # 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/multi_collateral/mortgage', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CollateralAdjustRes', # 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_user_currency_quota(self, type, currency, **kwargs): # noqa: E501 + """Query user's collateral and borrowing currency quota 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_user_currency_quota(type, currency, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str type: Currency type: collateral - Collateral currency, borrow - Borrowing currency (required) + :param str currency: When it is a collateral currency, multiple currencies can be provided separated by commas; when it is a borrowing currency, only one currency can be provided. (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.CurrencyQuota] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_user_currency_quota_with_http_info(type, currency, **kwargs) # noqa: E501 + + def list_user_currency_quota_with_http_info(self, type, currency, **kwargs): # noqa: E501 + """Query user's collateral and borrowing currency quota 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_user_currency_quota_with_http_info(type, currency, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str type: Currency type: collateral - Collateral currency, borrow - Borrowing currency (required) + :param str currency: When it is a collateral currency, multiple currencies can be provided separated by commas; when it is a borrowing currency, only one currency can be provided. (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.CurrencyQuota], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'type', + '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_user_currency_quota" % 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_user_currency_quota`") # noqa: E501 + # 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_user_currency_quota`") # 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 '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( + '/loan/multi_collateral/currency_quota', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[CurrencyQuota]', # 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_multi_collateral_currencies(self, **kwargs): # noqa: E501 + """Query supported borrowing and collateral currencies for 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 + >>> thread = api.list_multi_collateral_currencies(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.MultiCollateralCurrency + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + 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 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_multi_collateral_currencies_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.MultiCollateralCurrency, 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_multi_collateral_currencies" % 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( + '/loan/multi_collateral/currencies', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='MultiCollateralCurrency', # 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_multi_collateral_ltv(self, **kwargs): # noqa: E501 + """Query collateralization ratio information # noqa: E501 + + Multi-currency collateral ratio is fixed, independent of currency # 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_multi_collateral_ltv(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.CollateralLtv + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_multi_collateral_ltv_with_http_info(**kwargs) # noqa: E501 + + def get_multi_collateral_ltv_with_http_info(self, **kwargs): # noqa: E501 + """Query collateralization ratio information # noqa: E501 + + Multi-currency collateral ratio is fixed, independent of currency # 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_multi_collateral_ltv_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.CollateralLtv, 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_multi_collateral_ltv" % 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( + '/loan/multi_collateral/ltv', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CollateralLtv', # 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_multi_collateral_fix_rate(self, **kwargs): # noqa: E501 + """Query currency's 7-day and 30-day fixed interest 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.get_multi_collateral_fix_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: list[gate_api.CollateralFixRate] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_multi_collateral_fix_rate_with_http_info(**kwargs) # noqa: E501 + + def get_multi_collateral_fix_rate_with_http_info(self, **kwargs): # noqa: E501 + """Query currency's 7-day and 30-day fixed interest 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.get_multi_collateral_fix_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(list[gate_api.CollateralFixRate], 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_multi_collateral_fix_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( + '/loan/multi_collateral/fixed_rate', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[CollateralFixRate]', # 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_multi_collateral_current_rate(self, currencies, **kwargs): # noqa: E501 + """Query currency's current interest rate # noqa: E501 + + Query currency's current interest rate for the previous hour, current interest rate updates hourly # 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_multi_collateral_current_rate(currencies, async_req=True) + >>> 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 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 + data. Default is True. + :param _request_timeout: timeout setting for 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.CollateralCurrentRate] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_multi_collateral_current_rate_with_http_info(currencies, **kwargs) # noqa: E501 + + def get_multi_collateral_current_rate_with_http_info(self, currencies, **kwargs): # noqa: E501 + """Query currency's current interest rate # noqa: E501 + + Query currency's current interest rate for the previous hour, current interest rate updates hourly # 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_multi_collateral_current_rate_with_http_info(currencies, async_req=True) + >>> 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 str vip_level: VIP level, defaults to 0 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 + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.CollateralCurrentRate], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'currencies', + 'vip_level' + ] + 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_multi_collateral_current_rate" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'currencies' is set + if self.api_client.client_side_validation and ('currencies' not in local_var_params or # noqa: E501 + local_var_params['currencies'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `currencies` when calling `get_multi_collateral_current_rate`") # noqa: E501 + + if self.api_client.client_side_validation and ('currencies' in local_var_params and # noqa: E501 + len(local_var_params['currencies']) > 100): # noqa: E501 + raise ApiValueError("Invalid value for parameter `currencies` when calling `get_multi_collateral_current_rate`, number of items must be less than or equal to `100`") # noqa: E501 + if self.api_client.client_side_validation and ('currencies' in local_var_params and # noqa: E501 + len(local_var_params['currencies']) < 1): # noqa: E501 + raise ApiValueError("Invalid value for parameter `currencies` when calling `get_multi_collateral_current_rate`, number of items must be greater than or equal to `1`") # noqa: E501 + collection_formats = {} + + path_params = {} + + query_params = [] + if 'currencies' in local_var_params and local_var_params['currencies'] is not None: # noqa: E501 + query_params.append(('currencies', local_var_params['currencies'])) # noqa: E501 + collection_formats['currencies'] = 'multi' # noqa: E501 + if 'vip_level' in local_var_params and local_var_params['vip_level'] is not None: # noqa: E501 + query_params.append(('vip_level', local_var_params['vip_level'])) # 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( + '/loan/multi_collateral/current_rate', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[CollateralCurrentRate]', # 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/options_api.py b/gate_api/api/options_api.py new file mode 100644 index 0000000..3c6fd4a --- /dev/null +++ b/gate_api/api/options_api.py @@ -0,0 +1,3441 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market 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 OptionsApi(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_options_underlyings(self, **kwargs): # noqa: E501 + """List all underlying 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_options_underlyings(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.OptionsUnderlying] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_options_underlyings_with_http_info(**kwargs) # noqa: E501 + + def list_options_underlyings_with_http_info(self, **kwargs): # noqa: E501 + """List all underlying 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_options_underlyings_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.OptionsUnderlying], 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_options_underlyings" % 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( + '/options/underlyings', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[OptionsUnderlying]', # 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_options_expirations(self, underlying, **kwargs): # noqa: E501 + """List all expiration dates # 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_options_expirations(underlying, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str underlying: Underlying (Obtained by listing underlying 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: list[int] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_options_expirations_with_http_info(underlying, **kwargs) # noqa: E501 + + def list_options_expirations_with_http_info(self, underlying, **kwargs): # noqa: E501 + """List all expiration dates # 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_options_expirations_with_http_info(underlying, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str underlying: Underlying (Obtained by listing underlying 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(list[int], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'underlying' + ] + 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_options_expirations" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'underlying' is set + if self.api_client.client_side_validation and ('underlying' not in local_var_params or # noqa: E501 + local_var_params['underlying'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `underlying` when calling `list_options_expirations`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'underlying' in local_var_params and local_var_params['underlying'] is not None: # noqa: E501 + query_params.append(('underlying', local_var_params['underlying'])) # 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( + '/options/expirations', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[int]', # 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_options_contracts(self, underlying, **kwargs): # noqa: E501 + """List all contracts for specified underlying and expiration date # 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_options_contracts(underlying, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str underlying: Underlying (Obtained by listing underlying endpoint) (required) + :param int expiration: Unix timestamp of expiration date + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.OptionsContract] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_options_contracts_with_http_info(underlying, **kwargs) # noqa: E501 + + def list_options_contracts_with_http_info(self, underlying, **kwargs): # noqa: E501 + """List all contracts for specified underlying and expiration date # 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_options_contracts_with_http_info(underlying, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str underlying: Underlying (Obtained by listing underlying endpoint) (required) + :param int expiration: Unix timestamp of expiration date + :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.OptionsContract], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'underlying', + 'expiration' + ] + 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_options_contracts" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'underlying' is set + if self.api_client.client_side_validation and ('underlying' not in local_var_params or # noqa: E501 + local_var_params['underlying'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `underlying` when calling `list_options_contracts`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'underlying' in local_var_params and local_var_params['underlying'] is not None: # noqa: E501 + query_params.append(('underlying', local_var_params['underlying'])) # noqa: E501 + if 'expiration' in local_var_params and local_var_params['expiration'] is not None: # noqa: E501 + query_params.append(('expiration', local_var_params['expiration'])) # 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( + '/options/contracts', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[OptionsContract]', # 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_options_contract(self, contract, **kwargs): # noqa: E501 + """Query specified contract 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_options_contract(contract, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str contract: (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.OptionsContract + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_options_contract_with_http_info(contract, **kwargs) # noqa: E501 + + def get_options_contract_with_http_info(self, contract, **kwargs): # noqa: E501 + """Query specified contract 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_options_contract_with_http_info(contract, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str 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 + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.OptionsContract, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'contract' + ] + 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_options_contract" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # 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_options_contract`") # noqa: E501 + + collection_formats = {} + + path_params = {} + 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 = [] # noqa: E501 + + return self.api_client.call_api( + '/options/contracts/{contract}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OptionsContract', # 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_options_settlements(self, underlying, **kwargs): # noqa: E501 + """List settlement 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_options_settlements(underlying, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str underlying: Underlying (Obtained by listing underlying endpoint) (required) + :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 _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.OptionsSettlement] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_options_settlements_with_http_info(underlying, **kwargs) # noqa: E501 + + def list_options_settlements_with_http_info(self, underlying, **kwargs): # noqa: E501 + """List settlement 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_options_settlements_with_http_info(underlying, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str underlying: Underlying (Obtained by listing underlying endpoint) (required) + :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 _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.OptionsSettlement], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'underlying', + 'limit', + 'offset', + '_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_options_settlements" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'underlying' is set + if self.api_client.client_side_validation and ('underlying' not in local_var_params or # noqa: E501 + local_var_params['underlying'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `underlying` when calling `list_options_settlements`") # 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_options_settlements`, 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_options_settlements`, 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_options_settlements`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} + + path_params = {} + + query_params = [] + if 'underlying' in local_var_params and local_var_params['underlying'] is not None: # noqa: E501 + query_params.append(('underlying', local_var_params['underlying'])) # 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 + + 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( + '/options/settlements', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[OptionsSettlement]', # 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_options_settlement(self, contract, underlying, at, **kwargs): # noqa: E501 + """Get specified contract settlement 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.get_options_settlement(contract, underlying, at, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str contract: (required) + :param str underlying: Underlying (Obtained by listing underlying endpoint) (required) + :param int at: (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.OptionsSettlement + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_options_settlement_with_http_info(contract, underlying, at, **kwargs) # noqa: E501 + + def get_options_settlement_with_http_info(self, contract, underlying, at, **kwargs): # noqa: E501 + """Get specified contract settlement 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.get_options_settlement_with_http_info(contract, underlying, at, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str contract: (required) + :param str underlying: Underlying (Obtained by listing underlying endpoint) (required) + :param int at: (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.OptionsSettlement, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'contract', + 'underlying', + '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 get_options_settlement" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # 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_options_settlement`") # noqa: E501 + # verify the required parameter 'underlying' is set + if self.api_client.client_side_validation and ('underlying' not in local_var_params or # noqa: E501 + local_var_params['underlying'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `underlying` when calling `get_options_settlement`") # noqa: E501 + # verify the required parameter 'at' is set + if self.api_client.client_side_validation and ('at' not in local_var_params or # noqa: E501 + local_var_params['at'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `at` when calling `get_options_settlement`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'contract' in local_var_params: + path_params['contract'] = local_var_params['contract'] # noqa: E501 + + query_params = [] + if 'underlying' in local_var_params and local_var_params['underlying'] is not None: # noqa: E501 + query_params.append(('underlying', local_var_params['underlying'])) # 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 = [] # noqa: E501 + + return self.api_client.call_api( + '/options/settlements/{contract}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OptionsSettlement', # 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_my_options_settlements(self, underlying, **kwargs): # noqa: E501 + """Query personal settlement 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_my_options_settlements(underlying, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str underlying: Underlying (Obtained by listing underlying endpoint) (required) + :param str contract: Options contract name + :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 _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.OptionsMySettlements] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_my_options_settlements_with_http_info(underlying, **kwargs) # noqa: E501 + + def list_my_options_settlements_with_http_info(self, underlying, **kwargs): # noqa: E501 + """Query personal settlement 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_my_options_settlements_with_http_info(underlying, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str underlying: Underlying (Obtained by listing underlying endpoint) (required) + :param str contract: Options contract name + :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 _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.OptionsMySettlements], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'underlying', + 'contract', + 'limit', + 'offset', + '_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_my_options_settlements" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'underlying' is set + if self.api_client.client_side_validation and ('underlying' not in local_var_params or # noqa: E501 + local_var_params['underlying'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `underlying` when calling `list_my_options_settlements`") # 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_my_options_settlements`, 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_my_options_settlements`, 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_my_options_settlements`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} + + path_params = {} + + query_params = [] + if 'underlying' in local_var_params and local_var_params['underlying'] is not None: # noqa: E501 + query_params.append(('underlying', local_var_params['underlying'])) # 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 '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 + + 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( + '/options/my_settlements', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[OptionsMySettlements]', # 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_options_order_book(self, contract, **kwargs): # noqa: E501 + """Query options contract order book # noqa: E501 + + Bids will be sorted by price from high to low, while asks sorted reversely # 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_options_order_book(contract, async_req=True) + >>> result = thread.get() + + :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 int limit: Number of depth levels + :param bool with_id: Whether to return depth update ID. This ID increments by 1 each time depth changes + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.FuturesOrderBook + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_options_order_book_with_http_info(contract, **kwargs) # noqa: E501 + + def list_options_order_book_with_http_info(self, contract, **kwargs): # noqa: E501 + """Query options contract order book # noqa: E501 + + Bids will be sorted by price from high to low, while asks sorted reversely # 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_options_order_book_with_http_info(contract, async_req=True) + >>> result = thread.get() + + :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 int limit: Number of depth levels + :param bool with_id: Whether to return depth update ID. This ID increments by 1 each time depth changes + :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.FuturesOrderBook, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'contract', + 'interval', + 'limit', + 'with_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_options_order_book" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # 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 `list_options_order_book`") # noqa: E501 + + 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_options_order_book`, 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_options_order_book`, must be a value greater than or equal to `1`") # noqa: E501 + collection_formats = {} + + path_params = {} + + 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 'interval' in local_var_params and local_var_params['interval'] is not None: # noqa: E501 + query_params.append(('interval', local_var_params['interval'])) # 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 'with_id' in local_var_params and local_var_params['with_id'] is not None: # noqa: E501 + query_params.append(('with_id', local_var_params['with_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 = [] # noqa: E501 + + return self.api_client.call_api( + '/options/order_book', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='FuturesOrderBook', # 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_options_tickers(self, underlying, **kwargs): # noqa: E501 + """Query options market ticker 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_options_tickers(underlying, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str underlying: Underlying (Obtained by listing underlying 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: list[gate_api.OptionsTicker] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_options_tickers_with_http_info(underlying, **kwargs) # noqa: E501 + + def list_options_tickers_with_http_info(self, underlying, **kwargs): # noqa: E501 + """Query options market ticker 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_options_tickers_with_http_info(underlying, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str underlying: Underlying (Obtained by listing underlying 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(list[gate_api.OptionsTicker], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'underlying' + ] + 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_options_tickers" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'underlying' is set + if self.api_client.client_side_validation and ('underlying' not in local_var_params or # noqa: E501 + local_var_params['underlying'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `underlying` when calling `list_options_tickers`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'underlying' in local_var_params and local_var_params['underlying'] is not None: # noqa: E501 + query_params.append(('underlying', local_var_params['underlying'])) # 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( + '/options/tickers', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[OptionsTicker]', # 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_options_underlying_tickers(self, underlying, **kwargs): # noqa: E501 + """Query underlying ticker 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_options_underlying_tickers(underlying, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str underlying: Underlying (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.OptionsUnderlyingTicker + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_options_underlying_tickers_with_http_info(underlying, **kwargs) # noqa: E501 + + def list_options_underlying_tickers_with_http_info(self, underlying, **kwargs): # noqa: E501 + """Query underlying ticker 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_options_underlying_tickers_with_http_info(underlying, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str underlying: Underlying (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.OptionsUnderlyingTicker, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'underlying' + ] + 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_options_underlying_tickers" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'underlying' is set + if self.api_client.client_side_validation and ('underlying' not in local_var_params or # noqa: E501 + local_var_params['underlying'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `underlying` when calling `list_options_underlying_tickers`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'underlying' in local_var_params: + path_params['underlying'] = local_var_params['underlying'] # 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( + '/options/underlying/tickers/{underlying}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OptionsUnderlyingTicker', # 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_options_candlesticks(self, contract, **kwargs): # noqa: E501 + """Options contract market candlestick chart # 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_options_candlesticks(contract, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str contract: Options contract name (required) + :param int limit: Maximum number of records returned in a single list + :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 interval: Time interval between data points + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.OptionsCandlestick] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_options_candlesticks_with_http_info(contract, **kwargs) # noqa: E501 + + def list_options_candlesticks_with_http_info(self, contract, **kwargs): # noqa: E501 + """Options contract market candlestick chart # 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_options_candlesticks_with_http_info(contract, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str contract: Options contract name (required) + :param int limit: Maximum number of records returned in a single list + :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 interval: Time interval between data points + :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.OptionsCandlestick], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'contract', + 'limit', + '_from', + 'to', + 'interval' + ] + 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_options_candlesticks" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # 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 `list_options_candlesticks`") # 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_options_candlesticks`, 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_options_candlesticks`, must be a value greater than or equal to `1`") # noqa: E501 + collection_formats = {} + + path_params = {} + + 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 '_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 'interval' in local_var_params and local_var_params['interval'] is not None: # noqa: E501 + query_params.append(('interval', local_var_params['interval'])) # 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( + '/options/candlesticks', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[OptionsCandlestick]', # 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_options_underlying_candlesticks(self, underlying, **kwargs): # noqa: E501 + """Underlying index price candlestick chart # 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_options_underlying_candlesticks(underlying, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str underlying: Underlying (Obtained by listing underlying endpoint) (required) + :param int limit: Maximum number of records returned in a single list + :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 interval: Time interval between data points + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.FuturesCandlestick] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_options_underlying_candlesticks_with_http_info(underlying, **kwargs) # noqa: E501 + + def list_options_underlying_candlesticks_with_http_info(self, underlying, **kwargs): # noqa: E501 + """Underlying index price candlestick chart # 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_options_underlying_candlesticks_with_http_info(underlying, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str underlying: Underlying (Obtained by listing underlying endpoint) (required) + :param int limit: Maximum number of records returned in a single list + :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 interval: Time interval between data points + :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.FuturesCandlestick], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'underlying', + 'limit', + '_from', + 'to', + 'interval' + ] + 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_options_underlying_candlesticks" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'underlying' is set + if self.api_client.client_side_validation and ('underlying' not in local_var_params or # noqa: E501 + local_var_params['underlying'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `underlying` when calling `list_options_underlying_candlesticks`") # 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_options_underlying_candlesticks`, 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_options_underlying_candlesticks`, must be a value greater than or equal to `1`") # noqa: E501 + collection_formats = {} + + path_params = {} + + query_params = [] + if 'underlying' in local_var_params and local_var_params['underlying'] is not None: # noqa: E501 + query_params.append(('underlying', local_var_params['underlying'])) # 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 'interval' in local_var_params and local_var_params['interval'] is not None: # noqa: E501 + query_params.append(('interval', local_var_params['interval'])) # 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( + '/options/underlying/candlesticks', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[FuturesCandlestick]', # 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_options_trades(self, **kwargs): # noqa: E501 + """Market trade 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_options_trades(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str contract: Options contract name + :param str type: `C` for call, `P` for put + :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 _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.FuturesTrade] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_options_trades_with_http_info(**kwargs) # noqa: E501 + + def list_options_trades_with_http_info(self, **kwargs): # noqa: E501 + """Market trade 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_options_trades_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str contract: Options contract name + :param str type: `C` for call, `P` for put + :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 _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.FuturesTrade], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'contract', + 'type', + 'limit', + 'offset', + '_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_options_trades" % 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'] > 1000: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `list_options_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 `list_options_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 `list_options_trades`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} + + path_params = {} + + 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 '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 '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 + + 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( + '/options/trades', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[FuturesTrade]', # 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_options_account(self, **kwargs): # noqa: E501 + """Query 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.list_options_account(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.OptionsAccount + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_options_account_with_http_info(**kwargs) # noqa: E501 + + def list_options_account_with_http_info(self, **kwargs): # noqa: E501 + """Query 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.list_options_account_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.OptionsAccount, 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_options_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 + # 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( + '/options/accounts', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OptionsAccount', # 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_options_account_book(self, **kwargs): # noqa: E501 + """Query account change 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_options_account_book(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :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 type: Change types: - dnw: Deposit & Withdrawal - prem: Trading premium - fee: Trading fee - refr: Referrer rebate - set: Settlement P&L + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.OptionsAccountBook] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_options_account_book_with_http_info(**kwargs) # noqa: E501 + + def list_options_account_book_with_http_info(self, **kwargs): # noqa: E501 + """Query account change 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_options_account_book_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :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 type: Change types: - dnw: Deposit & Withdrawal - prem: Trading premium - fee: Trading fee - refr: Referrer rebate - set: Settlement P&L + :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.OptionsAccountBook], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'limit', + 'offset', + '_from', + 'to', + '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_options_account_book" % 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'] > 1000: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `list_options_account_book`, 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_options_account_book`, 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_options_account_book`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} + + path_params = {} + + 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 + 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 + + 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( + '/options/account_book', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[OptionsAccountBook]', # 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_options_positions(self, **kwargs): # noqa: E501 + """List user's positions of specified underlying # 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_options_positions(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str underlying: Underlying + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.OptionsPosition] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_options_positions_with_http_info(**kwargs) # noqa: E501 + + def list_options_positions_with_http_info(self, **kwargs): # noqa: E501 + """List user's positions of specified underlying # 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_options_positions_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str underlying: Underlying + :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.OptionsPosition], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'underlying' + ] + 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_options_positions" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'underlying' in local_var_params and local_var_params['underlying'] is not None: # noqa: E501 + query_params.append(('underlying', local_var_params['underlying'])) # 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( + '/options/positions', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[OptionsPosition]', # 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_options_position(self, contract, **kwargs): # noqa: E501 + """Get specified contract 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.get_options_position(contract, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str contract: (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.OptionsPosition + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_options_position_with_http_info(contract, **kwargs) # noqa: E501 + + def get_options_position_with_http_info(self, contract, **kwargs): # noqa: E501 + """Get specified contract 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.get_options_position_with_http_info(contract, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str 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 + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.OptionsPosition, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'contract' + ] + 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_options_position" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # 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_options_position`") # noqa: E501 + + collection_formats = {} + + path_params = {} + 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( + '/options/positions/{contract}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OptionsPosition', # 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_options_position_close(self, underlying, **kwargs): # noqa: E501 + """List user's liquidation history of specified underlying # 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_options_position_close(underlying, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str underlying: Underlying (Obtained by listing underlying endpoint) (required) + :param str contract: Options contract 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.OptionsPositionClose] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_options_position_close_with_http_info(underlying, **kwargs) # noqa: E501 + + def list_options_position_close_with_http_info(self, underlying, **kwargs): # noqa: E501 + """List user's liquidation history of specified underlying # 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_options_position_close_with_http_info(underlying, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str underlying: Underlying (Obtained by listing underlying endpoint) (required) + :param str contract: Options contract 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.OptionsPositionClose], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'underlying', + 'contract' + ] + 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_options_position_close" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'underlying' is set + if self.api_client.client_side_validation and ('underlying' not in local_var_params or # noqa: E501 + local_var_params['underlying'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `underlying` when calling `list_options_position_close`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'underlying' in local_var_params and local_var_params['underlying'] is not None: # noqa: E501 + query_params.append(('underlying', local_var_params['underlying'])) # 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 + + 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( + '/options/position_close', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[OptionsPositionClose]', # 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_options_orders(self, status, **kwargs): # noqa: E501 + """List options 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_options_orders(status, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str status: Query order list based on status (required) + :param str contract: Options contract name + :param str underlying: Underlying + :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 _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.OptionsOrder] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_options_orders_with_http_info(status, **kwargs) # noqa: E501 + + def list_options_orders_with_http_info(self, status, **kwargs): # noqa: E501 + """List options 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_options_orders_with_http_info(status, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str status: Query order list based on status (required) + :param str contract: Options contract name + :param str underlying: Underlying + :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 _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.OptionsOrder], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'status', + 'contract', + 'underlying', + 'limit', + 'offset', + '_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_options_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_options_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_options_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_options_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_options_orders`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} + + path_params = {} + + 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 'underlying' in local_var_params and local_var_params['underlying'] is not None: # noqa: E501 + query_params.append(('underlying', local_var_params['underlying'])) # 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 '_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( + '/options/orders', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[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 create_options_order(self, options_order, **kwargs): # noqa: E501 + """Create an options 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_options_order(options_order, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param OptionsOrder options_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.OptionsOrder + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.create_options_order_with_http_info(options_order, **kwargs) # noqa: E501 + + def create_options_order_with_http_info(self, options_order, **kwargs): # noqa: E501 + """Create an options 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_options_order_with_http_info(options_order, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param OptionsOrder options_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.OptionsOrder, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'options_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_options_order" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'options_order' is set + if self.api_client.client_side_validation and ('options_order' not in local_var_params or # noqa: E501 + local_var_params['options_order'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `options_order` when calling `create_options_order`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'options_order' in local_var_params: + body_params = local_var_params['options_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( + '/options/orders', 'POST', + 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_orders(self, **kwargs): # noqa: E501 + """Cancel all orders with 'open' 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.cancel_options_orders(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str contract: Options contract name + :param str underlying: Underlying + :param str side: Specify all bids or all asks, both included if not 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: list[gate_api.OptionsOrder] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.cancel_options_orders_with_http_info(**kwargs) # noqa: E501 + + def cancel_options_orders_with_http_info(self, **kwargs): # noqa: E501 + """Cancel all orders with 'open' 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.cancel_options_orders_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str contract: Options contract name + :param str underlying: Underlying + :param str side: Specify all bids or all asks, both included 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 + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.OptionsOrder], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'contract', + 'underlying', + '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 cancel_options_orders" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + 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 'underlying' in local_var_params and local_var_params['underlying'] is not None: # noqa: E501 + query_params.append(('underlying', local_var_params['underlying'])) # 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( + '/options/orders', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[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 get_options_order(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_options_order(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 _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.get_options_order_with_http_info(order_id, **kwargs) # noqa: E501 + + def get_options_order_with_http_info(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_options_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 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 + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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' + ] + 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_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 `get_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 + # 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( + '/options/orders/{order_id}', 'GET', + 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 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.cancel_options_order(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 _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.cancel_options_order_with_http_info(order_id, **kwargs) # noqa: E501 + + def cancel_options_order_with_http_info(self, 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_options_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 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 + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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' + ] + 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_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 `cancel_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 + # 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( + '/options/orders/{order_id}', 'DELETE', + 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 countdown_cancel_all_options(self, countdown_cancel_all_options_task, **kwargs): # noqa: E501 + """Countdown cancel orders # noqa: E501 + + Option order heartbeat detection, when the `timeout` time set by the user is reached, if the existing countdown is not canceled or a new countdown is set, the related `option pending order` will be automatically canceled. This interface can be called repeatedly to set a new countdown or cancel the countdown. Usage example: Repeat this interface at intervals of 30 seconds, with each countdown `timeout` set to 30 (seconds). If this interface is not called again within 30 seconds, all pending orders on the `underlying` `contract` you specified will be automatically cancelled. If `underlying` `contract` is not specified, user will be automatically cancelled If `timeout` is set to 0 within 30 seconds, the countdown timer will expire and the automatic order cancellation function will be cancelled. # 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_options(countdown_cancel_all_options_task, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param CountdownCancelAllOptionsTask countdown_cancel_all_options_task: (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.TriggerTime + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.countdown_cancel_all_options_with_http_info(countdown_cancel_all_options_task, **kwargs) # noqa: E501 + + def countdown_cancel_all_options_with_http_info(self, countdown_cancel_all_options_task, **kwargs): # noqa: E501 + """Countdown cancel orders # noqa: E501 + + Option order heartbeat detection, when the `timeout` time set by the user is reached, if the existing countdown is not canceled or a new countdown is set, the related `option pending order` will be automatically canceled. This interface can be called repeatedly to set a new countdown or cancel the countdown. Usage example: Repeat this interface at intervals of 30 seconds, with each countdown `timeout` set to 30 (seconds). If this interface is not called again within 30 seconds, all pending orders on the `underlying` `contract` you specified will be automatically cancelled. If `underlying` `contract` is not specified, user will be automatically cancelled If `timeout` is set to 0 within 30 seconds, the countdown timer will expire and the automatic order cancellation function will be cancelled. # 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_options_with_http_info(countdown_cancel_all_options_task, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param CountdownCancelAllOptionsTask countdown_cancel_all_options_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 + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.TriggerTime, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'countdown_cancel_all_options_task' + ] + 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 countdown_cancel_all_options" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'countdown_cancel_all_options_task' is set + if self.api_client.client_side_validation and ('countdown_cancel_all_options_task' not in local_var_params or # noqa: E501 + local_var_params['countdown_cancel_all_options_task'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `countdown_cancel_all_options_task` when calling `countdown_cancel_all_options`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'countdown_cancel_all_options_task' in local_var_params: + body_params = local_var_params['countdown_cancel_all_options_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( + '/options/countdown_cancel_all', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + 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 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_my_options_trades(self, underlying, **kwargs): # noqa: E501 + """Query personal trading 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_my_options_trades(underlying, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str underlying: Underlying (Obtained by listing underlying endpoint) (required) + :param str contract: Options contract name + :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 _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.OptionsMyTrade] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_my_options_trades_with_http_info(underlying, **kwargs) # noqa: E501 + + def list_my_options_trades_with_http_info(self, underlying, **kwargs): # noqa: E501 + """Query personal trading 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_my_options_trades_with_http_info(underlying, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str underlying: Underlying (Obtained by listing underlying endpoint) (required) + :param str contract: Options contract name + :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 _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.OptionsMyTrade], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'underlying', + 'contract', + 'limit', + 'offset', + '_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_my_options_trades" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'underlying' is set + if self.api_client.client_side_validation and ('underlying' not in local_var_params or # noqa: E501 + local_var_params['underlying'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `underlying` when calling `list_my_options_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 `list_my_options_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 `list_my_options_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 `list_my_options_trades`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} + + path_params = {} + + query_params = [] + if 'underlying' in local_var_params and local_var_params['underlying'] is not None: # noqa: E501 + query_params.append(('underlying', local_var_params['underlying'])) # 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 '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 + + 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( + '/options/my_trades', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[OptionsMyTrade]', # 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_options_mmp(self, **kwargs): # noqa: E501 + """MMP Query. # 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_options_mmp(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str underlying: Underlying + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.OptionsMMP] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_options_mmp_with_http_info(**kwargs) # noqa: E501 + + def get_options_mmp_with_http_info(self, **kwargs): # noqa: E501 + """MMP Query. # 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_options_mmp_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str underlying: Underlying + :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.OptionsMMP], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'underlying' + ] + 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_options_mmp" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'underlying' in local_var_params and local_var_params['underlying'] is not None: # noqa: E501 + query_params.append(('underlying', local_var_params['underlying'])) # 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( + '/options/mmp', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[OptionsMMP]', # 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_options_mmp(self, options_mmp, **kwargs): # noqa: E501 + """MMP Settings # 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_options_mmp(options_mmp, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param OptionsMMP options_mmp: (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.OptionsMMP + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.set_options_mmp_with_http_info(options_mmp, **kwargs) # noqa: E501 + + def set_options_mmp_with_http_info(self, options_mmp, **kwargs): # noqa: E501 + """MMP Settings # 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_options_mmp_with_http_info(options_mmp, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param OptionsMMP options_mmp: (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.OptionsMMP, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'options_mmp' + ] + 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_options_mmp" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'options_mmp' is set + if self.api_client.client_side_validation and ('options_mmp' not in local_var_params or # noqa: E501 + local_var_params['options_mmp'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `options_mmp` when calling `set_options_mmp`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'options_mmp' in local_var_params: + body_params = local_var_params['options_mmp'] + # 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/mmp', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OptionsMMP', # 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 reset_options_mmp(self, options_mmp_reset, **kwargs): # noqa: E501 + """MMP Reset # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.reset_options_mmp(options_mmp_reset, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param OptionsMMPReset options_mmp_reset: (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.OptionsMMP + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.reset_options_mmp_with_http_info(options_mmp_reset, **kwargs) # noqa: E501 + + def reset_options_mmp_with_http_info(self, options_mmp_reset, **kwargs): # noqa: E501 + """MMP Reset # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.reset_options_mmp_with_http_info(options_mmp_reset, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param OptionsMMPReset options_mmp_reset: (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.OptionsMMP, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'options_mmp_reset' + ] + 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 reset_options_mmp" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'options_mmp_reset' is set + if self.api_client.client_side_validation and ('options_mmp_reset' not in local_var_params or # noqa: E501 + local_var_params['options_mmp_reset'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `options_mmp_reset` when calling `reset_options_mmp`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'options_mmp_reset' in local_var_params: + body_params = local_var_params['options_mmp_reset'] + # 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/mmp/reset', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OptionsMMP', # 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 new file mode 100644 index 0000000..f04f15e --- /dev/null +++ b/gate_api/api/rebate_api.py @@ -0,0 +1,1221 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market 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 RebateApi(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 agency_transaction_history(self, **kwargs): # noqa: E501 + """Broker obtains transaction history of recommended users # noqa: E501 + + Record query time range cannot exceed 30 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.agency_transaction_history(async_req=True) + >>> result = thread.get() + + :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 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 + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.AgencyTransactionHistory] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.agency_transaction_history_with_http_info(**kwargs) # noqa: E501 + + def agency_transaction_history_with_http_info(self, **kwargs): # noqa: E501 + """Broker obtains transaction history of recommended users # noqa: E501 + + Record query time range cannot exceed 30 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.agency_transaction_history_with_http_info(async_req=True) + >>> result = thread.get() + + :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 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 + :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.AgencyTransactionHistory], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'currency_pair', + 'user_id', + '_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 agency_transaction_history" % 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'] > 1000: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `agency_transaction_history`, 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 `agency_transaction_history`, 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 `agency_transaction_history`, must be a value greater than or equal to `0`") # 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 'user_id' in local_var_params and local_var_params['user_id'] is not None: # noqa: E501 + query_params.append(('user_id', local_var_params['user_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 '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( + '/rebate/agency/transaction_history', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[AgencyTransactionHistory]', # 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 agency_commissions_history(self, **kwargs): # noqa: E501 + """Broker obtains rebate history of recommended users # noqa: E501 + + Record query time range cannot exceed 30 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.agency_commissions_history(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :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 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 + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.AgencyCommissionHistory] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.agency_commissions_history_with_http_info(**kwargs) # noqa: E501 + + def agency_commissions_history_with_http_info(self, **kwargs): # noqa: E501 + """Broker obtains rebate history of recommended users # noqa: E501 + + Record query time range cannot exceed 30 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.agency_commissions_history_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :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 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 + :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.AgencyCommissionHistory], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'currency', + 'commission_type', + 'user_id', + '_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 agency_commissions_history" % 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'] > 1000: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `agency_commissions_history`, 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 `agency_commissions_history`, 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 `agency_commissions_history`, must be a value greater than or equal to `0`") # 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 'commission_type' in local_var_params and local_var_params['commission_type'] is not None: # noqa: E501 + query_params.append(('commission_type', local_var_params['commission_type'])) # noqa: E501 + if 'user_id' in local_var_params and local_var_params['user_id'] is not None: # noqa: E501 + query_params.append(('user_id', local_var_params['user_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 '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( + '/rebate/agency/commission_history', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[AgencyCommissionHistory]', # 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 partner_transaction_history(self, **kwargs): # noqa: E501 + """Partner obtains transaction history of recommended users # noqa: E501 + + Record query time range cannot exceed 30 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.partner_transaction_history(async_req=True) + >>> result = thread.get() + + :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 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 + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.PartnerTransactionHistory + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.partner_transaction_history_with_http_info(**kwargs) # noqa: E501 + + def partner_transaction_history_with_http_info(self, **kwargs): # noqa: E501 + """Partner obtains transaction history of recommended users # noqa: E501 + + Record query time range cannot exceed 30 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.partner_transaction_history_with_http_info(async_req=True) + >>> result = thread.get() + + :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 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 + :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.PartnerTransactionHistory, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'currency_pair', + 'user_id', + '_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 partner_transaction_history" % 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'] > 1000: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `partner_transaction_history`, 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 `partner_transaction_history`, 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 `partner_transaction_history`, must be a value greater than or equal to `0`") # 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 'user_id' in local_var_params and local_var_params['user_id'] is not None: # noqa: E501 + query_params.append(('user_id', local_var_params['user_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 '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( + '/rebate/partner/transaction_history', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='PartnerTransactionHistory', # 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 partner_commissions_history(self, **kwargs): # noqa: E501 + """Partner obtains rebate records of recommended users # noqa: E501 + + Record query time range cannot exceed 30 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.partner_commissions_history(async_req=True) + >>> result = thread.get() + + :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 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 + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.PartnerCommissionHistory + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.partner_commissions_history_with_http_info(**kwargs) # noqa: E501 + + def partner_commissions_history_with_http_info(self, **kwargs): # noqa: E501 + """Partner obtains rebate records of recommended users # noqa: E501 + + Record query time range cannot exceed 30 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.partner_commissions_history_with_http_info(async_req=True) + >>> result = thread.get() + + :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 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 + :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.PartnerCommissionHistory, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'currency', + 'user_id', + '_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 partner_commissions_history" % 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'] > 1000: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `partner_commissions_history`, 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 `partner_commissions_history`, 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 `partner_commissions_history`, must be a value greater than or equal to `0`") # 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 'user_id' in local_var_params and local_var_params['user_id'] is not None: # noqa: E501 + query_params.append(('user_id', local_var_params['user_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 '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( + '/rebate/partner/commission_history', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='PartnerCommissionHistory', # 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 partner_sub_list(self, **kwargs): # noqa: E501 + """Partner subordinate list # noqa: E501 + + Including sub-agents, direct customers, and indirect customers # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.partner_sub_list(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int user_id: User ID. If not specified, all user records will be returned + :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: gate_api.PartnerSubList + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.partner_sub_list_with_http_info(**kwargs) # noqa: E501 + + def partner_sub_list_with_http_info(self, **kwargs): # noqa: E501 + """Partner subordinate list # noqa: E501 + + Including sub-agents, direct customers, and indirect customers # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.partner_sub_list_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int user_id: User ID. If not specified, all user records will be returned + :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(gate_api.PartnerSubList, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'user_id', + '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 partner_sub_list" % 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'] > 1000: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `partner_sub_list`, 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 `partner_sub_list`, 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 `partner_sub_list`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} + + path_params = {} + + query_params = [] + if 'user_id' in local_var_params and local_var_params['user_id'] is not None: # noqa: E501 + query_params.append(('user_id', local_var_params['user_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 '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( + '/rebate/partner/sub_list', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='PartnerSubList', # 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 rebate_broker_commission_history(self, **kwargs): # noqa: E501 + """Broker obtains user's rebate records # noqa: E501 + + Record query time range cannot exceed 30 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.rebate_broker_commission_history(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int limit: Maximum number of records returned in a single list + :param int offset: List offset, starting from 0 + :param int user_id: User ID. If not specified, all user records will be returned + :param int _from: Start time of the query record. If not specified, defaults to 30 days before the current time + :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. + :param _request_timeout: timeout setting for 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.BrokerCommission] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.rebate_broker_commission_history_with_http_info(**kwargs) # noqa: E501 + + def rebate_broker_commission_history_with_http_info(self, **kwargs): # noqa: E501 + """Broker obtains user's rebate records # noqa: E501 + + Record query time range cannot exceed 30 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.rebate_broker_commission_history_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int limit: Maximum number of records returned in a single list + :param int offset: List offset, starting from 0 + :param int user_id: User ID. If not specified, all user records will be returned + :param int _from: Start time of the query record. If not specified, defaults to 30 days before the current time + :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 + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.BrokerCommission], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'limit', + 'offset', + 'user_id', + '_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 rebate_broker_commission_history" % 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'] > 1000: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `rebate_broker_commission_history`, 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 `rebate_broker_commission_history`, 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 `rebate_broker_commission_history`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} + + path_params = {} + + 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 + if 'user_id' in local_var_params and local_var_params['user_id'] is not None: # noqa: E501 + query_params.append(('user_id', local_var_params['user_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 + + 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/broker/commission_history', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[BrokerCommission]', # 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 rebate_broker_transaction_history(self, **kwargs): # noqa: E501 + """Broker obtains user's trading history # noqa: E501 + + Record query time range cannot exceed 30 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.rebate_broker_transaction_history(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int limit: Maximum number of records returned in a single list + :param int offset: List offset, starting from 0 + :param int user_id: User ID. If not specified, all user records will be returned + :param int _from: Start time of the query record. If not specified, defaults to 30 days before the current time + :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. + :param _request_timeout: timeout setting for 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.BrokerTransaction] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.rebate_broker_transaction_history_with_http_info(**kwargs) # noqa: E501 + + def rebate_broker_transaction_history_with_http_info(self, **kwargs): # noqa: E501 + """Broker obtains user's trading history # noqa: E501 + + Record query time range cannot exceed 30 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.rebate_broker_transaction_history_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int limit: Maximum number of records returned in a single list + :param int offset: List offset, starting from 0 + :param int user_id: User ID. If not specified, all user records will be returned + :param int _from: Start time of the query record. If not specified, defaults to 30 days before the current time + :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 + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.BrokerTransaction], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'limit', + 'offset', + 'user_id', + '_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 rebate_broker_transaction_history" % 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'] > 1000: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `rebate_broker_transaction_history`, 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 `rebate_broker_transaction_history`, 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 `rebate_broker_transaction_history`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} + + path_params = {} + + 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 + if 'user_id' in local_var_params and local_var_params['user_id'] is not None: # noqa: E501 + query_params.append(('user_id', local_var_params['user_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 + + 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/broker/transaction_history', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[BrokerTransaction]', # 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 rebate_user_info(self, **kwargs): # noqa: E501 + """User obtains rebate 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.rebate_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: list[gate_api.RebateUserInfo] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.rebate_user_info_with_http_info(**kwargs) # noqa: E501 + + def rebate_user_info_with_http_info(self, **kwargs): # noqa: E501 + """User obtains rebate 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.rebate_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(list[gate_api.RebateUserInfo], 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 rebate_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( + '/rebate/user/info', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[RebateUserInfo]', # 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 user_sub_relation(self, user_id_list, **kwargs): # noqa: E501 + """User subordinate relationship # noqa: E501 + + Query whether the specified user is within the system # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.user_sub_relation(user_id_list, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str user_id_list: Query user ID list, separated by commas. If more than 100, only 100 will be returned (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.UserSubRelation + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.user_sub_relation_with_http_info(user_id_list, **kwargs) # noqa: E501 + + def user_sub_relation_with_http_info(self, user_id_list, **kwargs): # noqa: E501 + """User subordinate relationship # noqa: E501 + + Query whether the specified user is within the system # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.user_sub_relation_with_http_info(user_id_list, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str user_id_list: Query user ID list, separated by commas. If more than 100, only 100 will be returned (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.UserSubRelation, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'user_id_list' + ] + 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 user_sub_relation" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'user_id_list' is set + if self.api_client.client_side_validation and ('user_id_list' not in local_var_params or # noqa: E501 + local_var_params['user_id_list'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `user_id_list` when calling `user_sub_relation`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'user_id_list' in local_var_params and local_var_params['user_id_list'] is not None: # noqa: E501 + query_params.append(('user_id_list', local_var_params['user_id_list'])) # 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/user/sub_relation', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='UserSubRelation', # 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 91e186c..1894742 100644 --- a/gate_api/api/spot_api.py +++ b/gate_api/api/spot_api.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -18,7 +18,10 @@ import six from gate_api.api_client import ApiClient -from gate_api.exceptions import ApiTypeError, ApiValueError # noqa: F401 +from gate_api.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) class SpotApi(object): @@ -34,8 +37,9 @@ def __init__(self, api_client=None): self.api_client = api_client def list_currencies(self, **kwargs): # noqa: E501 - """List all currencies' details # noqa: E501 + """Query all currency information # noqa: E501 + When a currency corresponds to multiple chains, you can query the information of multiple chains through the `chains` field, such as the charging and recharge status, identification, etc. of the chain # 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_currencies(async_req=True) @@ -57,8 +61,9 @@ def list_currencies(self, **kwargs): # noqa: E501 return self.list_currencies_with_http_info(**kwargs) # noqa: E501 def list_currencies_with_http_info(self, **kwargs): # noqa: E501 - """List all currencies' details # noqa: E501 + """Query all currency information # noqa: E501 + When a currency corresponds to multiple chains, you can query the information of multiple chains through the `chains` field, such as the charging and recharge status, identification, etc. of the chain # 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_currencies_with_http_info(async_req=True) @@ -81,12 +86,23 @@ def list_currencies_with_http_info(self, **kwargs): # noqa: E501 local_var_params = locals() - all_params = [] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + 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_currencies" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_currencies" % k + ) local_var_params[k] = v del local_var_params['kwargs'] @@ -103,14 +119,14 @@ def list_currencies_with_http_info(self, **kwargs): # noqa: E501 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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( - '/spot/currencies', - 'GET', + '/spot/currencies', 'GET', path_params, query_params, header_params, @@ -123,11 +139,10 @@ def list_currencies_with_http_info(self, **kwargs): # noqa: E501 _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, - ) + collection_formats=collection_formats) def get_currency(self, currency, **kwargs): # noqa: E501 - """Get details of a specific currency # noqa: E501 + """Query single currency information # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -151,7 +166,7 @@ def get_currency(self, currency, **kwargs): # noqa: E501 return self.get_currency_with_http_info(currency, **kwargs) # noqa: E501 def get_currency_with_http_info(self, currency, **kwargs): # noqa: E501 - """Get details of a specific currency # noqa: E501 + """Query single currency information # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -176,18 +191,29 @@ def get_currency_with_http_info(self, currency, **kwargs): # noqa: E501 local_var_params = locals() - all_params = ['currency'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + 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 get_currency" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_currency" % k + ) 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 local_var_params['currency'] is None # noqa: E501 - ): # noqa: E501 + 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 `get_currency`") # noqa: E501 collection_formats = {} @@ -205,14 +231,14 @@ def get_currency_with_http_info(self, currency, **kwargs): # noqa: E501 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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( - '/spot/currencies/{currency}', - 'GET', + '/spot/currencies/{currency}', 'GET', path_params, query_params, header_params, @@ -225,11 +251,10 @@ def get_currency_with_http_info(self, currency, **kwargs): # noqa: E501 _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, - ) + collection_formats=collection_formats) def list_currency_pairs(self, **kwargs): # noqa: E501 - """List all currency pairs supported # noqa: E501 + """Query all supported currency pairs # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -252,7 +277,7 @@ def list_currency_pairs(self, **kwargs): # noqa: E501 return self.list_currency_pairs_with_http_info(**kwargs) # noqa: E501 def list_currency_pairs_with_http_info(self, **kwargs): # noqa: E501 - """List all currency pairs supported # noqa: E501 + """Query all supported currency pairs # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -276,12 +301,23 @@ def list_currency_pairs_with_http_info(self, **kwargs): # noqa: E501 local_var_params = locals() - all_params = [] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + 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_currency_pairs" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_currency_pairs" % k + ) local_var_params[k] = v del local_var_params['kwargs'] @@ -298,14 +334,14 @@ def list_currency_pairs_with_http_info(self, **kwargs): # noqa: E501 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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( - '/spot/currency_pairs', - 'GET', + '/spot/currency_pairs', 'GET', path_params, query_params, header_params, @@ -318,11 +354,10 @@ def list_currency_pairs_with_http_info(self, **kwargs): # noqa: E501 _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, - ) + collection_formats=collection_formats) def get_currency_pair(self, currency_pair, **kwargs): # noqa: E501 - """Get details of a specifc order # noqa: E501 + """Query single currency pair details # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -346,7 +381,7 @@ def get_currency_pair(self, currency_pair, **kwargs): # noqa: E501 return self.get_currency_pair_with_http_info(currency_pair, **kwargs) # noqa: E501 def get_currency_pair_with_http_info(self, currency_pair, **kwargs): # noqa: E501 - """Get details of a specifc order # noqa: E501 + """Query single currency pair details # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -371,21 +406,30 @@ def get_currency_pair_with_http_info(self, currency_pair, **kwargs): # noqa: E5 local_var_params = locals() - all_params = ['currency_pair'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + 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 get_currency_pair" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_currency_pair" % k + ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'currency_pair' is set - if self.api_client.client_side_validation and ( - 'currency_pair' not in local_var_params or local_var_params['currency_pair'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `currency_pair` when calling `get_currency_pair`" - ) # noqa: E501 + if self.api_client.client_side_validation and ('currency_pair' not in local_var_params or # noqa: E501 + local_var_params['currency_pair'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `currency_pair` when calling `get_currency_pair`") # noqa: E501 collection_formats = {} @@ -402,14 +446,14 @@ def get_currency_pair_with_http_info(self, currency_pair, **kwargs): # noqa: E5 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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( - '/spot/currency_pairs/{currency_pair}', - 'GET', + '/spot/currency_pairs/{currency_pair}', 'GET', path_params, query_params, header_params, @@ -422,13 +466,12 @@ def get_currency_pair_with_http_info(self, currency_pair, **kwargs): # noqa: E5 _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, - ) + collection_formats=collection_formats) def list_tickers(self, **kwargs): # noqa: E501 - """Retrieve ticker information # noqa: E501 + """Get currency pair ticker information # noqa: E501 - Return only related data if `currency_pair` is specified; otherwise return all of them # noqa: E501 + If `currency_pair` is specified, only query that currency pair; otherwise return all 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_tickers(async_req=True) @@ -436,6 +479,7 @@ def list_tickers(self, **kwargs): # noqa: E501 :param bool async_req: execute request asynchronously :param str currency_pair: Currency pair + :param str timezone: Timezone :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -451,9 +495,9 @@ def list_tickers(self, **kwargs): # noqa: E501 return self.list_tickers_with_http_info(**kwargs) # noqa: E501 def list_tickers_with_http_info(self, **kwargs): # noqa: E501 - """Retrieve ticker information # noqa: E501 + """Get currency pair ticker information # noqa: E501 - Return only related data if `currency_pair` is specified; otherwise return all of them # noqa: E501 + If `currency_pair` is specified, only query that currency pair; otherwise return all 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_tickers_with_http_info(async_req=True) @@ -461,6 +505,7 @@ def list_tickers_with_http_info(self, **kwargs): # noqa: E501 :param bool async_req: execute request asynchronously :param str currency_pair: Currency pair + :param str timezone: Timezone :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -477,12 +522,25 @@ def list_tickers_with_http_info(self, **kwargs): # noqa: E501 local_var_params = locals() - all_params = ['currency_pair'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'currency_pair', + 'timezone' + ] + 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_tickers" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_tickers" % k + ) local_var_params[k] = v del local_var_params['kwargs'] @@ -493,6 +551,8 @@ def list_tickers_with_http_info(self, **kwargs): # noqa: E501 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 'timezone' in local_var_params and local_var_params['timezone'] is not None: # noqa: E501 + query_params.append(('timezone', local_var_params['timezone'])) # noqa: E501 header_params = {} @@ -501,14 +561,14 @@ def list_tickers_with_http_info(self, **kwargs): # noqa: E501 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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( - '/spot/tickers', - 'GET', + '/spot/tickers', 'GET', path_params, query_params, header_params, @@ -521,13 +581,12 @@ def list_tickers_with_http_info(self, **kwargs): # noqa: E501 _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, - ) + collection_formats=collection_formats) def list_order_book(self, currency_pair, **kwargs): # noqa: E501 - """Retrieve order book # noqa: E501 + """Get market depth information # noqa: E501 - Order book will be sorted by price from high to low on bids; low to high on asks # noqa: E501 + Market depth buy orders are sorted by price from high to low, sell orders are sorted from low to high # 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_order_book(currency_pair, async_req=True) @@ -535,9 +594,9 @@ 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: Order depth. 0 means no aggregation is applied. default to 0 - :param int limit: Maximum number of order depth data in asks or bids - :param bool with_id: Return order book ID + :param str interval: Price precision for depth aggregation, 0 means no aggregation, defaults to 0 if not specified + :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 be returned without reading/decoding response data. Default is True. @@ -553,9 +612,9 @@ def list_order_book(self, currency_pair, **kwargs): # noqa: E501 return self.list_order_book_with_http_info(currency_pair, **kwargs) # noqa: E501 def list_order_book_with_http_info(self, currency_pair, **kwargs): # noqa: E501 - """Retrieve order book # noqa: E501 + """Get market depth information # noqa: E501 - Order book will be sorted by price from high to low on bids; low to high on asks # noqa: E501 + Market depth buy orders are sorted by price from high to low, sell orders are sorted from low to high # 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_order_book_with_http_info(currency_pair, async_req=True) @@ -563,9 +622,9 @@ 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: Order depth. 0 means no aggregation is applied. default to 0 - :param int limit: Maximum number of order depth data in asks or bids - :param bool with_id: Return order book ID + :param str interval: Price precision for depth aggregation, 0 means no aggregation, defaults to 0 if not specified + :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 and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -582,28 +641,36 @@ def list_order_book_with_http_info(self, currency_pair, **kwargs): # noqa: E501 local_var_params = locals() - all_params = ['currency_pair', 'interval', 'limit', 'with_id'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'currency_pair', + 'interval', + 'limit', + 'with_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_order_book" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_order_book" % k + ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'currency_pair' is set - if self.api_client.client_side_validation and ( - 'currency_pair' not in local_var_params or local_var_params['currency_pair'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `currency_pair` when calling `list_order_book`" - ) # 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_order_book`, must be a value greater than or equal to `1`" - ) # noqa: E501 + if self.api_client.client_side_validation and ('currency_pair' not in local_var_params or # noqa: E501 + local_var_params['currency_pair'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `currency_pair` when calling `list_order_book`") # 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_order_book`, must be a value greater than or equal to `1`") # noqa: E501 collection_formats = {} path_params = {} @@ -625,14 +692,14 @@ def list_order_book_with_http_info(self, currency_pair, **kwargs): # noqa: E501 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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( - '/spot/order_book', - 'GET', + '/spot/order_book', 'GET', path_params, query_params, header_params, @@ -645,13 +712,12 @@ def list_order_book_with_http_info(self, currency_pair, **kwargs): # noqa: E501 _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, - ) + collection_formats=collection_formats) def list_trades(self, currency_pair, **kwargs): # noqa: E501 - """Retrieve market trades # noqa: E501 + """Query market transaction records # noqa: E501 - You can use `from` and `to` to query by time range, or use `last_id` by scrolling page. The default behavior is by time range. Scrolling query using `last_id` is not recommended any more. If `last_id` is specified, time range query parameters will be ignored. # noqa: E501 + Supports querying by time range using `from` and `to` parameters or pagination based on `last_id`. By default, queries the last 30 days. Pagination based on `last_id` is no longer recommended. If `last_id` is specified, the time range query parameters will be ignored. When using limit&page pagination to retrieve data, the maximum number of pages 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_trades(currency_pair, async_req=True) @@ -659,11 +725,11 @@ def list_trades(self, currency_pair, **kwargs): # noqa: E501 :param bool async_req: execute request asynchronously :param str currency_pair: Currency pair (required) - :param int limit: Maximum number of records to be returned in a single list - :param str last_id: Specify list staring point using the `id` of last record in previous list-query results - :param bool reverse: Whether the id of records to be retrieved should be smaller than the last_id specified- true: Retrieve records where id is smaller than the specified last_id- false: Retrieve records where id is larger than the specified last_idDefault to false. When `last_id` is specified. Set `reverse` to `true` to trace back trading history; `false` to retrieve latest tradings. No effect if `last_id` is not specified. - :param int _from: Start timestamp of the query - :param int to: Time range ending, default to current time + :param int limit: Maximum number of items returned in list. Default: 100, minimum: 1, maximum: 1000 + :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 bool reverse: Whether to retrieve data less than `last_id`. Default returns records greater than `last_id`. Set to `true` to trace back market trade records, `false` to get latest trades. No effect when `last_id` is not set. + :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 _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response @@ -680,9 +746,9 @@ def list_trades(self, currency_pair, **kwargs): # noqa: E501 return self.list_trades_with_http_info(currency_pair, **kwargs) # noqa: E501 def list_trades_with_http_info(self, currency_pair, **kwargs): # noqa: E501 - """Retrieve market trades # noqa: E501 + """Query market transaction records # noqa: E501 - You can use `from` and `to` to query by time range, or use `last_id` by scrolling page. The default behavior is by time range. Scrolling query using `last_id` is not recommended any more. If `last_id` is specified, time range query parameters will be ignored. # noqa: E501 + Supports querying by time range using `from` and `to` parameters or pagination based on `last_id`. By default, queries the last 30 days. Pagination based on `last_id` is no longer recommended. If `last_id` is specified, the time range query parameters will be ignored. When using limit&page pagination to retrieve data, the maximum number of pages 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_trades_with_http_info(currency_pair, async_req=True) @@ -690,11 +756,11 @@ def list_trades_with_http_info(self, currency_pair, **kwargs): # noqa: E501 :param bool async_req: execute request asynchronously :param str currency_pair: Currency pair (required) - :param int limit: Maximum number of records to be returned in a single list - :param str last_id: Specify list staring point using the `id` of last record in previous list-query results - :param bool reverse: Whether the id of records to be retrieved should be smaller than the last_id specified- true: Retrieve records where id is smaller than the specified last_id- false: Retrieve records where id is larger than the specified last_idDefault to false. When `last_id` is specified. Set `reverse` to `true` to trace back trading history; `false` to retrieve latest tradings. No effect if `last_id` is not specified. - :param int _from: Start timestamp of the query - :param int to: Time range ending, default to current time + :param int limit: Maximum number of items returned in list. Default: 100, minimum: 1, maximum: 1000 + :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 bool reverse: Whether to retrieve data less than `last_id`. Default returns records greater than `last_id`. Set to `true` to trace back market trade records, `false` to get latest trades. No effect when `last_id` is not set. + :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 _return_http_data_only: response data without head status code and headers @@ -712,40 +778,43 @@ def list_trades_with_http_info(self, currency_pair, **kwargs): # noqa: E501 local_var_params = locals() - all_params = ['currency_pair', 'limit', 'last_id', 'reverse', '_from', 'to', 'page'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'currency_pair', + 'limit', + 'last_id', + 'reverse', + '_from', + 'to', + '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_trades" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_trades" % k + ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'currency_pair' is set - if self.api_client.client_side_validation and ( - 'currency_pair' not in local_var_params or local_var_params['currency_pair'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `currency_pair` when calling `list_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 `list_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 `list_trades`, 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_trades`, must be a value greater than or equal to `1`" - ) # noqa: E501 + if self.api_client.client_side_validation and ('currency_pair' not in local_var_params or # noqa: E501 + local_var_params['currency_pair'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `currency_pair` when calling `list_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 `list_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 `list_trades`, 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_trades`, must be a value greater than or equal to `1`") # noqa: E501 collection_formats = {} path_params = {} @@ -773,14 +842,14 @@ def list_trades_with_http_info(self, currency_pair, **kwargs): # noqa: E501 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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( - '/spot/trades', - 'GET', + '/spot/trades', 'GET', path_params, query_params, header_params, @@ -793,11 +862,10 @@ def list_trades_with_http_info(self, currency_pair, **kwargs): # noqa: E501 _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, - ) + collection_formats=collection_formats) def list_candlesticks(self, currency_pair, **kwargs): # noqa: E501 - """Market candlesticks # 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 This method makes a synchronous HTTP request by default. To make an @@ -807,10 +875,10 @@ def list_candlesticks(self, currency_pair, **kwargs): # noqa: E501 :param bool async_req: execute request asynchronously :param str currency_pair: Currency pair (required) - :param int limit: Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. + :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 int _from: Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified - :param int to: End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time - :param str interval: Interval time between data points + :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 str interval: Time interval between data points. Note that `30d` represents a calendar month, not aligned to 30 days :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -826,7 +894,7 @@ def list_candlesticks(self, currency_pair, **kwargs): # noqa: E501 return self.list_candlesticks_with_http_info(currency_pair, **kwargs) # noqa: E501 def list_candlesticks_with_http_info(self, currency_pair, **kwargs): # noqa: E501 - """Market candlesticks # 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 This method makes a synchronous HTTP request by default. To make an @@ -836,10 +904,10 @@ def list_candlesticks_with_http_info(self, currency_pair, **kwargs): # noqa: E5 :param bool async_req: execute request asynchronously :param str currency_pair: Currency pair (required) - :param int limit: Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. + :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 int _from: Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified - :param int to: End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time - :param str interval: Interval time between data points + :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 str interval: Time interval between data points. Note that `30d` represents a calendar month, not aligned to 30 days :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -856,28 +924,37 @@ def list_candlesticks_with_http_info(self, currency_pair, **kwargs): # noqa: E5 local_var_params = locals() - all_params = ['currency_pair', 'limit', '_from', 'to', 'interval'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'currency_pair', + 'limit', + '_from', + 'to', + 'interval' + ] + 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_candlesticks" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_candlesticks" % k + ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'currency_pair' is set - if self.api_client.client_side_validation and ( - 'currency_pair' not in local_var_params or local_var_params['currency_pair'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `currency_pair` when calling `list_candlesticks`" - ) # 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_candlesticks`, must be a value less than or equal to `1000`" - ) # noqa: E501 + if self.api_client.client_side_validation and ('currency_pair' not in local_var_params or # noqa: E501 + local_var_params['currency_pair'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `currency_pair` when calling `list_candlesticks`") # 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_candlesticks`, must be a value less than or equal to `1000`") # noqa: E501 collection_formats = {} path_params = {} @@ -901,14 +978,14 @@ def list_candlesticks_with_http_info(self, currency_pair, **kwargs): # noqa: E5 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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( - '/spot/candlesticks', - 'GET', + '/spot/candlesticks', 'GET', path_params, query_params, header_params, @@ -921,20 +998,19 @@ def list_candlesticks_with_http_info(self, currency_pair, **kwargs): # noqa: E5 _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, - ) + collection_formats=collection_formats) def get_fee(self, **kwargs): # noqa: E501 - """Query user trading fee rates # noqa: E501 + """Query account fee rates # noqa: E501 - This API is deprecated in favour of new fee retrieving API `/wallet/fee`. # noqa: E501 + This API is deprecated. The new fee query API is `/wallet/fee` # 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_fee(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str currency_pair: Specify a currency pair to retrieve precise fee rate This field is optional. In most cases, the fee rate is identical among all currency pairs + :param str currency_pair: Specify currency pair to get more accurate fee settings. This field is optional. Usually fee settings are the same for all currency pairs. :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -942,7 +1018,7 @@ def get_fee(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.TradeFee + :rtype: gate_api.SpotFee :return: If the method is called asynchronously, returns the request thread. """ @@ -950,16 +1026,16 @@ def get_fee(self, **kwargs): # noqa: E501 return self.get_fee_with_http_info(**kwargs) # noqa: E501 def get_fee_with_http_info(self, **kwargs): # noqa: E501 - """Query user trading fee rates # noqa: E501 + """Query account fee rates # noqa: E501 - This API is deprecated in favour of new fee retrieving API `/wallet/fee`. # noqa: E501 + This API is deprecated. The new fee query API is `/wallet/fee` # 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_fee_with_http_info(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str currency_pair: Specify a currency pair to retrieve precise fee rate This field is optional. In most cases, the fee rate is identical among all currency pairs + :param str currency_pair: Specify currency pair to get more accurate fee settings. This field is optional. Usually fee settings are the same for all currency pairs. :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -969,19 +1045,31 @@ def get_fee_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.TradeFee, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(gate_api.SpotFee, 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']) + 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 get_fee" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_fee" % k + ) local_var_params[k] = v del local_var_params['kwargs'] @@ -1000,39 +1088,38 @@ def get_fee_with_http_info(self, **kwargs): # noqa: E501 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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/fee', - 'GET', + '/spot/fee', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='TradeFee', # noqa: E501 + response_type='SpotFee', # 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, - ) + collection_formats=collection_formats) - def list_spot_accounts(self, **kwargs): # noqa: E501 - """List spot accounts # noqa: E501 + def get_batch_spot_fee(self, currency_pairs, **kwargs): # noqa: E501 + """Batch query account fee 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.list_spot_accounts(async_req=True) + >>> thread = api.get_batch_spot_fee(currency_pairs, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str currency: Retrieve data of the specified currency + :param str currency_pairs: Maximum 50 currency pairs per request (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -1040,23 +1127,23 @@ def list_spot_accounts(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.SpotAccount] + :rtype: dict(str, gate_api.SpotFee) :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 + return self.get_batch_spot_fee_with_http_info(currency_pairs, **kwargs) # noqa: E501 - def list_spot_accounts_with_http_info(self, **kwargs): # noqa: E501 - """List spot accounts # noqa: E501 + def get_batch_spot_fee_with_http_info(self, currency_pairs, **kwargs): # noqa: E501 + """Batch query account fee 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.list_spot_accounts_with_http_info(async_req=True) + >>> thread = api.get_batch_spot_fee_with_http_info(currency_pairs, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str currency: Retrieve data of the specified currency + :param str currency_pairs: Maximum 50 currency pairs per 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 @@ -1066,29 +1153,45 @@ def list_spot_accounts_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.SpotAccount], status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(dict(str, gate_api.SpotFee), 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']) + all_params = [ + 'currency_pairs' + ] + 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) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_batch_spot_fee" % k + ) local_var_params[k] = v del local_var_params['kwargs'] + # verify the required parameter 'currency_pairs' is set + if self.api_client.client_side_validation and ('currency_pairs' not in local_var_params or # noqa: E501 + local_var_params['currency_pairs'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `currency_pairs` when calling `get_batch_spot_fee`") # 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 'currency_pairs' in local_var_params and local_var_params['currency_pairs'] is not None: # noqa: E501 + query_params.append(('currency_pairs', local_var_params['currency_pairs'])) # noqa: E501 header_params = {} @@ -1097,40 +1200,38 @@ def list_spot_accounts_with_http_info(self, **kwargs): # noqa: E501 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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', + '/spot/batch_fee', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[SpotAccount]', # noqa: E501 + response_type='dict(str, SpotFee)', # 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, - ) + collection_formats=collection_formats) - def create_batch_orders(self, order, **kwargs): # noqa: E501 - """Create a batch of orders # noqa: E501 + def list_spot_accounts(self, **kwargs): # noqa: E501 + """List spot trading accounts # noqa: E501 - Batch orders requirements: 1. custom order field `text` is required 2. At most 4 currency pairs, maximum 10 orders each, are allowed in one request 3. No mixture of spot orders and margin orders, i.e. `account` must be identical for all 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.create_batch_orders(order, async_req=True) + >>> thread = api.list_spot_accounts(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param list[Order] order: (required) + :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. @@ -1138,24 +1239,23 @@ def create_batch_orders(self, order, **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.BatchOrder] + :rtype: list[gate_api.SpotAccount] :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.create_batch_orders_with_http_info(order, **kwargs) # noqa: E501 + return self.list_spot_accounts_with_http_info(**kwargs) # noqa: E501 - def create_batch_orders_with_http_info(self, order, **kwargs): # noqa: E501 - """Create a batch of orders # noqa: E501 + def list_spot_accounts_with_http_info(self, **kwargs): # noqa: E501 + """List spot trading accounts # noqa: E501 - Batch orders requirements: 1. custom order field `text` is required 2. At most 4 currency pairs, maximum 10 orders each, are allowed in one request 3. No mixture of spot orders and margin orders, i.e. `account` must be identical for all 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.create_batch_orders_with_http_info(order, 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 list[Order] order: (required) + :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 @@ -1165,34 +1265,41 @@ def create_batch_orders_with_http_info(self, order, **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.BatchOrder], status_code(int), headers(HTTPHeaderDict)) + :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 = ['order'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + 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 create_batch_orders" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_spot_accounts" % k + ) local_var_params[k] = v del local_var_params['kwargs'] - # verify the required parameter 'order' is set - if self.api_client.client_side_validation and ( - 'order' not in local_var_params or local_var_params['order'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `order` when calling `create_batch_orders`" - ) # 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 header_params = {} @@ -1200,50 +1307,46 @@ def create_batch_orders_with_http_info(self, order, **kwargs): # noqa: E501 local_var_files = {} body_params = None - if 'order' in local_var_params: - body_params = local_var_params['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 + 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/batch_orders', - 'POST', + '/spot/accounts', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[BatchOrder]', # noqa: E501 + 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, - ) + collection_formats=collection_formats) - def list_all_open_orders(self, **kwargs): # noqa: E501 - """List all open orders # noqa: E501 + def list_spot_account_book(self, **kwargs): # noqa: E501 + """Query spot account transaction history # noqa: E501 - List open orders in all currency pairs. Note that pagination parameters affect record number in each currency pair's open order list. No pagination is applied to the number of currency pairs returned. All currency pairs with open orders will be returned. Spot and margin orders are returned by default. To list cross margin orders, `account` must be set to `cross_margin` # noqa: E501 + Record query time range cannot exceed 30 days. When using limit&page pagination to retrieve data, the maximum number of pages 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_all_open_orders(async_req=True) + >>> thread = api.list_spot_account_book(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously + :param str currency: Query by specified currency name + :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 of records returned in one page in each currency pair - :param str account: Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account + :param int limit: Maximum number of records returned in a single list + :param str type: Query by specified account change type. If not specified, all change types will be included. + :param str code: Specify account change code for query. If not specified, all change types are included. This parameter has higher priority than `type` :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -1251,26 +1354,30 @@ def list_all_open_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.OpenOrders] + :rtype: list[gate_api.SpotAccountBook] :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.list_all_open_orders_with_http_info(**kwargs) # noqa: E501 + return self.list_spot_account_book_with_http_info(**kwargs) # noqa: E501 - def list_all_open_orders_with_http_info(self, **kwargs): # noqa: E501 - """List all open orders # noqa: E501 + def list_spot_account_book_with_http_info(self, **kwargs): # noqa: E501 + """Query spot account transaction history # noqa: E501 - List open orders in all currency pairs. Note that pagination parameters affect record number in each currency pair's open order list. No pagination is applied to the number of currency pairs returned. All currency pairs with open orders will be returned. Spot and margin orders are returned by default. To list cross margin orders, `account` must be set to `cross_margin` # noqa: E501 + Record query time range cannot exceed 30 days. When using limit&page pagination to retrieve data, the maximum number of pages 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_all_open_orders_with_http_info(async_req=True) + >>> thread = api.list_spot_account_book_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 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 of records returned in one page in each currency pair - :param str account: Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account + :param int limit: Maximum number of records returned in a single list + :param str type: Query by specified account change type. If not specified, all change types will be included. + :param str code: Specify account change code for query. If not specified, all change types are included. This parameter has higher priority than `type` :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -1280,51 +1387,65 @@ def list_all_open_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.OpenOrders], status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(list[gate_api.SpotAccountBook], status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ local_var_params = locals() - all_params = ['page', 'limit', 'account'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'currency', + '_from', + 'to', + 'page', + 'limit', + 'type', + '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 list_all_open_orders" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_spot_account_book" % 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_all_open_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'] > 100 - ): # noqa: E501 - raise ApiValueError( - "Invalid value for parameter `limit` when calling `list_all_open_orders`, 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_all_open_orders`, 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_spot_account_book`, 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_account_book`, 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_account_book`, 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 '_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 'account' in local_var_params and local_var_params['account'] is not None: # noqa: E501 - query_params.append(('account', local_var_params['account'])) # 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 'code' in local_var_params and local_var_params['code'] is not None: # noqa: E501 + query_params.append(('code', local_var_params['code'])) # noqa: E501 header_params = {} @@ -1333,47 +1454,40 @@ def list_all_open_orders_with_http_info(self, **kwargs): # noqa: E501 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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/open_orders', - 'GET', + '/spot/account_book', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[OpenOrders]', # noqa: E501 + response_type='list[SpotAccountBook]', # 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, - ) + collection_formats=collection_formats) - def list_orders(self, currency_pair, status, **kwargs): # noqa: E501 - """List orders # noqa: E501 + def create_batch_orders(self, order, **kwargs): # noqa: E501 + """Batch place orders # noqa: E501 - Spot and margin orders are returned by default. If cross margin orders are needed, `account` must be set to `cross_margin` When `status` is `open`, i.e., listing open orders, only pagination parameters `page` and `limit` are supported and `limit` cannot be larger than 100. Query by `side` and time range parameters `from` and `to` are not supported. When `status` is `finished`, i.e., listing finished orders, pagination parameters, time range parameters `from` and `to`, and `side` parameters are all supported. Time range parameters are handled as order finish time. # noqa: E501 + Batch order requirements: 1. Custom order field `text` must be specified 2. Up to 4 currency pairs per request, with up to 10 orders per currency pair 3. Spot orders and margin orders cannot be mixed; all `account` fields in the same request must be identical # 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_orders(currency_pair, status, async_req=True) + >>> thread = api.create_batch_orders(order, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str currency_pair: Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones. (required) - :param str status: List orders based on status `open` - order is waiting to be filled `finished` - order has been filled or cancelled (required) - :param int page: Page number - :param int limit: Maximum number of records to be returned. If `status` is `open`, maximum of `limit` is 100 - :param str account: Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account - :param int _from: Start timestamp of the query - :param int to: Time range ending, default to current time - :param str side: All bids or asks. Both included if not specified + :param list[Order] 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. @@ -1381,31 +1495,25 @@ def list_orders(self, currency_pair, 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.Order] + :rtype: list[gate_api.BatchOrder] :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.list_orders_with_http_info(currency_pair, status, **kwargs) # noqa: E501 + return self.create_batch_orders_with_http_info(order, **kwargs) # noqa: E501 - def list_orders_with_http_info(self, currency_pair, status, **kwargs): # noqa: E501 - """List orders # noqa: E501 + def create_batch_orders_with_http_info(self, order, **kwargs): # noqa: E501 + """Batch place orders # noqa: E501 - Spot and margin orders are returned by default. If cross margin orders are needed, `account` must be set to `cross_margin` When `status` is `open`, i.e., listing open orders, only pagination parameters `page` and `limit` are supported and `limit` cannot be larger than 100. Query by `side` and time range parameters `from` and `to` are not supported. When `status` is `finished`, i.e., listing finished orders, pagination parameters, time range parameters `from` and `to`, and `side` parameters are all supported. Time range parameters are handled as order finish time. # noqa: E501 + Batch order requirements: 1. Custom order field `text` must be specified 2. Up to 4 currency pairs per request, with up to 10 orders per currency pair 3. Spot orders and margin orders cannot be mixed; all `account` fields in the same request must be identical # 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_orders_with_http_info(currency_pair, status, async_req=True) + >>> thread = api.create_batch_orders_with_http_info(order, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str currency_pair: Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones. (required) - :param str status: List orders based on status `open` - order is waiting to be filled `finished` - order has been filled or cancelled (required) - :param int page: Page number - :param int limit: Maximum number of records to be returned. If `status` is `open`, maximum of `limit` is 100 - :param str account: Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account - :param int _from: Start timestamp of the query - :param int to: Time range ending, default to current time - :param str side: All bids or asks. Both included if not specified + :param list[Order] 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 @@ -1415,115 +1523,95 @@ def list_orders_with_http_info(self, currency_pair, 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.Order], status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(list[gate_api.BatchOrder], status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ local_var_params = locals() - all_params = ['currency_pair', 'status', 'page', 'limit', 'account', '_from', 'to', 'side'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + '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 list_orders" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_batch_orders" % k + ) local_var_params[k] = v del local_var_params['kwargs'] - # verify the required parameter 'currency_pair' is set - if self.api_client.client_side_validation and ( - 'currency_pair' not in local_var_params or local_var_params['currency_pair'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `currency_pair` when calling `list_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 local_var_params['status'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError("Missing the required parameter `status` when calling `list_orders`") # noqa: E501 + # verify the required parameter 'order' is set + if self.api_client.client_side_validation and ('order' not in local_var_params or # noqa: E501 + local_var_params['order'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `order` when calling `create_batch_orders`") # 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_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_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_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 '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 'account' in local_var_params and local_var_params['account'] is not None: # noqa: E501 - query_params.append(('account', local_var_params['account'])) # 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 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 'order' in local_var_params: + body_params = local_var_params['order'] # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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/orders', - 'GET', + '/spot/batch_orders', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[Order]', # noqa: E501 + response_type='list[BatchOrder]', # 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, - ) + collection_formats=collection_formats) - def create_order(self, order, **kwargs): # noqa: E501 - """Create an order # noqa: E501 + def list_all_open_orders(self, **kwargs): # noqa: E501 + """List all open orders # noqa: E501 - You can place orders with spot, margin or cross margin account through setting the `account `field. It defaults to `spot`, which means spot account is used to place orders. When margin account is used, i.e., `account` is `margin`, `auto_borrow` field can be set to `true` to enable the server to borrow the amount lacked using `POST /margin/loans` when your account's balance is not enough. Whether margin orders' fill will be used to repay margin loans automatically is determined by the auto repayment setting in your **margin account**, which can be updated or queried using `/margin/auto_repay` API. When cross margin account is used, i.e., `account` is `cross_margin`, `auto_borrow` can also be enabled to achieve borrowing the insufficient amount automatically if cross account's balance is not enough. But it differs from margin account that automatic repayment is determined by order's `auto_repay` field and only current order's fill will be used to repay cross margin loans. Automatic repayment will be triggered when the order is finished, i.e., its status is either `cancelled` or `closed`. **Order status** An order waiting to be filled is `open`, and it stays `open` until it is filled totally. If fully filled, order is finished and its status turns to `closed`.If the order is cancelled before it is totally filled, whether or not partially filled, its status is `cancelled`. **Iceberg order** `iceberg` field can be used to set the amount shown. Set to `-1` to hide the order completely. Note that the hidden part's fee will be charged using taker's fee rate. # noqa: E501 + Query the current order list of all trading pairs. Please note that the paging parameter controls the number of pending orders in each trading pair. There is no paging control trading pairs. All trading pairs with pending orders will be 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.create_order(order, async_req=True) + >>> thread = api.list_all_open_orders(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param Order order: (required) + :param int page: Page number + :param int limit: Maximum number of records returned in one page in each currency pair + :param str account: Specify query account :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -1531,24 +1619,26 @@ def create_order(self, 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.Order + :rtype: list[gate_api.OpenOrders] :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.create_order_with_http_info(order, **kwargs) # noqa: E501 + return self.list_all_open_orders_with_http_info(**kwargs) # noqa: E501 - def create_order_with_http_info(self, order, **kwargs): # noqa: E501 - """Create an order # noqa: E501 + def list_all_open_orders_with_http_info(self, **kwargs): # noqa: E501 + """List all open orders # noqa: E501 - You can place orders with spot, margin or cross margin account through setting the `account `field. It defaults to `spot`, which means spot account is used to place orders. When margin account is used, i.e., `account` is `margin`, `auto_borrow` field can be set to `true` to enable the server to borrow the amount lacked using `POST /margin/loans` when your account's balance is not enough. Whether margin orders' fill will be used to repay margin loans automatically is determined by the auto repayment setting in your **margin account**, which can be updated or queried using `/margin/auto_repay` API. When cross margin account is used, i.e., `account` is `cross_margin`, `auto_borrow` can also be enabled to achieve borrowing the insufficient amount automatically if cross account's balance is not enough. But it differs from margin account that automatic repayment is determined by order's `auto_repay` field and only current order's fill will be used to repay cross margin loans. Automatic repayment will be triggered when the order is finished, i.e., its status is either `cancelled` or `closed`. **Order status** An order waiting to be filled is `open`, and it stays `open` until it is filled totally. If fully filled, order is finished and its status turns to `closed`.If the order is cancelled before it is totally filled, whether or not partially filled, its status is `cancelled`. **Iceberg order** `iceberg` field can be used to set the amount shown. Set to `-1` to hide the order completely. Note that the hidden part's fee will be charged using taker's fee rate. # noqa: E501 + Query the current order list of all trading pairs. Please note that the paging parameter controls the number of pending orders in each trading pair. There is no paging control trading pairs. All trading pairs with pending orders will be 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.create_order_with_http_info(order, async_req=True) + >>> thread = api.list_all_open_orders_with_http_info(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param Order order: (required) + :param int page: Page number + :param int limit: Maximum number of records returned in one page in each currency pair + :param str account: Specify query account :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -1558,32 +1648,53 @@ def create_order_with_http_info(self, order, **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.Order, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(list[gate_api.OpenOrders], status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ local_var_params = locals() - all_params = ['order'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'page', + 'limit', + 'account' + ] + 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_order" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_all_open_orders" % k + ) local_var_params[k] = v del local_var_params['kwargs'] - # verify the required parameter 'order' is set - if self.api_client.client_side_validation and ( - 'order' not in local_var_params or local_var_params['order'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError("Missing the required parameter `order` when calling `create_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_all_open_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'] > 100: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `list_all_open_orders`, 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_all_open_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 'account' in local_var_params and local_var_params['account'] is not None: # noqa: E501 + query_params.append(('account', local_var_params['account'])) # noqa: E501 header_params = {} @@ -1591,50 +1702,40 @@ def create_order_with_http_info(self, order, **kwargs): # noqa: E501 local_var_files = {} body_params = None - if 'order' in local_var_params: - body_params = local_var_params['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 + 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/orders', - 'POST', + '/spot/open_orders', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='Order', # noqa: E501 + response_type='list[OpenOrders]', # 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, - ) + collection_formats=collection_formats) - def cancel_orders(self, currency_pair, **kwargs): # noqa: E501 - """Cancel all `open` orders in specified currency pair # noqa: E501 + def create_cross_liquidate_order(self, liquidate_order, **kwargs): # noqa: E501 + """Close position when cross-currency is disabled # noqa: E501 - If `account` is not set, all open orders, including spot, margin and cross margin ones, will be cancelled. You can set `account` to cancel only orders within the specified account # noqa: E501 + Currently, only cross-margin accounts are supported to place buy orders for disabled currencies. Maximum buy quantity = (unpaid principal and interest - currency balance - the amount of the currency in pending orders) / 0.998 # 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_orders(currency_pair, async_req=True) + >>> thread = api.create_cross_liquidate_order(liquidate_order, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str currency_pair: Currency pair (required) - :param str side: All bids or asks. Both included if not specified - :param str account: Specify account type. Default to all account types being included + :param LiquidateOrder liquidate_order: (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -1642,26 +1743,24 @@ def cancel_orders(self, currency_pair, **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.Order] + :rtype: gate_api.Order :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.cancel_orders_with_http_info(currency_pair, **kwargs) # noqa: E501 + return self.create_cross_liquidate_order_with_http_info(liquidate_order, **kwargs) # noqa: E501 - def cancel_orders_with_http_info(self, currency_pair, **kwargs): # noqa: E501 - """Cancel all `open` orders in specified currency pair # noqa: E501 + def create_cross_liquidate_order_with_http_info(self, liquidate_order, **kwargs): # noqa: E501 + """Close position when cross-currency is disabled # noqa: E501 - If `account` is not set, all open orders, including spot, margin and cross margin ones, will be cancelled. You can set `account` to cancel only orders within the specified account # noqa: E501 + Currently, only cross-margin accounts are supported to place buy orders for disabled currencies. Maximum buy quantity = (unpaid principal and interest - currency balance - the amount of the currency in pending orders) / 0.998 # 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_orders_with_http_info(currency_pair, async_req=True) + >>> thread = api.create_cross_liquidate_order_with_http_info(liquidate_order, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str currency_pair: Currency pair (required) - :param str side: All bids or asks. Both included if not specified - :param str account: Specify account type. Default to all account types being included + :param LiquidateOrder liquidate_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 @@ -1671,40 +1770,43 @@ def cancel_orders_with_http_info(self, currency_pair, **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.Order], status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(gate_api.Order, status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ local_var_params = locals() - all_params = ['currency_pair', 'side', 'account'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'liquidate_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 cancel_orders" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_cross_liquidate_order" % k + ) local_var_params[k] = v del local_var_params['kwargs'] - # verify the required parameter 'currency_pair' is set - if self.api_client.client_side_validation and ( - 'currency_pair' not in local_var_params or local_var_params['currency_pair'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `currency_pair` when calling `cancel_orders`" - ) # noqa: E501 + # verify the required parameter 'liquidate_order' is set + if self.api_client.client_side_validation and ('liquidate_order' not in local_var_params or # noqa: E501 + local_var_params['liquidate_order'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `liquidate_order` when calling `create_cross_liquidate_order`") # 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 '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 'account' in local_var_params and local_var_params['account'] is not None: # noqa: E501 - query_params.append(('account', local_var_params['account'])) # noqa: E501 header_params = {} @@ -1712,41 +1814,53 @@ def cancel_orders_with_http_info(self, currency_pair, **kwargs): # noqa: E501 local_var_files = {} body_params = None + if 'liquidate_order' in local_var_params: + body_params = local_var_params['liquidate_order'] # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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/orders', - 'DELETE', + '/spot/cross_liquidate_orders', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[Order]', # noqa: E501 + response_type='Order', # 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, - ) + collection_formats=collection_formats) - def cancel_batch_orders(self, cancel_order, **kwargs): # noqa: E501 - """Cancel a batch of orders with an ID list # noqa: E501 + def list_orders(self, currency_pair, status, **kwargs): # noqa: E501 + """List orders # noqa: E501 - Multiple currency pairs can be specified, but maximum 20 orders are allowed per request # noqa: E501 + Note that query results default to spot order lists for spot, unified account, and isolated margin accounts. When `status` is set to `open` (i.e., when querying pending order lists), only `page` and `limit` pagination controls are supported. `limit` can only be set to a maximum of 100. The `side` parameter and time range query parameters `from` and `to` are not supported. When `status` is set to `finished` (i.e., when querying historical orders), in addition to pagination queries, `from` and `to` time range queries are also supported. Additionally, the `side` parameter can be set to filter one-sided history. Time range filter parameters are processed according to the order end time. # 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_orders(cancel_order, async_req=True) + >>> thread = api.list_orders(currency_pair, status, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param list[CancelOrder] cancel_order: (required) + :param str currency_pair: Query by specified currency pair. Required for open orders, optional for filled orders (required) + :param str status: List orders based on status `open` - order is waiting to be filled `finished` - order has been filled or cancelled (required) + :param int page: Page number + :param int limit: Maximum number of records to be returned. If `status` is `open`, maximum of `limit` is 100 + :param str account: Specify query account + :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 side: Specify all bids or all asks, both included if not specified :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -1754,24 +1868,31 @@ def cancel_batch_orders(self, cancel_order, **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.CancelOrderResult] + :rtype: list[gate_api.Order] :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.cancel_batch_orders_with_http_info(cancel_order, **kwargs) # noqa: E501 + return self.list_orders_with_http_info(currency_pair, status, **kwargs) # noqa: E501 - def cancel_batch_orders_with_http_info(self, cancel_order, **kwargs): # noqa: E501 - """Cancel a batch of orders with an ID list # noqa: E501 + def list_orders_with_http_info(self, currency_pair, status, **kwargs): # noqa: E501 + """List orders # noqa: E501 - Multiple currency pairs can be specified, but maximum 20 orders are allowed per request # noqa: E501 + Note that query results default to spot order lists for spot, unified account, and isolated margin accounts. When `status` is set to `open` (i.e., when querying pending order lists), only `page` and `limit` pagination controls are supported. `limit` can only be set to a maximum of 100. The `side` parameter and time range query parameters `from` and `to` are not supported. When `status` is set to `finished` (i.e., when querying historical orders), in addition to pagination queries, `from` and `to` time range queries are also supported. Additionally, the `side` parameter can be set to filter one-sided history. Time range filter parameters are processed according to the order end time. # 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_orders_with_http_info(cancel_order, async_req=True) + >>> thread = api.list_orders_with_http_info(currency_pair, status, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param list[CancelOrder] cancel_order: (required) + :param str currency_pair: Query by specified currency pair. Required for open orders, optional for filled orders (required) + :param str status: List orders based on status `open` - order is waiting to be filled `finished` - order has been filled or cancelled (required) + :param int page: Page number + :param int limit: Maximum number of records to be returned. If `status` is `open`, maximum of `limit` is 100 + :param str account: Specify query account + :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 side: Specify all bids or all asks, both included 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 @@ -1781,85 +1902,1150 @@ def cancel_batch_orders_with_http_info(self, cancel_order, **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.CancelOrderResult], status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(list[gate_api.Order], 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']) + all_params = [ + 'currency_pair', + 'status', + 'page', + 'limit', + 'account', + '_from', + 'to', + '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 cancel_batch_orders" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_orders" % 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 local_var_params['cancel_order'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `cancel_order` when calling `cancel_batch_orders`" - ) # noqa: E501 + # verify the required parameter 'currency_pair' is set + if self.api_client.client_side_validation and ('currency_pair' not in local_var_params or # noqa: E501 + local_var_params['currency_pair'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `currency_pair` when calling `list_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_orders`") # 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_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_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_orders`, must be a value greater than or equal to `1`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] - - header_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 '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 'account' in local_var_params and local_var_params['account'] is not None: # noqa: E501 + query_params.append(('account', local_var_params['account'])) # 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 + + 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/orders', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[Order]', # 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_order(self, order, **kwargs): # noqa: E501 + """Create an 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 + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_order(order, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param Order 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.Order + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + 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 + + 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 + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_order_with_http_info(order, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param Order 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.Order, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + '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_order" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'order' is set + if self.api_client.client_side_validation and ('order' not in local_var_params or # noqa: E501 + local_var_params['order'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `order` when calling `create_order`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + 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 'order' in local_var_params: + body_params = local_var_params['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( + '/spot/orders', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Order', # 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_orders(self, **kwargs): # noqa: E501 + """Cancel all `open` orders in specified currency pair # noqa: E501 + + When the `account` parameter is not specified, all pending orders including spot, unified account, and isolated margin will be cancelled. When `currency_pair` is not specified, all trading pair pending orders will be cancelled. You can specify a particular account to cancel all pending orders under that account # 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_orders(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency_pair: Currency pair + :param str side: Specify all bids or all asks, both included if not specified + :param str account: Specify account type Classic account: All are included if not specified Unified account: Specify `unified` + :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 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.OrderCancel] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.cancel_orders_with_http_info(**kwargs) # noqa: E501 + + def cancel_orders_with_http_info(self, **kwargs): # noqa: E501 + """Cancel all `open` orders in specified currency pair # noqa: E501 + + When the `account` parameter is not specified, all pending orders including spot, unified account, and isolated margin will be cancelled. When `currency_pair` is not specified, all trading pair pending orders will be cancelled. You can specify a particular account to cancel all pending orders under that account # 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_orders_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency_pair: Currency pair + :param str side: Specify all bids or all asks, both included if not specified + :param str account: Specify account type Classic account: All are included if not specified Unified account: Specify `unified` + :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 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.OrderCancel], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'currency_pair', + 'side', + 'account', + 'action_mode', + '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 cancel_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 + 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 'account' in local_var_params and local_var_params['account'] is not None: # noqa: E501 + query_params.append(('account', local_var_params['account'])) # 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 + + 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( + '/spot/orders', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[OrderCancel]', # 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_orders(self, cancel_batch_order, **kwargs): # noqa: E501 + """Cancel batch orders by specified ID list # noqa: E501 + + Multiple currency pairs can be specified, but maximum 20 orders are allowed per 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_orders(cancel_batch_order, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param list[CancelBatchOrder] cancel_batch_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.CancelOrderResult] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.cancel_batch_orders_with_http_info(cancel_batch_order, **kwargs) # noqa: E501 + + def cancel_batch_orders_with_http_info(self, cancel_batch_order, **kwargs): # noqa: E501 + """Cancel batch orders by specified ID list # noqa: E501 + + Multiple currency pairs can be specified, but maximum 20 orders are allowed per 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_orders_with_http_info(cancel_batch_order, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param list[CancelBatchOrder] cancel_batch_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.CancelOrderResult], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'cancel_batch_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 cancel_batch_orders" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'cancel_batch_order' is set + if self.api_client.client_side_validation and ('cancel_batch_order' not in local_var_params or # noqa: E501 + local_var_params['cancel_batch_order'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `cancel_batch_order` when calling `cancel_batch_orders`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + 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 'cancel_batch_order' in local_var_params: + body_params = local_var_params['cancel_batch_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( + '/spot/cancel_batch_orders', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[CancelOrderResult]', # 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_order(self, order_id, currency_pair, **kwargs): # noqa: E501 + """Query single order details # noqa: E501 + + By default, queries orders for spot, unified account, and isolated margin 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.get_order(order_id, currency_pair, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str order_id: The order ID returned when the order was successfully created or the custom ID specified by the user's creation (i.e. the `text` field). Operations based on custom IDs can only be checked in pending orders. Only order ID can be used after the order is finished (transaction/cancel) (required) + :param str currency_pair: Specify the trading pair to query. This field is required when querying pending order records. This field can be omitted when querying filled order records. (required) + :param str account: Specify query account + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.Order + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_order_with_http_info(order_id, currency_pair, **kwargs) # noqa: E501 + + def get_order_with_http_info(self, order_id, currency_pair, **kwargs): # noqa: E501 + """Query single order details # noqa: E501 + + By default, queries orders for spot, unified account, and isolated margin 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.get_order_with_http_info(order_id, currency_pair, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str order_id: The order ID returned when the order was successfully created or the custom ID specified by the user's creation (i.e. the `text` field). Operations based on custom IDs can only be checked in pending orders. Only order ID can be used after the order is finished (transaction/cancel) (required) + :param str currency_pair: Specify the trading pair to query. This field is required when querying pending order records. This field can be omitted when querying filled order records. (required) + :param str account: Specify query account + :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.Order, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'order_id', + 'currency_pair', + 'account' + ] + 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_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_order`") # noqa: E501 + # verify the required parameter 'currency_pair' is set + if self.api_client.client_side_validation and ('currency_pair' not in local_var_params or # noqa: E501 + local_var_params['currency_pair'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `currency_pair` when calling `get_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 = [] + 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 'account' in local_var_params and local_var_params['account'] is not None: # noqa: E501 + query_params.append(('account', local_var_params['account'])) # 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/orders/{order_id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Order', # 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_order(self, order_id, currency_pair, **kwargs): # noqa: E501 + """Cancel single order # noqa: E501 + + By default, orders for spot, unified accounts and leveraged accounts are revoked. # 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_order(order_id, currency_pair, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str order_id: The order ID returned when the order was successfully created or the custom ID specified by the user's creation (i.e. the `text` field). Operations based on custom IDs can only be checked in pending orders. Only order ID can be used after the order is finished (transaction/cancel) (required) + :param str currency_pair: Currency pair (required) + :param str account: Specify query account + :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 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.Order + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.cancel_order_with_http_info(order_id, currency_pair, **kwargs) # noqa: E501 + + def cancel_order_with_http_info(self, order_id, currency_pair, **kwargs): # noqa: E501 + """Cancel single order # noqa: E501 + + By default, orders for spot, unified accounts and leveraged accounts are revoked. # 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_order_with_http_info(order_id, currency_pair, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str order_id: The order ID returned when the order was successfully created or the custom ID specified by the user's creation (i.e. the `text` field). Operations based on custom IDs can only be checked in pending orders. Only order ID can be used after the order is finished (transaction/cancel) (required) + :param str currency_pair: Currency pair (required) + :param str account: Specify query account + :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 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.Order, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'order_id', + 'currency_pair', + 'account', + 'action_mode', + '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 cancel_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_order`") # noqa: E501 + # verify the required parameter 'currency_pair' is set + if self.api_client.client_side_validation and ('currency_pair' not in local_var_params or # noqa: E501 + local_var_params['currency_pair'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `currency_pair` when calling `cancel_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 = [] + 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 'account' in local_var_params and local_var_params['account'] is not None: # noqa: E501 + query_params.append(('account', local_var_params['account'])) # 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 + + 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( + '/spot/orders/{order_id}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Order', # 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_order(self, order_id, order_patch, **kwargs): # noqa: E501 + """Amend single order # noqa: E501 + + Modify orders in spot, unified account and isolated margin account by default. Currently both request body and query support currency_pair and account parameters, but request body has higher priority. currency_pair must be filled in one of the request body or query parameters. About rate limit: Order modification and order creation share the same rate limit rules. About matching priority: Only reducing the quantity does not affect the matching priority. Modifying the price or increasing the quantity will adjust the priority to the end of the new price level. Note: Modifying the quantity to be less than the filled quantity will trigger a cancellation and isolated margin account by default. Currently both request body and query support currency_pair and account parameters, but request body has higher priority. currency_pair must be filled in one of the request body or query parameters. About rate limit: Order modification and order creation share the same rate limit rules. About matching priority: Only reducing the quantity does not affect the matching priority. Modifying the price or increasing the quantity will adjust the priority to the end of the new price level. Note: Modifying the quantity to be less than the filled quantity will trigger a cancellation operation. # 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_order(order_id, order_patch, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str order_id: The order ID returned when the order was successfully created or the custom ID specified by the user's creation (i.e. the `text` field). Operations based on custom IDs can only be checked in pending orders. Only order ID can be used after the order is finished (transaction/cancel) (required) + :param OrderPatch order_patch: (required) + :param str currency_pair: Currency pair + :param str account: Specify query account + :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.Order + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.amend_order_with_http_info(order_id, order_patch, **kwargs) # noqa: E501 + + def amend_order_with_http_info(self, order_id, order_patch, **kwargs): # noqa: E501 + """Amend single order # noqa: E501 + + Modify orders in spot, unified account and isolated margin account by default. Currently both request body and query support currency_pair and account parameters, but request body has higher priority. currency_pair must be filled in one of the request body or query parameters. About rate limit: Order modification and order creation share the same rate limit rules. About matching priority: Only reducing the quantity does not affect the matching priority. Modifying the price or increasing the quantity will adjust the priority to the end of the new price level. Note: Modifying the quantity to be less than the filled quantity will trigger a cancellation and isolated margin account by default. Currently both request body and query support currency_pair and account parameters, but request body has higher priority. currency_pair must be filled in one of the request body or query parameters. About rate limit: Order modification and order creation share the same rate limit rules. About matching priority: Only reducing the quantity does not affect the matching priority. Modifying the price or increasing the quantity will adjust the priority to the end of the new price level. Note: Modifying the quantity to be less than the filled quantity will trigger a cancellation operation. # 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_order_with_http_info(order_id, order_patch, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str order_id: The order ID returned when the order was successfully created or the custom ID specified by the user's creation (i.e. the `text` field). Operations based on custom IDs can only be checked in pending orders. Only order ID can be used after the order is finished (transaction/cancel) (required) + :param OrderPatch order_patch: (required) + :param str currency_pair: Currency pair + :param str account: Specify query account + :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.Order, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'order_id', + 'order_patch', + 'currency_pair', + 'account', + '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_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_order`") # noqa: E501 + # verify the required parameter 'order_patch' is set + if self.api_client.client_side_validation and ('order_patch' not in local_var_params or # noqa: E501 + local_var_params['order_patch'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `order_patch` when calling `amend_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 = [] + 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 'account' in local_var_params and local_var_params['account'] is not None: # noqa: E501 + query_params.append(('account', local_var_params['account'])) # 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 'order_patch' in local_var_params: + body_params = local_var_params['order_patch'] + # 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/orders/{order_id}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Order', # 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_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 + 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) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency_pair: Retrieve results with specified currency pair + :param int limit: Maximum number of items returned in list. Default: 100, minimum: 1, maximum: 1000 + :param int page: Page number + :param str order_id: Filter trades with specified order ID. `currency_pair` is also required if this field is present + :param str account: Specify query account + :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. + :param _request_timeout: timeout setting for 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.Trade] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_my_trades_with_http_info(**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 + 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) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency_pair: Retrieve results with specified currency pair + :param int limit: Maximum number of items returned in list. Default: 100, minimum: 1, maximum: 1000 + :param int page: Page number + :param str order_id: Filter trades with specified order ID. `currency_pair` is also required if this field is present + :param str account: Specify query account + :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 + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.Trade], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'currency_pair', + 'limit', + 'page', + 'order_id', + 'account', + '_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_my_trades" % 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'] > 1000: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `list_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 `list_my_trades`, 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_my_trades`, 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 '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 + 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 'account' in local_var_params and local_var_params['account'] is not None: # noqa: E501 + query_params.append(('account', local_var_params['account'])) # 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 - 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 + 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/cancel_batch_orders', - 'POST', + '/spot/my_trades', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[CancelOrderResult]', # noqa: E501 + response_type='list[Trade]', # 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, + collection_formats=collection_formats) + + def get_system_time(self, **kwargs): # noqa: E501 + """Get server current time # 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_system_time(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.SystemTime + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_system_time_with_http_info(**kwargs) # noqa: E501 + + def get_system_time_with_http_info(self, **kwargs): # noqa: E501 + """Get server current time # 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_system_time_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.SystemTime, 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' + ] ) - def get_order(self, order_id, currency_pair, **kwargs): # noqa: E501 - """Get a single order # noqa: E501 + 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_system_time" % 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( + '/spot/time', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='SystemTime', # 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 countdown_cancel_all_spot(self, countdown_cancel_all_spot_task, **kwargs): # noqa: E501 + """Countdown cancel orders # noqa: E501 - Spot and margin orders are queried by default. If cross margin orders are needed, `account` must be set to `cross_margin` # noqa: E501 + Spot order heartbeat detection. If there is no \"cancel existing countdown\" or \"set new countdown\" when the user-set `timeout` time is reached, the related `spot pending orders` will be automatically cancelled. This interface can be called repeatedly to set a new countdown or cancel the countdown. Usage example: Repeat this interface at 30s intervals, setting the countdown `timeout` to `30 (seconds)` each time. If this interface is not called again within 30 seconds, all pending orders on the `market` you specified will be automatically cancelled. If no `market` is specified, all market cancelled. If the `timeout` is set to 0 within 30 seconds, the countdown timer will be terminated and the automatic order cancellation function will be cancelled. # 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_order(order_id, currency_pair, async_req=True) + >>> thread = api.countdown_cancel_all_spot(countdown_cancel_all_spot_task, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str order_id: Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) - :param str currency_pair: Currency pair (required) - :param str account: Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account + :param CountdownCancelAllSpotTask countdown_cancel_all_spot_task: (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -1867,26 +3053,24 @@ def get_order(self, order_id, currency_pair, **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.Order + :rtype: gate_api.TriggerTime :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.get_order_with_http_info(order_id, currency_pair, **kwargs) # noqa: E501 + return self.countdown_cancel_all_spot_with_http_info(countdown_cancel_all_spot_task, **kwargs) # noqa: E501 - def get_order_with_http_info(self, order_id, currency_pair, **kwargs): # noqa: E501 - """Get a single order # noqa: E501 + def countdown_cancel_all_spot_with_http_info(self, countdown_cancel_all_spot_task, **kwargs): # noqa: E501 + """Countdown cancel orders # noqa: E501 - Spot and margin orders are queried by default. If cross margin orders are needed, `account` must be set to `cross_margin` # noqa: E501 + Spot order heartbeat detection. If there is no \"cancel existing countdown\" or \"set new countdown\" when the user-set `timeout` time is reached, the related `spot pending orders` will be automatically cancelled. This interface can be called repeatedly to set a new countdown or cancel the countdown. Usage example: Repeat this interface at 30s intervals, setting the countdown `timeout` to `30 (seconds)` each time. If this interface is not called again within 30 seconds, all pending orders on the `market` you specified will be automatically cancelled. If no `market` is specified, all market cancelled. If the `timeout` is set to 0 within 30 seconds, the countdown timer will be terminated and the automatic order cancellation function will be cancelled. # 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_order_with_http_info(order_id, currency_pair, async_req=True) + >>> thread = api.countdown_cancel_all_spot_with_http_info(countdown_cancel_all_spot_task, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str order_id: Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) - :param str currency_pair: Currency pair (required) - :param str account: Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account + :param CountdownCancelAllSpotTask countdown_cancel_all_spot_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 @@ -1896,43 +3080,43 @@ def get_order_with_http_info(self, order_id, currency_pair, **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.Order, 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. """ local_var_params = locals() - all_params = ['order_id', 'currency_pair', 'account'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'countdown_cancel_all_spot_task' + ] + 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_order" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method countdown_cancel_all_spot" % 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 local_var_params['order_id'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError("Missing the required parameter `order_id` when calling `get_order`") # noqa: E501 - # verify the required parameter 'currency_pair' is set - if self.api_client.client_side_validation and ( - 'currency_pair' not in local_var_params or local_var_params['currency_pair'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError("Missing the required parameter `currency_pair` when calling `get_order`") # noqa: E501 + # verify the required parameter 'countdown_cancel_all_spot_task' is set + if self.api_client.client_side_validation and ('countdown_cancel_all_spot_task' not in local_var_params or # noqa: E501 + local_var_params['countdown_cancel_all_spot_task'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `countdown_cancel_all_spot_task` when calling `countdown_cancel_all_spot`") # 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 '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 'account' in local_var_params and local_var_params['account'] is not None: # noqa: E501 - query_params.append(('account', local_var_params['account'])) # noqa: E501 header_params = {} @@ -1940,43 +3124,47 @@ def get_order_with_http_info(self, order_id, currency_pair, **kwargs): # noqa: local_var_files = {} body_params = None + if 'countdown_cancel_all_spot_task' in local_var_params: + body_params = local_var_params['countdown_cancel_all_spot_task'] # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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/orders/{order_id}', - 'GET', + '/spot/countdown_cancel_all', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='Order', # 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 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats, - ) + collection_formats=collection_formats) - def cancel_order(self, order_id, currency_pair, **kwargs): # noqa: E501 - """Cancel a single order # noqa: E501 + def amend_batch_orders(self, batch_amend_item, **kwargs): # noqa: E501 + """Batch modification of orders # noqa: E501 - Spot and margin orders are cancelled by default. If trying to cancel cross margin orders, `account` must be set to `cross_margin` # noqa: E501 + Modify orders in spot, unified account and isolated margin account by default. Modify uncompleted orders, up to 5 orders can be modified at a time. Request parameters should be passed in array format. If there are order modification failures during the batch modification process, the modification of the next order will continue to be executed, and the execution will return with the corresponding order failure information. The call order of batch modification orders is consistent with the order list order. The return content order of batch modification orders is consistent with the order list 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_order(order_id, currency_pair, async_req=True) + >>> thread = api.amend_batch_orders(batch_amend_item, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str order_id: Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) - :param str currency_pair: Currency pair (required) - :param str account: Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account + :param list[BatchAmendItem] batch_amend_item: (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. @@ -1984,26 +3172,25 @@ def cancel_order(self, order_id, currency_pair, **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.Order + :rtype: list[gate_api.BatchOrder] :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.cancel_order_with_http_info(order_id, currency_pair, **kwargs) # noqa: E501 + return self.amend_batch_orders_with_http_info(batch_amend_item, **kwargs) # noqa: E501 - def cancel_order_with_http_info(self, order_id, currency_pair, **kwargs): # noqa: E501 - """Cancel a single order # noqa: E501 + def amend_batch_orders_with_http_info(self, batch_amend_item, **kwargs): # noqa: E501 + """Batch modification of orders # noqa: E501 - Spot and margin orders are cancelled by default. If trying to cancel cross margin orders, `account` must be set to `cross_margin` # noqa: E501 + Modify orders in spot, unified account and isolated margin account by default. Modify uncompleted orders, up to 5 orders can be modified at a time. Request parameters should be passed in array format. If there are order modification failures during the batch modification process, the modification of the next order will continue to be executed, and the execution will return with the corresponding order failure information. The call order of batch modification orders is consistent with the order list order. The return content order of batch modification orders is consistent with the order list 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_order_with_http_info(order_id, currency_pair, async_req=True) + >>> thread = api.amend_batch_orders_with_http_info(batch_amend_item, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str order_id: Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID are accepted only in the first 30 minutes after order creation.After that, only order ID is accepted. (required) - :param str currency_pair: Currency pair (required) - :param str account: Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account + :param list[BatchAmendItem] batch_amend_item: (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 @@ -2013,93 +3200,97 @@ def cancel_order_with_http_info(self, order_id, currency_pair, **kwargs): # noq number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: tuple(gate_api.Order, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(list[gate_api.BatchOrder], status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ local_var_params = locals() - all_params = ['order_id', 'currency_pair', 'account'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'batch_amend_item', + '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 cancel_order" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method amend_batch_orders" % 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 local_var_params['order_id'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError("Missing the required parameter `order_id` when calling `cancel_order`") # noqa: E501 - # verify the required parameter 'currency_pair' is set - if self.api_client.client_side_validation and ( - 'currency_pair' not in local_var_params or local_var_params['currency_pair'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `currency_pair` when calling `cancel_order`" - ) # noqa: E501 + # verify the required parameter 'batch_amend_item' is set + if self.api_client.client_side_validation and ('batch_amend_item' not in local_var_params or # noqa: E501 + local_var_params['batch_amend_item'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `batch_amend_item` when calling `amend_batch_orders`") # 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 '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 'account' in local_var_params and local_var_params['account'] is not None: # noqa: E501 - query_params.append(('account', local_var_params['account'])) # 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 'batch_amend_item' in local_var_params: + body_params = local_var_params['batch_amend_item'] # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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/orders/{order_id}', - 'DELETE', + '/spot/amend_batch_orders', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='Order', # noqa: E501 + response_type='list[BatchOrder]', # 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, - ) + collection_formats=collection_formats) - def list_my_trades(self, currency_pair, **kwargs): # noqa: E501 - """List personal trading history # noqa: E501 + def get_spot_insurance_history(self, business, currency, _from, to, **kwargs): # noqa: E501 + """Query spot insurance fund historical data # noqa: E501 - Spot and margin trades are queried by default. If cross margin trades are needed, `account` must be set to `cross_margin` You can also set `from` and(or) `to` to query by time range Time range parameters are handled as order finish time. # 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(currency_pair, async_req=True) + >>> thread = api.get_spot_insurance_history(business, currency, _from, to, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str currency_pair: Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones. (required) - :param int limit: Maximum number of records to be returned in a single list + :param str business: Leverage business, margin - position by position; unified - unified account (required) + :param str currency: Currency (required) + :param int _from: Start timestamp in seconds (required) + :param int to: End timestamp in seconds (required) :param int page: Page number - :param str order_id: Filter trades with specified order ID. `currency_pair` is also required if this field is present - :param str account: Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account - :param int _from: Start timestamp of the query - :param int to: Time range ending, default to current time + :param int limit: The maximum number of items returned in the list, the default value is 30 :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -2107,30 +3298,28 @@ def list_my_trades(self, currency_pair, **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.Trade] + :rtype: list[gate_api.SpotInsuranceHistory] :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.list_my_trades_with_http_info(currency_pair, **kwargs) # noqa: E501 + return self.get_spot_insurance_history_with_http_info(business, currency, _from, to, **kwargs) # noqa: E501 - def list_my_trades_with_http_info(self, currency_pair, **kwargs): # noqa: E501 - """List personal trading history # noqa: E501 + def get_spot_insurance_history_with_http_info(self, business, currency, _from, to, **kwargs): # noqa: E501 + """Query spot insurance fund historical data # noqa: E501 - Spot and margin trades are queried by default. If cross margin trades are needed, `account` must be set to `cross_margin` You can also set `from` and(or) `to` to query by time range Time range parameters are handled as order finish time. # 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(currency_pair, async_req=True) + >>> thread = api.get_spot_insurance_history_with_http_info(business, currency, _from, to, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str currency_pair: Retrieve results with specified currency pair. It is required for open orders, but optional for finished ones. (required) - :param int limit: Maximum number of records to be returned in a single list + :param str business: Leverage business, margin - position by position; unified - unified account (required) + :param str currency: Currency (required) + :param int _from: Start timestamp in seconds (required) + :param int to: End timestamp in seconds (required) :param int page: Page number - :param str order_id: Filter trades with specified order ID. `currency_pair` is also required if this field is present - :param str account: Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account - :param int _from: Start timestamp of the query - :param int to: Time range ending, default to current time + :param int limit: The maximum number of items returned in the list, the default value is 30 :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -2140,62 +3329,74 @@ def list_my_trades_with_http_info(self, currency_pair, **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.Trade], status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(list[gate_api.SpotInsuranceHistory], status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ local_var_params = locals() - all_params = ['currency_pair', 'limit', 'page', 'order_id', 'account', '_from', 'to'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'business', + 'currency', + '_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_my_trades" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_spot_insurance_history" % k + ) local_var_params[k] = v del local_var_params['kwargs'] - # verify the required parameter 'currency_pair' is set - if self.api_client.client_side_validation and ( - 'currency_pair' not in local_var_params or local_var_params['currency_pair'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `currency_pair` when calling `list_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 `list_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 `list_my_trades`, 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_my_trades`, must be a value greater than or equal to `1`" - ) # noqa: E501 + # verify the required parameter 'business' is set + if self.api_client.client_side_validation and ('business' not in local_var_params or # noqa: E501 + local_var_params['business'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `business` when calling `get_spot_insurance_history`") # noqa: E501 + # 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 `get_spot_insurance_history`") # 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 `get_spot_insurance_history`") # noqa: E501 + # verify the required parameter 'to' is set + if self.api_client.client_side_validation and ('to' not in local_var_params or # noqa: E501 + local_var_params['to'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `to` when calling `get_spot_insurance_history`") # 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 `get_spot_insurance_history`, 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 `get_spot_insurance_history`, 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_spot_insurance_history`, 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 '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 'business' in local_var_params and local_var_params['business'] is not None: # noqa: E501 + query_params.append(('business', local_var_params['business'])) # 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 '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 '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 'account' in local_var_params and local_var_params['account'] is not None: # noqa: E501 - query_params.append(('account', local_var_params['account'])) # 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 @@ -2208,31 +3409,30 @@ def list_my_trades_with_http_info(self, currency_pair, **kwargs): # noqa: E501 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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( - '/spot/my_trades', - 'GET', + '/spot/insurance_history', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[Trade]', # noqa: E501 + response_type='list[SpotInsuranceHistory]', # 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, - ) + collection_formats=collection_formats) def list_spot_price_triggered_orders(self, status, **kwargs): # noqa: E501 - """Retrieve running auto order list # noqa: E501 + """Query running auto order list # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -2240,10 +3440,10 @@ def list_spot_price_triggered_orders(self, status, **kwargs): # noqa: E501 >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str status: Only list the orders with this status (required) - :param str market: Currency pair - :param str account: Trading account - :param int limit: Maximum number of records to be returned in a single list + :param str status: Query order list based on status (required) + :param str market: Trading market + :param str account: Trading account type. Unified account must be set to `unified` + :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 @@ -2260,7 +3460,7 @@ def list_spot_price_triggered_orders(self, status, **kwargs): # noqa: E501 return self.list_spot_price_triggered_orders_with_http_info(status, **kwargs) # noqa: E501 def list_spot_price_triggered_orders_with_http_info(self, status, **kwargs): # noqa: E501 - """Retrieve running auto order list # noqa: E501 + """Query running auto order list # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -2268,10 +3468,10 @@ def list_spot_price_triggered_orders_with_http_info(self, status, **kwargs): # >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str status: Only list the orders with this status (required) - :param str market: Currency pair - :param str account: Trading account - :param int limit: Maximum number of records to be returned in a single list + :param str status: Query order list based on status (required) + :param str market: Trading market + :param str account: Trading account type. Unified account must be set to `unified` + :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 @@ -2289,42 +3489,41 @@ def list_spot_price_triggered_orders_with_http_info(self, status, **kwargs): # local_var_params = locals() - all_params = ['status', 'market', 'account', 'limit', 'offset'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'status', + 'market', + 'account', + '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_spot_price_triggered_orders" % k + "Got an unexpected keyword argument '%s'" + " to method list_spot_price_triggered_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 local_var_params['status'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `status` when calling `list_spot_price_triggered_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_spot_price_triggered_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_price_triggered_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_spot_price_triggered_orders`, must be a value greater than or equal to `0`" - ) # noqa: E501 + 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_price_triggered_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_spot_price_triggered_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_price_triggered_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_spot_price_triggered_orders`, must be a value greater than or equal to `0`") # noqa: E501 collection_formats = {} path_params = {} @@ -2348,14 +3547,14 @@ def list_spot_price_triggered_orders_with_http_info(self, status, **kwargs): # body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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/price_orders', - 'GET', + '/spot/price_orders', 'GET', path_params, query_params, header_params, @@ -2368,11 +3567,10 @@ def list_spot_price_triggered_orders_with_http_info(self, status, **kwargs): # _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, - ) + collection_formats=collection_formats) def create_spot_price_triggered_order(self, spot_price_triggered_order, **kwargs): # noqa: E501 - """Create a price-triggered order # noqa: E501 + """Create price-triggered order # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -2396,7 +3594,7 @@ def create_spot_price_triggered_order(self, spot_price_triggered_order, **kwargs return self.create_spot_price_triggered_order_with_http_info(spot_price_triggered_order, **kwargs) # noqa: E501 def create_spot_price_triggered_order_with_http_info(self, spot_price_triggered_order, **kwargs): # noqa: E501 - """Create a price-triggered order # noqa: E501 + """Create price-triggered order # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -2421,24 +3619,30 @@ def create_spot_price_triggered_order_with_http_info(self, spot_price_triggered_ local_var_params = locals() - all_params = ['spot_price_triggered_order'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'spot_price_triggered_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_spot_price_triggered_order" % k + "Got an unexpected keyword argument '%s'" + " to method create_spot_price_triggered_order" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'spot_price_triggered_order' is set - if self.api_client.client_side_validation and ( - 'spot_price_triggered_order' not in local_var_params - or local_var_params['spot_price_triggered_order'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `spot_price_triggered_order` when calling `create_spot_price_triggered_order`" - ) # noqa: E501 + if self.api_client.client_side_validation and ('spot_price_triggered_order' not in local_var_params or # noqa: E501 + local_var_params['spot_price_triggered_order'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `spot_price_triggered_order` when calling `create_spot_price_triggered_order`") # noqa: E501 collection_formats = {} @@ -2455,19 +3659,18 @@ def create_spot_price_triggered_order_with_http_info(self, spot_price_triggered_ if 'spot_price_triggered_order' in local_var_params: body_params = local_var_params['spot_price_triggered_order'] # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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 + ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( - '/spot/price_orders', - 'POST', + '/spot/price_orders', 'POST', path_params, query_params, header_params, @@ -2480,11 +3683,10 @@ def create_spot_price_triggered_order_with_http_info(self, spot_price_triggered_ _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, - ) + collection_formats=collection_formats) def cancel_spot_price_triggered_order_list(self, **kwargs): # noqa: E501 - """Cancel all open orders # noqa: E501 + """Cancel all auto orders # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -2492,8 +3694,8 @@ def cancel_spot_price_triggered_order_list(self, **kwargs): # noqa: E501 >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str market: Currency pair - :param str account: Trading account + :param str market: Trading market + :param str account: Trading account type. Unified account must be set to `unified` :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -2509,7 +3711,7 @@ def cancel_spot_price_triggered_order_list(self, **kwargs): # noqa: E501 return self.cancel_spot_price_triggered_order_list_with_http_info(**kwargs) # noqa: E501 def cancel_spot_price_triggered_order_list_with_http_info(self, **kwargs): # noqa: E501 - """Cancel all open orders # noqa: E501 + """Cancel all auto orders # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -2517,8 +3719,8 @@ def cancel_spot_price_triggered_order_list_with_http_info(self, **kwargs): # no >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str market: Currency pair - :param str account: Trading account + :param str market: Trading market + :param str account: Trading account type. Unified account must be set to `unified` :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -2535,13 +3737,24 @@ def cancel_spot_price_triggered_order_list_with_http_info(self, **kwargs): # no local_var_params = locals() - all_params = ['market', 'account'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'market', + 'account' + ] + 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_price_triggered_order_list" % k + "Got an unexpected keyword argument '%s'" + " to method cancel_spot_price_triggered_order_list" % k ) local_var_params[k] = v del local_var_params['kwargs'] @@ -2563,14 +3776,14 @@ def cancel_spot_price_triggered_order_list_with_http_info(self, **kwargs): # no body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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/price_orders', - 'DELETE', + '/spot/price_orders', 'DELETE', path_params, query_params, header_params, @@ -2583,11 +3796,10 @@ def cancel_spot_price_triggered_order_list_with_http_info(self, **kwargs): # no _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, - ) + collection_formats=collection_formats) def get_spot_price_triggered_order(self, order_id, **kwargs): # noqa: E501 - """Get a single order # noqa: E501 + """Query single auto order details # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -2595,7 +3807,7 @@ def get_spot_price_triggered_order(self, order_id, **kwargs): # noqa: E501 >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str order_id: Retrieve the data of the order with the specified ID (required) + :param str 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. @@ -2611,7 +3823,7 @@ def get_spot_price_triggered_order(self, order_id, **kwargs): # noqa: E501 return self.get_spot_price_triggered_order_with_http_info(order_id, **kwargs) # noqa: E501 def get_spot_price_triggered_order_with_http_info(self, order_id, **kwargs): # noqa: E501 - """Get a single order # noqa: E501 + """Query single auto order details # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -2619,7 +3831,7 @@ def get_spot_price_triggered_order_with_http_info(self, order_id, **kwargs): # >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str order_id: Retrieve the data of the order with the specified ID (required) + :param str 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 @@ -2636,23 +3848,30 @@ def get_spot_price_triggered_order_with_http_info(self, order_id, **kwargs): # local_var_params = locals() - all_params = ['order_id'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + 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_price_triggered_order" % k + "Got an unexpected keyword argument '%s'" + " to method get_spot_price_triggered_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 local_var_params['order_id'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `order_id` when calling `get_spot_price_triggered_order`" - ) # noqa: E501 + 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_price_triggered_order`") # noqa: E501 collection_formats = {} @@ -2669,14 +3888,14 @@ def get_spot_price_triggered_order_with_http_info(self, order_id, **kwargs): # body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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/price_orders/{order_id}', - 'GET', + '/spot/price_orders/{order_id}', 'GET', path_params, query_params, header_params, @@ -2689,11 +3908,10 @@ def get_spot_price_triggered_order_with_http_info(self, order_id, **kwargs): # _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, - ) + collection_formats=collection_formats) def cancel_spot_price_triggered_order(self, order_id, **kwargs): # noqa: E501 - """Cancel a single order # 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 @@ -2701,7 +3919,7 @@ def cancel_spot_price_triggered_order(self, order_id, **kwargs): # noqa: E501 >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str order_id: Retrieve the data of the order with the specified ID (required) + :param str 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. @@ -2717,7 +3935,7 @@ def cancel_spot_price_triggered_order(self, order_id, **kwargs): # noqa: E501 return self.cancel_spot_price_triggered_order_with_http_info(order_id, **kwargs) # noqa: E501 def cancel_spot_price_triggered_order_with_http_info(self, order_id, **kwargs): # noqa: E501 - """Cancel a single order # 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 @@ -2725,7 +3943,7 @@ def cancel_spot_price_triggered_order_with_http_info(self, order_id, **kwargs): >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str order_id: Retrieve the data of the order with the specified ID (required) + :param str 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 @@ -2742,23 +3960,30 @@ def cancel_spot_price_triggered_order_with_http_info(self, order_id, **kwargs): local_var_params = locals() - all_params = ['order_id'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + 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_price_triggered_order" % k + "Got an unexpected keyword argument '%s'" + " to method cancel_spot_price_triggered_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 local_var_params['order_id'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `order_id` when calling `cancel_spot_price_triggered_order`" - ) # noqa: E501 + 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_price_triggered_order`") # noqa: E501 collection_formats = {} @@ -2775,14 +4000,14 @@ def cancel_spot_price_triggered_order_with_http_info(self, order_id, **kwargs): body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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/price_orders/{order_id}', - 'DELETE', + '/spot/price_orders/{order_id}', 'DELETE', path_params, query_params, header_params, @@ -2795,5 +4020,4 @@ def cancel_spot_price_triggered_order_with_http_info(self, order_id, **kwargs): _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, - ) + collection_formats=collection_formats) diff --git a/gate_api/api/sub_account_api.py b/gate_api/api/sub_account_api.py new file mode 100644 index 0000000..2c864c3 --- /dev/null +++ b/gate_api/api/sub_account_api.py @@ -0,0 +1,1299 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market 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 SubAccountApi(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_sub_accounts(self, **kwargs): # noqa: E501 + """List sub-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_sub_accounts(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str type: Enter `0` to list all types of sub-accounts (currently supporting cross-margin sub-accounts and regular sub-accounts). Enter `1` to query regular sub-accounts only. If no parameter is passed, only regular sub-accounts will be queried by 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: list[gate_api.SubAccount] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_sub_accounts_with_http_info(**kwargs) # noqa: E501 + + def list_sub_accounts_with_http_info(self, **kwargs): # noqa: E501 + """List sub-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_sub_accounts_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str type: Enter `0` to list all types of sub-accounts (currently supporting cross-margin sub-accounts and regular sub-accounts). Enter `1` to query regular sub-accounts only. If no parameter is passed, only regular sub-accounts will be queried by 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(list[gate_api.SubAccount], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + '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_sub_accounts" % 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 + + 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( + '/sub_accounts', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[SubAccount]', # 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_sub_accounts(self, sub_account, **kwargs): # noqa: E501 + """Create a new sub-account # 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_sub_accounts(sub_account, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param SubAccount sub_account: (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.SubAccount + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.create_sub_accounts_with_http_info(sub_account, **kwargs) # noqa: E501 + + def create_sub_accounts_with_http_info(self, sub_account, **kwargs): # noqa: E501 + """Create a new sub-account # 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_sub_accounts_with_http_info(sub_account, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param SubAccount sub_account: (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.SubAccount, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'sub_account' + ] + 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_sub_accounts" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'sub_account' is set + if self.api_client.client_side_validation and ('sub_account' not in local_var_params or # noqa: E501 + local_var_params['sub_account'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `sub_account` when calling `create_sub_accounts`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'sub_account' in local_var_params: + body_params = local_var_params['sub_account'] + # 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( + '/sub_accounts', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='SubAccount', # 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_sub_account(self, user_id, **kwargs): # noqa: E501 + """Get sub-account # 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_sub_account(user_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int user_id: Sub-account user 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.SubAccount + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_sub_account_with_http_info(user_id, **kwargs) # noqa: E501 + + def get_sub_account_with_http_info(self, user_id, **kwargs): # noqa: E501 + """Get sub-account # 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_sub_account_with_http_info(user_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int user_id: Sub-account user 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.SubAccount, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'user_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_sub_account" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'user_id' is set + if self.api_client.client_side_validation and ('user_id' not in local_var_params or # noqa: E501 + local_var_params['user_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `user_id` when calling `get_sub_account`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'user_id' in local_var_params: + path_params['user_id'] = local_var_params['user_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( + '/sub_accounts/{user_id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='SubAccount', # 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_sub_account_keys(self, user_id, **kwargs): # noqa: E501 + """List all API key pairs of the sub-account # 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_sub_account_keys(user_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int user_id: Sub-account user 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.SubAccountKey] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_sub_account_keys_with_http_info(user_id, **kwargs) # noqa: E501 + + def list_sub_account_keys_with_http_info(self, user_id, **kwargs): # noqa: E501 + """List all API key pairs of the sub-account # 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_sub_account_keys_with_http_info(user_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int user_id: Sub-account user 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.SubAccountKey], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'user_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_sub_account_keys" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'user_id' is set + if self.api_client.client_side_validation and ('user_id' not in local_var_params or # noqa: E501 + local_var_params['user_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `user_id` when calling `list_sub_account_keys`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'user_id' in local_var_params: + path_params['user_id'] = local_var_params['user_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( + '/sub_accounts/{user_id}/keys', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[SubAccountKey]', # 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_sub_account_keys(self, user_id, sub_account_key, **kwargs): # noqa: E501 + """Create new sub-account API key pair # 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_sub_account_keys(user_id, sub_account_key, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int user_id: Sub-account user ID (required) + :param SubAccountKey sub_account_key: (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.SubAccountKey + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.create_sub_account_keys_with_http_info(user_id, sub_account_key, **kwargs) # noqa: E501 + + def create_sub_account_keys_with_http_info(self, user_id, sub_account_key, **kwargs): # noqa: E501 + """Create new sub-account API key pair # 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_sub_account_keys_with_http_info(user_id, sub_account_key, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int user_id: Sub-account user ID (required) + :param SubAccountKey sub_account_key: (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.SubAccountKey, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'user_id', + 'sub_account_key' + ] + 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_sub_account_keys" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'user_id' is set + if self.api_client.client_side_validation and ('user_id' not in local_var_params or # noqa: E501 + local_var_params['user_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `user_id` when calling `create_sub_account_keys`") # noqa: E501 + # verify the required parameter 'sub_account_key' is set + if self.api_client.client_side_validation and ('sub_account_key' not in local_var_params or # noqa: E501 + local_var_params['sub_account_key'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `sub_account_key` when calling `create_sub_account_keys`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'user_id' in local_var_params: + path_params['user_id'] = local_var_params['user_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'sub_account_key' in local_var_params: + body_params = local_var_params['sub_account_key'] + # 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( + '/sub_accounts/{user_id}/keys', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='SubAccountKey', # 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_sub_account_key(self, user_id, key, **kwargs): # noqa: E501 + """Get specific API key pair of the sub-account # 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_sub_account_key(user_id, key, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int user_id: Sub-account user ID (required) + :param str key: Sub-account API key (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.SubAccountKey + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_sub_account_key_with_http_info(user_id, key, **kwargs) # noqa: E501 + + def get_sub_account_key_with_http_info(self, user_id, key, **kwargs): # noqa: E501 + """Get specific API key pair of the sub-account # 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_sub_account_key_with_http_info(user_id, key, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int user_id: Sub-account user ID (required) + :param str key: Sub-account API key (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.SubAccountKey, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'user_id', + 'key' + ] + 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_sub_account_key" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'user_id' is set + if self.api_client.client_side_validation and ('user_id' not in local_var_params or # noqa: E501 + local_var_params['user_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `user_id` when calling `get_sub_account_key`") # noqa: E501 + # verify the required parameter 'key' is set + if self.api_client.client_side_validation and ('key' not in local_var_params or # noqa: E501 + local_var_params['key'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `key` when calling `get_sub_account_key`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'user_id' in local_var_params: + path_params['user_id'] = local_var_params['user_id'] # noqa: E501 + if 'key' in local_var_params: + path_params['key'] = local_var_params['key'] # 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( + '/sub_accounts/{user_id}/keys/{key}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='SubAccountKey', # 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_sub_account_keys(self, user_id, key, sub_account_key, **kwargs): # noqa: E501 + """Update sub-account API key pair # 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_sub_account_keys(user_id, key, sub_account_key, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int user_id: Sub-account user ID (required) + :param str key: Sub-account API key (required) + :param SubAccountKey sub_account_key: (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_sub_account_keys_with_http_info(user_id, key, sub_account_key, **kwargs) # noqa: E501 + + def update_sub_account_keys_with_http_info(self, user_id, key, sub_account_key, **kwargs): # noqa: E501 + """Update sub-account API key pair # 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_sub_account_keys_with_http_info(user_id, key, sub_account_key, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int user_id: Sub-account user ID (required) + :param str key: Sub-account API key (required) + :param SubAccountKey sub_account_key: (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 = [ + 'user_id', + 'key', + 'sub_account_key' + ] + 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_sub_account_keys" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'user_id' is set + if self.api_client.client_side_validation and ('user_id' not in local_var_params or # noqa: E501 + local_var_params['user_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `user_id` when calling `update_sub_account_keys`") # noqa: E501 + # verify the required parameter 'key' is set + if self.api_client.client_side_validation and ('key' not in local_var_params or # noqa: E501 + local_var_params['key'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `key` when calling `update_sub_account_keys`") # noqa: E501 + # verify the required parameter 'sub_account_key' is set + if self.api_client.client_side_validation and ('sub_account_key' not in local_var_params or # noqa: E501 + local_var_params['sub_account_key'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `sub_account_key` when calling `update_sub_account_keys`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'user_id' in local_var_params: + path_params['user_id'] = local_var_params['user_id'] # noqa: E501 + if 'key' in local_var_params: + path_params['key'] = local_var_params['key'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'sub_account_key' in local_var_params: + body_params = local_var_params['sub_account_key'] + # 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( + '/sub_accounts/{user_id}/keys/{key}', 'PUT', + 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 delete_sub_account_keys(self, user_id, key, **kwargs): # noqa: E501 + """Delete sub-account API key pair # 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_sub_account_keys(user_id, key, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int user_id: Sub-account user ID (required) + :param str key: Sub-account API key (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.delete_sub_account_keys_with_http_info(user_id, key, **kwargs) # noqa: E501 + + def delete_sub_account_keys_with_http_info(self, user_id, key, **kwargs): # noqa: E501 + """Delete sub-account API key pair # 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_sub_account_keys_with_http_info(user_id, key, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int user_id: Sub-account user ID (required) + :param str key: Sub-account API key (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 = [ + 'user_id', + 'key' + ] + 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_sub_account_keys" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'user_id' is set + if self.api_client.client_side_validation and ('user_id' not in local_var_params or # noqa: E501 + local_var_params['user_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `user_id` when calling `delete_sub_account_keys`") # noqa: E501 + # verify the required parameter 'key' is set + if self.api_client.client_side_validation and ('key' not in local_var_params or # noqa: E501 + local_var_params['key'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `key` when calling `delete_sub_account_keys`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'user_id' in local_var_params: + path_params['user_id'] = local_var_params['user_id'] # noqa: E501 + if 'key' in local_var_params: + path_params['key'] = local_var_params['key'] # noqa: E501 + + 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( + '/sub_accounts/{user_id}/keys/{key}', 'DELETE', + 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 lock_sub_account(self, user_id, **kwargs): # noqa: E501 + """Lock sub-account # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.lock_sub_account(user_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int user_id: Sub-account user 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: None + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.lock_sub_account_with_http_info(user_id, **kwargs) # noqa: E501 + + def lock_sub_account_with_http_info(self, user_id, **kwargs): # noqa: E501 + """Lock sub-account # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.lock_sub_account_with_http_info(user_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int user_id: Sub-account user 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: None + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'user_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 lock_sub_account" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'user_id' is set + if self.api_client.client_side_validation and ('user_id' not in local_var_params or # noqa: E501 + local_var_params['user_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `user_id` when calling `lock_sub_account`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'user_id' in local_var_params: + path_params['user_id'] = local_var_params['user_id'] # noqa: E501 + + 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( + '/sub_accounts/{user_id}/lock', '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 unlock_sub_account(self, user_id, **kwargs): # noqa: E501 + """Unlock sub-account # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.unlock_sub_account(user_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int user_id: Sub-account user 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: None + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.unlock_sub_account_with_http_info(user_id, **kwargs) # noqa: E501 + + def unlock_sub_account_with_http_info(self, user_id, **kwargs): # noqa: E501 + """Unlock sub-account # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.unlock_sub_account_with_http_info(user_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int user_id: Sub-account user 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: None + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'user_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 unlock_sub_account" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'user_id' is set + if self.api_client.client_side_validation and ('user_id' not in local_var_params or # noqa: E501 + local_var_params['user_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `user_id` when calling `unlock_sub_account`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'user_id' in local_var_params: + path_params['user_id'] = local_var_params['user_id'] # noqa: E501 + + 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( + '/sub_accounts/{user_id}/unlock', '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_unified_mode(self, **kwargs): # noqa: E501 + """Get sub-account mode # noqa: E501 + + Unified account mode: - `classic`: Classic account mode - `multi_currency`: Multi-currency margin mode - `portfolio`: 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.list_unified_mode(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.SubUserMode] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_unified_mode_with_http_info(**kwargs) # noqa: E501 + + def list_unified_mode_with_http_info(self, **kwargs): # noqa: E501 + """Get sub-account mode # noqa: E501 + + Unified account mode: - `classic`: Classic account mode - `multi_currency`: Multi-currency margin mode - `portfolio`: 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.list_unified_mode_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.SubUserMode], 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_unified_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 + # 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( + '/sub_accounts/unified_mode', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[SubUserMode]', # 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 new file mode 100644 index 0000000..a6deb68 --- /dev/null +++ b/gate_api/api/unified_api.py @@ -0,0 +1,2582 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market 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 UnifiedApi(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_unified_accounts(self, **kwargs): # noqa: E501 + """Get unified account information # noqa: E501 + + The assets of each currency in the account will be adjusted according to their liquidity, defined by corresponding adjustment coefficients, and then uniformly converted to USD to calculate the total asset value and position value of the account. For specific formulas, please refer to [Margin Formula](#margin-formula) # 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_unified_accounts(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency: Query by specified currency name + :param str sub_uid: Sub account user 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.UnifiedAccount + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_unified_accounts_with_http_info(**kwargs) # noqa: E501 + + def list_unified_accounts_with_http_info(self, **kwargs): # noqa: E501 + """Get unified account information # noqa: E501 + + The assets of each currency in the account will be adjusted according to their liquidity, defined by corresponding adjustment coefficients, and then uniformly converted to USD to calculate the total asset value and position value of the account. For specific formulas, please refer to [Margin Formula](#margin-formula) # 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_unified_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 str sub_uid: Sub account user 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.UnifiedAccount, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'currency', + 'sub_uid' + ] + 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_unified_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 + 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 + + 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/accounts', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='UnifiedAccount', # 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_borrowable(self, currency, **kwargs): # noqa: E501 + """Query maximum borrowable amount for unified account # 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_borrowable(currency, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency: Query by specified currency name (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.UnifiedBorrowable + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_unified_borrowable_with_http_info(currency, **kwargs) # noqa: E501 + + def get_unified_borrowable_with_http_info(self, currency, **kwargs): # noqa: E501 + """Query maximum borrowable amount for unified account # 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_borrowable_with_http_info(currency, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency: Query by specified currency name (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.UnifiedBorrowable, 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 get_unified_borrowable" % k + ) + 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 `get_unified_borrowable`") # 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 + + 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/borrowable', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='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 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_unified_transferable(self, currency, **kwargs): # noqa: E501 + """Query maximum transferable amount for unified account # 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_transferable(currency, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency: Query by specified currency name (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.UnifiedTransferable + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_unified_transferable_with_http_info(currency, **kwargs) # noqa: E501 + + def get_unified_transferable_with_http_info(self, currency, **kwargs): # noqa: E501 + """Query maximum transferable amount for unified account # 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_transferable_with_http_info(currency, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency: Query by specified currency name (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.UnifiedTransferable, 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 get_unified_transferable" % k + ) + 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 `get_unified_transferable`") # 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 + + 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/transferable', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='UnifiedTransferable', # 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_transferables(self, currencies, **kwargs): # noqa: E501 + """Batch query maximum transferable amount for unified accounts. Each currency shows the maximum value. After user withdrawal, the transferable amount for all currencies will change # 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_transferables(currencies, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currencies: Specify the currency name to query in batches, and support up to 100 pass parameters at a time (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.TransferablesResult] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_unified_transferables_with_http_info(currencies, **kwargs) # noqa: E501 + + def get_unified_transferables_with_http_info(self, currencies, **kwargs): # noqa: E501 + """Batch query maximum transferable amount for unified accounts. Each currency shows the maximum value. After user withdrawal, the transferable amount for all currencies will change # 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_transferables_with_http_info(currencies, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currencies: Specify the currency name to query in batches, and support up to 100 pass parameters at a time (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.TransferablesResult], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'currencies' + ] + 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_transferables" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'currencies' is set + if self.api_client.client_side_validation and ('currencies' not in local_var_params or # noqa: E501 + local_var_params['currencies'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `currencies` when calling `get_unified_transferables`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'currencies' in local_var_params and local_var_params['currencies'] is not None: # noqa: E501 + query_params.append(('currencies', local_var_params['currencies'])) # 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( + '/unified/transferables', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[TransferablesResult]', # 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_borrowable_list(self, currencies, **kwargs): # noqa: E501 + """Batch query unified account maximum borrowable 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_unified_borrowable_list(currencies, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param list[str] currencies: Specify currency names for querying in an array, separated by commas, maximum 10 currencies (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.UnifiedBorrowable1] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_unified_borrowable_list_with_http_info(currencies, **kwargs) # noqa: E501 + + def get_unified_borrowable_list_with_http_info(self, currencies, **kwargs): # noqa: E501 + """Batch query unified account maximum borrowable 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_unified_borrowable_list_with_http_info(currencies, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param list[str] currencies: Specify currency names for querying in an array, separated by commas, maximum 10 currencies (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.UnifiedBorrowable1], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'currencies' + ] + 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_borrowable_list" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'currencies' is set + if self.api_client.client_side_validation and ('currencies' not in local_var_params or # noqa: E501 + local_var_params['currencies'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `currencies` when calling `get_unified_borrowable_list`") # noqa: E501 + + if self.api_client.client_side_validation and ('currencies' in local_var_params and # noqa: E501 + len(local_var_params['currencies']) > 10): # noqa: E501 + raise ApiValueError("Invalid value for parameter `currencies` when calling `get_unified_borrowable_list`, number of items must be less than or equal to `10`") # noqa: E501 + if self.api_client.client_side_validation and ('currencies' in local_var_params and # noqa: E501 + len(local_var_params['currencies']) < 1): # noqa: E501 + raise ApiValueError("Invalid value for parameter `currencies` when calling `get_unified_borrowable_list`, number of items must be greater than or equal to `1`") # noqa: E501 + collection_formats = {} + + path_params = {} + + query_params = [] + if 'currencies' in local_var_params and local_var_params['currencies'] is not None: # noqa: E501 + query_params.append(('currencies', local_var_params['currencies'])) # noqa: E501 + collection_formats['currencies'] = 'multi' # 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( + '/unified/batch_borrowable', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[UnifiedBorrowable1]', # 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_unified_loans(self, **kwargs): # noqa: E501 + """Query loans # 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_unified_loans(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency: Query by specified currency name + :param int page: Page number + :param int limit: Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 + :param str type: Loan type: platform borrowing - platform, margin borrowing - margin + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.UniLoan] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_unified_loans_with_http_info(**kwargs) # noqa: E501 + + def list_unified_loans_with_http_info(self, **kwargs): # noqa: E501 + """Query loans # 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_unified_loans_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 int page: Page number + :param int limit: Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 + :param str type: Loan type: platform borrowing - platform, margin borrowing - margin + :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.UniLoan], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'currency', + 'page', + 'limit', + '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_unified_loans" % 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_unified_loans`, 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_unified_loans`, 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_unified_loans`, 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 '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 '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 = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/unified/loans', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[UniLoan]', # 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_unified_loan(self, unified_loan, **kwargs): # noqa: E501 + """Borrow or repay # noqa: E501 + + When borrowing, ensure the borrowed amount is not below the minimum borrowing threshold for the specific cryptocurrency and does not exceed the maximum borrowing limit set by the platform and user. Loan interest will be automatically deducted from the account at regular intervals. Users are responsible for managing repayment of borrowed amounts. For repayment, use `repaid_all=true` to repay all available amounts # 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_unified_loan(unified_loan, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param UnifiedLoan unified_loan: (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.UnifiedLoanResult + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.create_unified_loan_with_http_info(unified_loan, **kwargs) # noqa: E501 + + def create_unified_loan_with_http_info(self, unified_loan, **kwargs): # noqa: E501 + """Borrow or repay # noqa: E501 + + When borrowing, ensure the borrowed amount is not below the minimum borrowing threshold for the specific cryptocurrency and does not exceed the maximum borrowing limit set by the platform and user. Loan interest will be automatically deducted from the account at regular intervals. Users are responsible for managing repayment of borrowed amounts. For repayment, use `repaid_all=true` to repay all available amounts # 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_unified_loan_with_http_info(unified_loan, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param UnifiedLoan unified_loan: (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.UnifiedLoanResult, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'unified_loan' + ] + 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_unified_loan" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'unified_loan' is set + if self.api_client.client_side_validation and ('unified_loan' not in local_var_params or # noqa: E501 + local_var_params['unified_loan'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `unified_loan` when calling `create_unified_loan`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'unified_loan' in local_var_params: + body_params = local_var_params['unified_loan'] + # 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/loans', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='UnifiedLoanResult', # 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_unified_loan_records(self, **kwargs): # noqa: E501 + """Query loan 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_unified_loan_records(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str type: Loan record type: borrow - borrowing, repay - repayment + :param str currency: Query by specified currency name + :param int page: Page number + :param int limit: Maximum number of items returned. Default: 100, minimum: 1, 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: list[gate_api.UnifiedLoanRecord] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_unified_loan_records_with_http_info(**kwargs) # noqa: E501 + + def list_unified_loan_records_with_http_info(self, **kwargs): # noqa: E501 + """Query loan 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_unified_loan_records_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str type: Loan record type: borrow - borrowing, repay - repayment + :param str currency: Query by specified currency name + :param int page: Page number + :param int limit: Maximum number of items returned. Default: 100, minimum: 1, 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(list[gate_api.UnifiedLoanRecord], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'type', + 'currency', + '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_unified_loan_records" % 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_unified_loan_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'] > 100: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `list_unified_loan_records`, 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_unified_loan_records`, 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 '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 '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( + '/unified/loan_records', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[UnifiedLoanRecord]', # 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_unified_loan_interest_records(self, **kwargs): # noqa: E501 + """Query interest deduction 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_unified_loan_interest_records(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency: Query by specified currency name + :param int page: Page number + :param int limit: Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 + :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 type: Loan type: platform borrowing - platform, margin borrowing - margin. Defaults to margin if not 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: list[gate_api.UniLoanInterestRecord] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_unified_loan_interest_records_with_http_info(**kwargs) # noqa: E501 + + def list_unified_loan_interest_records_with_http_info(self, **kwargs): # noqa: E501 + """Query interest deduction 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_unified_loan_interest_records_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 int page: Page number + :param int limit: Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 + :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 type: Loan type: platform borrowing - platform, margin borrowing - margin. Defaults to margin 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 + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.UniLoanInterestRecord], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'currency', + 'page', + 'limit', + '_from', + 'to', + '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_unified_loan_interest_records" % 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_unified_loan_interest_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'] > 100: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `list_unified_loan_interest_records`, 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_unified_loan_interest_records`, 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 '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 '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 = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/unified/interest_records', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[UniLoanInterestRecord]', # 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_risk_units(self, **kwargs): # noqa: E501 + """Get user risk unit details # noqa: E501 + + Get user risk unit details, only valid in 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_unified_risk_units(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.UnifiedRiskUnits + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_unified_risk_units_with_http_info(**kwargs) # noqa: E501 + + def get_unified_risk_units_with_http_info(self, **kwargs): # noqa: E501 + """Get user risk unit details # noqa: E501 + + Get user risk unit details, only valid in 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_unified_risk_units_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.UnifiedRiskUnits, 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_risk_units" % 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/risk_units', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='UnifiedRiskUnits', # 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_mode(self, **kwargs): # noqa: E501 + """Query mode of the unified account # noqa: E501 + + Unified account mode: - `classic`: Classic account mode - `multi_currency`: Cross-currency margin mode - `portfolio`: Portfolio margin mode - `single_currency`: Single-currency 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_unified_mode(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.UnifiedModeSet + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_unified_mode_with_http_info(**kwargs) # noqa: E501 + + def get_unified_mode_with_http_info(self, **kwargs): # noqa: E501 + """Query mode of the unified account # noqa: E501 + + Unified account mode: - `classic`: Classic account mode - `multi_currency`: Cross-currency margin mode - `portfolio`: Portfolio margin mode - `single_currency`: Single-currency 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_unified_mode_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.UnifiedModeSet, 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_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 + # 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/unified_mode', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='UnifiedModeSet', # 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_mode(self, unified_mode_set, **kwargs): # noqa: E501 + """Set unified account mode # noqa: E501 + + Each account mode switch only requires passing the corresponding account mode parameter, and also supports turning on or off the configuration switches under the corresponding account mode during the switch. - When enabling the classic account mode, mode=classic ``` PUT /unified/unified_mode { \"mode\": \"classic\" } ``` - When enabling the cross-currency margin \"multi_currency\", \"settings\": { \"usdt_futures\": true } } ``` - When enabling the portfolio margin mode, mode=portfolio ``` PUT /unified/unified_mode { \"mode\": \"portfolio\", \"settings\": { \"spot_hedge\": true } } ``` - When enabling the single-currency margin mode, mode=single_currency ``` PUT /unified/unified_mode { \"mode\": \"single_currency\" } ``` # 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_mode(unified_mode_set, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param UnifiedModeSet unified_mode_set: (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.set_unified_mode_with_http_info(unified_mode_set, **kwargs) # noqa: E501 + + def set_unified_mode_with_http_info(self, unified_mode_set, **kwargs): # noqa: E501 + """Set unified account mode # noqa: E501 + + Each account mode switch only requires passing the corresponding account mode parameter, and also supports turning on or off the configuration switches under the corresponding account mode during the switch. - When enabling the classic account mode, mode=classic ``` PUT /unified/unified_mode { \"mode\": \"classic\" } ``` - When enabling the cross-currency margin \"multi_currency\", \"settings\": { \"usdt_futures\": true } } ``` - When enabling the portfolio margin mode, mode=portfolio ``` PUT /unified/unified_mode { \"mode\": \"portfolio\", \"settings\": { \"spot_hedge\": true } } ``` - When enabling the single-currency margin mode, mode=single_currency ``` PUT /unified/unified_mode { \"mode\": \"single_currency\" } ``` # 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_mode_with_http_info(unified_mode_set, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param UnifiedModeSet unified_mode_set: (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 = [ + 'unified_mode_set' + ] + 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_mode" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'unified_mode_set' is set + if self.api_client.client_side_validation and ('unified_mode_set' not in local_var_params or # noqa: E501 + local_var_params['unified_mode_set'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `unified_mode_set` when calling `set_unified_mode`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'unified_mode_set' in local_var_params: + body_params = local_var_params['unified_mode_set'] + # 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/unified_mode', 'PUT', + 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 get_unified_estimate_rate(self, currencies, **kwargs): # noqa: E501 + """Query unified account estimated interest rate # noqa: E501 + + Interest rates fluctuate hourly based on lending depth, so exact rates cannot be provided. When a currency is not supported, the interest rate returned will be 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.get_unified_estimate_rate(currencies, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param list[str] currencies: Specify currency names for querying in an array, separated by commas, maximum 10 currencies (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: dict + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_unified_estimate_rate_with_http_info(currencies, **kwargs) # noqa: E501 + + def get_unified_estimate_rate_with_http_info(self, currencies, **kwargs): # noqa: E501 + """Query unified account estimated interest rate # noqa: E501 + + Interest rates fluctuate hourly based on lending depth, so exact rates cannot be provided. When a currency is not supported, the interest rate returned will be 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.get_unified_estimate_rate_with_http_info(currencies, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param list[str] currencies: Specify currency names for querying in an array, separated by commas, maximum 10 currencies (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(dict, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'currencies' + ] + 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_estimate_rate" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'currencies' is set + if self.api_client.client_side_validation and ('currencies' not in local_var_params or # noqa: E501 + local_var_params['currencies'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `currencies` when calling `get_unified_estimate_rate`") # noqa: E501 + + if self.api_client.client_side_validation and ('currencies' in local_var_params and # noqa: E501 + len(local_var_params['currencies']) > 10): # noqa: E501 + raise ApiValueError("Invalid value for parameter `currencies` when calling `get_unified_estimate_rate`, number of items must be less than or equal to `10`") # noqa: E501 + if self.api_client.client_side_validation and ('currencies' in local_var_params and # noqa: E501 + len(local_var_params['currencies']) < 1): # noqa: E501 + raise ApiValueError("Invalid value for parameter `currencies` when calling `get_unified_estimate_rate`, number of items must be greater than or equal to `1`") # noqa: E501 + collection_formats = {} + + path_params = {} + + query_params = [] + if 'currencies' in local_var_params and local_var_params['currencies'] is not None: # noqa: E501 + query_params.append(('currencies', local_var_params['currencies'])) # noqa: E501 + collection_formats['currencies'] = 'multi' # 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( + '/unified/estimate_rate', '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 list_currency_discount_tiers(self, **kwargs): # noqa: E501 + """Query unified account tiered # 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_currency_discount_tiers(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.UnifiedDiscount] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_currency_discount_tiers_with_http_info(**kwargs) # noqa: E501 + + def list_currency_discount_tiers_with_http_info(self, **kwargs): # noqa: E501 + """Query unified account tiered # 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_currency_discount_tiers_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.UnifiedDiscount], 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_currency_discount_tiers" % 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( + '/unified/currency_discount_tiers', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[UnifiedDiscount]', # 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_loan_margin_tiers(self, **kwargs): # noqa: E501 + """Query unified account tiered loan 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.list_loan_margin_tiers(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.UnifiedMarginTiers] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_loan_margin_tiers_with_http_info(**kwargs) # noqa: E501 + + def list_loan_margin_tiers_with_http_info(self, **kwargs): # noqa: E501 + """Query unified account tiered loan 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.list_loan_margin_tiers_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.UnifiedMarginTiers], 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_loan_margin_tiers" % 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( + '/unified/loan_margin_tiers', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[UnifiedMarginTiers]', # 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 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 + 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) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param UnifiedPortfolioInput unified_portfolio_input: (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.UnifiedPortfolioOutput + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.calculate_portfolio_margin_with_http_info(unified_portfolio_input, **kwargs) # noqa: E501 + + 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 + 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) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param UnifiedPortfolioInput unified_portfolio_input: (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.UnifiedPortfolioOutput, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'unified_portfolio_input' + ] + 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 calculate_portfolio_margin" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'unified_portfolio_input' is set + if self.api_client.client_side_validation and ('unified_portfolio_input' not in local_var_params or # noqa: E501 + local_var_params['unified_portfolio_input'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `unified_portfolio_input` when calling `calculate_portfolio_margin`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'unified_portfolio_input' in local_var_params: + body_params = local_var_params['unified_portfolio_input'] + # 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( + '/unified/portfolio_calculator', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='UnifiedPortfolioOutput', # 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 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_user_leverage_currency_config(currency, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency: Currency (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.UnifiedLeverageConfig + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_user_leverage_currency_config_with_http_info(currency, **kwargs) # noqa: E501 + + def get_user_leverage_currency_config_with_http_info(self, currency, **kwargs): # noqa: E501 + """Maximum and minimum currency leverage that can be set # 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_leverage_currency_config_with_http_info(currency, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency: Currency (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.UnifiedLeverageConfig, 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 get_user_leverage_currency_config" % k + ) + 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 `get_user_leverage_currency_config`") # 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 + + 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/leverage/user_currency_config', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='UnifiedLeverageConfig', # 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_setting(self, **kwargs): # noqa: E501 + """Get user currency leverage # noqa: E501 + + Get user currency leverage. If currency is not specified, query all currencies # 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_leverage_currency_setting(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency: Currency + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.UnifiedLeverageSetting] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_user_leverage_currency_setting_with_http_info(**kwargs) # noqa: E501 + + def get_user_leverage_currency_setting_with_http_info(self, **kwargs): # noqa: E501 + """Get user currency leverage # noqa: E501 + + Get user currency leverage. If currency is not specified, query all currencies # 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_leverage_currency_setting_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency: Currency + :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.UnifiedLeverageSetting], 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 get_user_leverage_currency_setting" % 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( + '/unified/leverage/user_currency_setting', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[UnifiedLeverageSetting]', # 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_user_leverage_currency_setting(self, unified_leverage_setting, **kwargs): # noqa: E501 + """Set loan currency 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.set_user_leverage_currency_setting(unified_leverage_setting, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param UnifiedLeverageSetting unified_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: None + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.set_user_leverage_currency_setting_with_http_info(unified_leverage_setting, **kwargs) # noqa: E501 + + def set_user_leverage_currency_setting_with_http_info(self, unified_leverage_setting, **kwargs): # noqa: E501 + """Set loan currency 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.set_user_leverage_currency_setting_with_http_info(unified_leverage_setting, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param UnifiedLeverageSetting unified_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: None + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'unified_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_currency_setting" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'unified_leverage_setting' is set + if self.api_client.client_side_validation and ('unified_leverage_setting' not in local_var_params or # noqa: E501 + local_var_params['unified_leverage_setting'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `unified_leverage_setting` when calling `set_user_leverage_currency_setting`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'unified_leverage_setting' in local_var_params: + body_params = local_var_params['unified_leverage_setting'] + # 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_currency_setting', '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_unified_currencies(self, **kwargs): # noqa: E501 + """List of loan currencies supported by unified account # 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_unified_currencies(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency: Currency + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.UnifiedCurrency] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_unified_currencies_with_http_info(**kwargs) # noqa: E501 + + def list_unified_currencies_with_http_info(self, **kwargs): # noqa: E501 + """List of loan currencies supported by unified account # 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_unified_currencies_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency: Currency + :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.UnifiedCurrency], 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_unified_currencies" % 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 = [] # noqa: E501 + + return self.api_client.call_api( + '/unified/currencies', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[UnifiedCurrency]', # 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_history_loan_rate(self, currency, **kwargs): # noqa: E501 + """Get historical lending 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.get_history_loan_rate(currency, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency: Currency (required) + :param str tier: VIP level for the floating rate to be queried + :param int page: Page number + :param int limit: Maximum number of items returned. Default: 100, minimum: 1, 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.UnifiedHistoryLoanRate + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_history_loan_rate_with_http_info(currency, **kwargs) # noqa: E501 + + def get_history_loan_rate_with_http_info(self, currency, **kwargs): # noqa: E501 + """Get historical lending 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.get_history_loan_rate_with_http_info(currency, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency: Currency (required) + :param str tier: VIP level for the floating rate to be queried + :param int page: Page number + :param int limit: Maximum number of items returned. Default: 100, minimum: 1, 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.UnifiedHistoryLoanRate, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'currency', + 'tier', + '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 get_history_loan_rate" % k + ) + 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 `get_history_loan_rate`") # 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 `get_history_loan_rate`, 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 `get_history_loan_rate`, 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 `get_history_loan_rate`, must be a value greater than or equal to `1`") # noqa: E501 + collection_formats = {} + + path_params = {} + + query_params = [] + if 'tier' in local_var_params and local_var_params['tier'] is not None: # noqa: E501 + query_params.append(('tier', local_var_params['tier'])) # 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 '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( + '/unified/history_loan_rate', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='UnifiedHistoryLoanRate', # 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_collateral(self, unified_collateral_req, **kwargs): # noqa: E501 + """Set collateral currency # 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_collateral(unified_collateral_req, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param UnifiedCollateralReq unified_collateral_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.UnifiedCollateralRes + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.set_unified_collateral_with_http_info(unified_collateral_req, **kwargs) # noqa: E501 + + def set_unified_collateral_with_http_info(self, unified_collateral_req, **kwargs): # noqa: E501 + """Set collateral currency # 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_collateral_with_http_info(unified_collateral_req, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param UnifiedCollateralReq unified_collateral_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.UnifiedCollateralRes, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'unified_collateral_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 set_unified_collateral" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'unified_collateral_req' is set + if self.api_client.client_side_validation and ('unified_collateral_req' not in local_var_params or # noqa: E501 + local_var_params['unified_collateral_req'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `unified_collateral_req` when calling `set_unified_collateral`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'unified_collateral_req' in local_var_params: + body_params = local_var_params['unified_collateral_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( + '/unified/collateral_currencies', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='UnifiedCollateralRes', # 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 38242c2..0284850 100644 --- a/gate_api/api/wallet_api.py +++ b/gate_api/api/wallet_api.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -18,7 +18,10 @@ import six from gate_api.api_client import ApiClient -from gate_api.exceptions import ApiTypeError, ApiValueError # noqa: F401 +from gate_api.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) class WalletApi(object): @@ -33,6 +36,118 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client + def list_currency_chains(self, currency, **kwargs): # noqa: E501 + """Query chains supported for specified currency # 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_currency_chains(currency, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency: Currency name (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.CurrencyChain] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_currency_chains_with_http_info(currency, **kwargs) # noqa: E501 + + def list_currency_chains_with_http_info(self, currency, **kwargs): # noqa: E501 + """Query chains supported for specified currency # 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_currency_chains_with_http_info(currency, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency: Currency name (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.CurrencyChain], 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_currency_chains" % k + ) + 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_currency_chains`") # 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 + + 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( + '/wallet/currency_chains', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[CurrencyChain]', # 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_deposit_address(self, currency, **kwargs): # noqa: E501 """Generate currency deposit address # noqa: E501 @@ -83,21 +198,30 @@ def get_deposit_address_with_http_info(self, currency, **kwargs): # noqa: E501 local_var_params = locals() - all_params = ['currency'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + 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 get_deposit_address" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_deposit_address" % k + ) 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 local_var_params['currency'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `currency` when calling `get_deposit_address`" - ) # noqa: E501 + 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 `get_deposit_address`") # noqa: E501 collection_formats = {} @@ -114,14 +238,14 @@ def get_deposit_address_with_http_info(self, currency, **kwargs): # noqa: E501 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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/deposit_address', - 'GET', + '/wallet/deposit_address', 'GET', path_params, query_params, header_params, @@ -134,23 +258,25 @@ def get_deposit_address_with_http_info(self, currency, **kwargs): # noqa: E501 _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, - ) + collection_formats=collection_formats) def list_withdrawals(self, **kwargs): # noqa: E501 - """Retrieve withdrawal records # noqa: E501 + """Get withdrawal records # noqa: E501 - Record time range cannot exceed 30 days # noqa: E501 + Record query time range cannot exceed 30 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.list_withdrawals(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str currency: Filter by currency. Return all currency records if not specified - :param int _from: Time range beginning, default to 7 days before current time - :param int to: Time range ending, default to current time - :param int limit: Maximum number of records to be returned in a single list + :param str currency: Specify the currency. If not specified, returns all currencies + :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 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 :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response @@ -159,7 +285,7 @@ def list_withdrawals(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.LedgerRecord] + :rtype: list[gate_api.WithdrawalRecord] :return: If the method is called asynchronously, returns the request thread. """ @@ -167,19 +293,22 @@ def list_withdrawals(self, **kwargs): # noqa: E501 return self.list_withdrawals_with_http_info(**kwargs) # noqa: E501 def list_withdrawals_with_http_info(self, **kwargs): # noqa: E501 - """Retrieve withdrawal records # noqa: E501 + """Get withdrawal records # noqa: E501 - Record time range cannot exceed 30 days # noqa: E501 + Record query time range cannot exceed 30 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.list_withdrawals_with_http_info(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str currency: Filter by currency. Return all currency records if not specified - :param int _from: Time range beginning, default to 7 days before current time - :param int to: Time range ending, default to current time - :param int limit: Maximum number of records to be returned in a single list + :param str currency: Specify the currency. If not specified, returns all currencies + :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 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 :param _return_http_data_only: response data without head status code and headers @@ -190,40 +319,47 @@ def list_withdrawals_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.LedgerRecord], status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(list[gate_api.WithdrawalRecord], status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ local_var_params = locals() - all_params = ['currency', '_from', 'to', 'limit', 'offset'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'currency', + 'withdraw_id', + 'asset_class', + 'withdraw_order_id', + '_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 list_withdrawals" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_withdrawals" % 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'] > 1000 - ): # noqa: E501 - raise ApiValueError( - "Invalid value for parameter `limit` when calling `list_withdrawals`, 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_withdrawals`, 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_withdrawals`, must be a value greater than or equal to `0`" - ) # 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_withdrawals`, 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_withdrawals`, 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_withdrawals`, must be a value greater than or equal to `0`") # noqa: E501 collection_formats = {} path_params = {} @@ -231,6 +367,12 @@ def list_withdrawals_with_http_info(self, **kwargs): # noqa: E501 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 'withdraw_id' in local_var_params and local_var_params['withdraw_id'] is not None: # noqa: E501 + query_params.append(('withdraw_id', local_var_params['withdraw_id'])) # noqa: E501 + if 'asset_class' in local_var_params and local_var_params['asset_class'] is not None: # noqa: E501 + query_params.append(('asset_class', local_var_params['asset_class'])) # noqa: E501 + if 'withdraw_order_id' in local_var_params and local_var_params['withdraw_order_id'] is not None: # noqa: E501 + query_params.append(('withdraw_order_id', local_var_params['withdraw_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 @@ -247,43 +389,42 @@ def list_withdrawals_with_http_info(self, **kwargs): # noqa: E501 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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/withdrawals', - 'GET', + '/wallet/withdrawals', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[LedgerRecord]', # noqa: E501 + response_type='list[WithdrawalRecord]', # 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, - ) + collection_formats=collection_formats) def list_deposits(self, **kwargs): # noqa: E501 - """Retrieve deposit records # noqa: E501 + """Get deposit records # noqa: E501 - Record time range cannot exceed 30 days # noqa: E501 + Record query time range cannot exceed 30 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.list_deposits(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str currency: Filter by currency. Return all currency records if not specified - :param int _from: Time range beginning, default to 7 days before current time - :param int to: Time range ending, default to current time - :param int limit: Maximum number of records to be returned in a single list + :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 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 :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response @@ -292,7 +433,7 @@ def list_deposits(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.LedgerRecord] + :rtype: list[gate_api.DepositRecord] :return: If the method is called asynchronously, returns the request thread. """ @@ -300,19 +441,19 @@ def list_deposits(self, **kwargs): # noqa: E501 return self.list_deposits_with_http_info(**kwargs) # noqa: E501 def list_deposits_with_http_info(self, **kwargs): # noqa: E501 - """Retrieve deposit records # noqa: E501 + """Get deposit records # noqa: E501 - Record time range cannot exceed 30 days # noqa: E501 + Record query time range cannot exceed 30 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.list_deposits_with_http_info(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str currency: Filter by currency. Return all currency records if not specified - :param int _from: Time range beginning, default to 7 days before current time - :param int to: Time range ending, default to current time - :param int limit: Maximum number of records to be returned in a single list + :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 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 :param _return_http_data_only: response data without head status code and headers @@ -323,40 +464,44 @@ def list_deposits_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.LedgerRecord], status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(list[gate_api.DepositRecord], status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ local_var_params = locals() - all_params = ['currency', '_from', 'to', 'limit', 'offset'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'currency', + '_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 list_deposits" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_deposits" % 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'] > 1000 - ): # noqa: E501 - raise ApiValueError( - "Invalid value for parameter `limit` when calling `list_deposits`, 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_deposits`, 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_deposits`, must be a value greater than or equal to `0`" - ) # 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 `list_deposits`, 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 `list_deposits`, 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_deposits`, must be a value greater than or equal to `0`") # noqa: E501 collection_formats = {} path_params = {} @@ -380,33 +525,32 @@ def list_deposits_with_http_info(self, **kwargs): # noqa: E501 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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/deposits', - 'GET', + '/wallet/deposits', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[LedgerRecord]', # noqa: E501 + response_type='list[DepositRecord]', # 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, - ) + collection_formats=collection_formats) def transfer(self, transfer, **kwargs): # noqa: E501 """Transfer between trading accounts # noqa: E501 - Transfer between different accounts. Currently support transfers between the following: 1. spot - margin 2. spot - futures(perpetual) 3. spot - delivery 4. spot - cross margin # noqa: E501 + Balance transfers between personal trading accounts. Currently supports the following transfer operations: 1. Spot account - Margin account 2. Spot account - Perpetual futures account 3. Spot account - Delivery futures account 4. Spot account - Options account # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.transfer(transfer, async_req=True) @@ -421,7 +565,7 @@ def transfer(self, transfer, **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.TransactionID :return: If the method is called asynchronously, returns the request thread. """ @@ -431,7 +575,7 @@ def transfer(self, transfer, **kwargs): # noqa: E501 def transfer_with_http_info(self, transfer, **kwargs): # noqa: E501 """Transfer between trading accounts # noqa: E501 - Transfer between different accounts. Currently support transfers between the following: 1. spot - margin 2. spot - futures(perpetual) 3. spot - delivery 4. spot - cross margin # noqa: E501 + Balance transfers between personal trading accounts. Currently supports the following transfer operations: 1. Spot account - Margin account 2. Spot account - Perpetual futures account 3. Spot account - Delivery futures account 4. Spot account - Options account # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.transfer_with_http_info(transfer, async_req=True) @@ -448,25 +592,36 @@ def transfer_with_http_info(self, transfer, **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(gate_api.TransactionID, status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ local_var_params = locals() - all_params = ['transfer'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'transfer' + ] + 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 transfer" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method transfer" % k + ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'transfer' is set - if self.api_client.client_side_validation and ( - 'transfer' not in local_var_params or local_var_params['transfer'] is None # noqa: E501 - ): # noqa: E501 + if self.api_client.client_side_validation and ('transfer' not in local_var_params or # noqa: E501 + local_var_params['transfer'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `transfer` when calling `transfer`") # noqa: E501 collection_formats = {} @@ -483,46 +638,47 @@ def transfer_with_http_info(self, transfer, **kwargs): # noqa: E501 body_params = None if 'transfer' in local_var_params: body_params = local_var_params['transfer'] + # 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 + ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( - '/wallet/transfers', - 'POST', + '/wallet/transfers', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type=None, # noqa: E501 + response_type='TransactionID', # 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, - ) + collection_formats=collection_formats) def list_sub_account_transfers(self, **kwargs): # noqa: E501 - """Retrieve transfer records between main and sub accounts # noqa: E501 + """Get transfer records between main and sub accounts # noqa: E501 - Record time range cannot exceed 30 days > Note: only records after 2020-04-10 can be retrieved # noqa: E501 + Record query time range cannot exceed 30 days > Note: Only records after 2020-04-10 can be retrieved # 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_sub_account_transfers(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str sub_uid: Sub account user ID. Return records related to all sub accounts if not specified - :param int _from: Time range beginning, default to 7 days before current time - :param int to: Time range ending, default to current time - :param int limit: Maximum number of records to be returned in a single list + :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 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 :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response @@ -531,7 +687,7 @@ def list_sub_account_transfers(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.SubAccountTransfer] + :rtype: list[gate_api.SubAccountTransferRecordItem] :return: If the method is called asynchronously, returns the request thread. """ @@ -539,19 +695,19 @@ def list_sub_account_transfers(self, **kwargs): # noqa: E501 return self.list_sub_account_transfers_with_http_info(**kwargs) # noqa: E501 def list_sub_account_transfers_with_http_info(self, **kwargs): # noqa: E501 - """Retrieve transfer records between main and sub accounts # noqa: E501 + """Get transfer records between main and sub accounts # noqa: E501 - Record time range cannot exceed 30 days > Note: only records after 2020-04-10 can be retrieved # noqa: E501 + Record query time range cannot exceed 30 days > Note: Only records after 2020-04-10 can be retrieved # 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_sub_account_transfers_with_http_info(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str sub_uid: Sub account user ID. Return records related to all sub accounts if not specified - :param int _from: Time range beginning, default to 7 days before current time - :param int to: Time range ending, default to current time - :param int limit: Maximum number of records to be returned in a single list + :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 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 :param _return_http_data_only: response data without head status code and headers @@ -562,42 +718,44 @@ def list_sub_account_transfers_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.SubAccountTransfer], status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(list[gate_api.SubAccountTransferRecordItem], status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ local_var_params = locals() - all_params = ['sub_uid', '_from', 'to', 'limit', 'offset'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'sub_uid', + '_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 list_sub_account_transfers" % k + "Got an unexpected keyword argument '%s'" + " to method list_sub_account_transfers" % 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'] > 1000 - ): # noqa: E501 - raise ApiValueError( - "Invalid value for parameter `limit` when calling `list_sub_account_transfers`, 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_sub_account_transfers`, 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_sub_account_transfers`, must be a value greater than or equal to `0`" - ) # 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_sub_account_transfers`, 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_sub_account_transfers`, 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_sub_account_transfers`, must be a value greater than or equal to `0`") # noqa: E501 collection_formats = {} path_params = {} @@ -621,33 +779,32 @@ def list_sub_account_transfers_with_http_info(self, **kwargs): # noqa: E501 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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/sub_account_transfers', - 'GET', + '/wallet/sub_account_transfers', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[SubAccountTransfer]', # noqa: E501 + response_type='list[SubAccountTransferRecordItem]', # 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, - ) + collection_formats=collection_formats) def transfer_with_sub_account(self, sub_account_transfer, **kwargs): # noqa: E501 """Transfer between main and sub accounts # noqa: E501 - Support transferring with sub user's spot or futures account. Note that only main user's spot account is used no matter which sub user's account is operated. # noqa: E501 + Supports transfers to/from sub-account's spot or futures accounts. Note that regardless of which sub-account is operated, only the main account's spot account is used # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.transfer_with_sub_account(sub_account_transfer, async_req=True) @@ -662,7 +819,7 @@ def transfer_with_sub_account(self, sub_account_transfer, **kwargs): # noqa: E5 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: None + :rtype: gate_api.TransactionID :return: If the method is called asynchronously, returns the request thread. """ @@ -672,7 +829,7 @@ def transfer_with_sub_account(self, sub_account_transfer, **kwargs): # noqa: E5 def transfer_with_sub_account_with_http_info(self, sub_account_transfer, **kwargs): # noqa: E501 """Transfer between main and sub accounts # noqa: E501 - Support transferring with sub user's spot or futures account. Note that only main user's spot account is used no matter which sub user's account is operated. # noqa: E501 + Supports transfers to/from sub-account's spot or futures accounts. Note that regardless of which sub-account is operated, only the main account's spot account is used # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.transfer_with_sub_account_with_http_info(sub_account_transfer, async_req=True) @@ -689,29 +846,37 @@ def transfer_with_sub_account_with_http_info(self, sub_account_transfer, **kwarg 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.TransactionID, status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ local_var_params = locals() - all_params = ['sub_account_transfer'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'sub_account_transfer' + ] + 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 transfer_with_sub_account" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method transfer_with_sub_account" % k + ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'sub_account_transfer' is set - if self.api_client.client_side_validation and ( - 'sub_account_transfer' not in local_var_params - or local_var_params['sub_account_transfer'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `sub_account_transfer` when calling `transfer_with_sub_account`" - ) # noqa: E501 + if self.api_client.client_side_validation and ('sub_account_transfer' not in local_var_params or # noqa: E501 + local_var_params['sub_account_transfer'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `sub_account_transfer` when calling `transfer_with_sub_account`") # noqa: E501 collection_formats = {} @@ -727,42 +892,44 @@ def transfer_with_sub_account_with_http_info(self, sub_account_transfer, **kwarg body_params = None if 'sub_account_transfer' in local_var_params: body_params = local_var_params['sub_account_transfer'] + # 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 + ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( - '/wallet/sub_account_transfers', - 'POST', + '/wallet/sub_account_transfers', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type=None, # noqa: E501 + response_type='TransactionID', # 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, - ) + collection_formats=collection_formats) - def list_withdraw_status(self, **kwargs): # noqa: E501 - """Retrieve withdrawal status # noqa: E501 + def sub_account_to_sub_account(self, sub_account_to_sub_account, **kwargs): # noqa: E501 + """Transfer between sub-accounts # noqa: E501 + Supports balance transfers between two sub-accounts under the same main account. You can use either the main account's API Key or the source sub-account's API Key to perform the operation # 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_withdraw_status(async_req=True) + >>> thread = api.sub_account_to_sub_account(sub_account_to_sub_account, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str currency: Retrieve data of the specified currency + :param SubAccountToSubAccount sub_account_to_sub_account: (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -770,23 +937,24 @@ def list_withdraw_status(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.WithdrawStatus] + :rtype: gate_api.TransactionID :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.list_withdraw_status_with_http_info(**kwargs) # noqa: E501 + return self.sub_account_to_sub_account_with_http_info(sub_account_to_sub_account, **kwargs) # noqa: E501 - def list_withdraw_status_with_http_info(self, **kwargs): # noqa: E501 - """Retrieve withdrawal status # noqa: E501 + def sub_account_to_sub_account_with_http_info(self, sub_account_to_sub_account, **kwargs): # noqa: E501 + """Transfer between sub-accounts # noqa: E501 + Supports balance transfers between two sub-accounts under the same main account. You can use either the main account's API Key or the source sub-account's API Key to perform the operation # 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_withdraw_status_with_http_info(async_req=True) + >>> thread = api.sub_account_to_sub_account_with_http_info(sub_account_to_sub_account, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str currency: Retrieve data of the specified currency + :param SubAccountToSubAccount sub_account_to_sub_account: (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -796,29 +964,43 @@ def list_withdraw_status_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.WithdrawStatus], status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(gate_api.TransactionID, 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']) + all_params = [ + 'sub_account_to_sub_account' + ] + 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_withdraw_status" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method sub_account_to_sub_account" % k + ) local_var_params[k] = v del local_var_params['kwargs'] + # verify the required parameter 'sub_account_to_sub_account' is set + if self.api_client.client_side_validation and ('sub_account_to_sub_account' not in local_var_params or # noqa: E501 + local_var_params['sub_account_to_sub_account'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `sub_account_to_sub_account` when calling `sub_account_to_sub_account`") # 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 header_params = {} @@ -826,40 +1008,47 @@ def list_withdraw_status_with_http_info(self, **kwargs): # noqa: E501 local_var_files = {} body_params = None + if 'sub_account_to_sub_account' in local_var_params: + body_params = local_var_params['sub_account_to_sub_account'] # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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( - '/wallet/withdraw_status', - 'GET', + '/wallet/sub_account_to_sub_account', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[WithdrawStatus]', # noqa: E501 + response_type='TransactionID', # 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, - ) + collection_formats=collection_formats) - def list_sub_account_balances(self, **kwargs): # noqa: E501 - """Retrieve sub account balances # noqa: E501 + def get_transfer_order_status(self, **kwargs): # noqa: E501 + """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 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_sub_account_balances(async_req=True) + >>> thread = api.get_transfer_order_status(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str sub_uid: Sub account user ID. Return records related to all sub accounts if not specified + :param str client_order_id: 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 + :param str tx_id: Transfer operation number, cannot be empty at the same time as client_order_id :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -867,23 +1056,25 @@ def list_sub_account_balances(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.SubAccountBalance] + :rtype: gate_api.TransferOrderStatus :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.list_sub_account_balances_with_http_info(**kwargs) # noqa: E501 + return self.get_transfer_order_status_with_http_info(**kwargs) # noqa: E501 - def list_sub_account_balances_with_http_info(self, **kwargs): # noqa: E501 - """Retrieve sub account balances # noqa: E501 + def get_transfer_order_status_with_http_info(self, **kwargs): # noqa: E501 + """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 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_sub_account_balances_with_http_info(async_req=True) + >>> thread = api.get_transfer_order_status_with_http_info(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str sub_uid: Sub account user ID. Return records related to all sub accounts if not specified + :param str client_order_id: 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 + :param str tx_id: Transfer operation number, cannot be empty at the same time as client_order_id :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -893,19 +1084,32 @@ def list_sub_account_balances_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.SubAccountBalance], status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(gate_api.TransferOrderStatus, status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ local_var_params = locals() - all_params = ['sub_uid'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'client_order_id', + '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 list_sub_account_balances" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_transfer_order_status" % k + ) local_var_params[k] = v del local_var_params['kwargs'] @@ -914,8 +1118,10 @@ def list_sub_account_balances_with_http_info(self, **kwargs): # noqa: E501 path_params = {} 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 'client_order_id' in local_var_params and local_var_params['client_order_id'] is not None: # noqa: E501 + query_params.append(('client_order_id', local_var_params['client_order_id'])) # noqa: E501 + 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 = {} @@ -924,39 +1130,38 @@ def list_sub_account_balances_with_http_info(self, **kwargs): # noqa: E501 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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/sub_account_balances', - 'GET', + '/wallet/order_status', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[SubAccountBalance]', # noqa: E501 + response_type='TransferOrderStatus', # 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, - ) + collection_formats=collection_formats) - def get_trade_fee(self, **kwargs): # noqa: E501 - """Retrieve personal trading fee # noqa: E501 + def list_withdraw_status(self, **kwargs): # noqa: E501 + """Query withdrawal 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.get_trade_fee(async_req=True) + >>> thread = api.list_withdraw_status(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str currency_pair: Specify a currency pair to retrieve precise fee rate This field is optional. In most cases, the fee rate is identical among all currency pairs + :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. @@ -964,23 +1169,23 @@ def get_trade_fee(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.TradeFee + :rtype: list[gate_api.WithdrawStatus] :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.get_trade_fee_with_http_info(**kwargs) # noqa: E501 + return self.list_withdraw_status_with_http_info(**kwargs) # noqa: E501 - def get_trade_fee_with_http_info(self, **kwargs): # noqa: E501 - """Retrieve personal trading fee # noqa: E501 + def list_withdraw_status_with_http_info(self, **kwargs): # noqa: E501 + """Query withdrawal 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.get_trade_fee_with_http_info(async_req=True) + >>> thread = api.list_withdraw_status_with_http_info(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str currency_pair: Specify a currency pair to retrieve precise fee rate This field is optional. In most cases, the fee rate is identical among all currency pairs + :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 @@ -990,19 +1195,31 @@ def get_trade_fee_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.TradeFee, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(list[gate_api.WithdrawStatus], 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']) + 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 get_trade_fee" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_withdraw_status" % k + ) local_var_params[k] = v del local_var_params['kwargs'] @@ -1011,8 +1228,8 @@ def get_trade_fee_with_http_info(self, **kwargs): # noqa: E501 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 '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 = {} @@ -1021,39 +1238,38 @@ def get_trade_fee_with_http_info(self, **kwargs): # noqa: E501 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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/fee', - 'GET', + '/wallet/withdraw_status', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='TradeFee', # noqa: E501 + response_type='list[WithdrawStatus]', # 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, - ) + collection_formats=collection_formats) - def get_total_balance(self, **kwargs): # noqa: E501 - """Retrieve user's total balances # noqa: E501 + def list_sub_account_balances(self, **kwargs): # noqa: E501 + """Query sub-account balance 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.get_total_balance(async_req=True) + >>> thread = api.list_sub_account_balances(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str currency: Currency unit used to calculate the balance amount. BTC, CNY, USD and USDT are allowed. USDT is the default. + :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 _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -1061,23 +1277,23 @@ def get_total_balance(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.TotalBalance + :rtype: list[gate_api.SubAccountBalance] :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.get_total_balance_with_http_info(**kwargs) # noqa: E501 + return self.list_sub_account_balances_with_http_info(**kwargs) # noqa: E501 - def get_total_balance_with_http_info(self, **kwargs): # noqa: E501 - """Retrieve user's total balances # noqa: E501 + def list_sub_account_balances_with_http_info(self, **kwargs): # noqa: E501 + """Query sub-account balance 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.get_total_balance_with_http_info(async_req=True) + >>> thread = api.list_sub_account_balances_with_http_info(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str currency: Currency unit used to calculate the balance amount. BTC, CNY, USD and USDT are allowed. USDT is the default. + :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 _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -1087,19 +1303,31 @@ def get_total_balance_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.TotalBalance, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(list[gate_api.SubAccountBalance], 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']) + all_params = [ + 'sub_uid' + ] + 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_total_balance" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_sub_account_balances" % k + ) local_var_params[k] = v del local_var_params['kwargs'] @@ -1108,8 +1336,8 @@ def get_total_balance_with_http_info(self, **kwargs): # noqa: E501 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 '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 header_params = {} @@ -1118,25 +1346,1181 @@ def get_total_balance_with_http_info(self, **kwargs): # noqa: E501 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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/total_balance', - 'GET', + '/wallet/sub_account_balances', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='TotalBalance', # noqa: E501 + response_type='list[SubAccountBalance]', # 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, + collection_formats=collection_formats) + + def list_sub_account_margin_balances(self, **kwargs): # noqa: E501 + """Query sub-account isolated margin account balance 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_sub_account_margin_balances(async_req=True) + >>> result = thread.get() + + :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 _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.SubAccountMarginBalance] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_sub_account_margin_balances_with_http_info(**kwargs) # noqa: E501 + + def list_sub_account_margin_balances_with_http_info(self, **kwargs): # noqa: E501 + """Query sub-account isolated margin account balance 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_sub_account_margin_balances_with_http_info(async_req=True) + >>> result = thread.get() + + :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 _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.SubAccountMarginBalance], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'sub_uid' + ] + 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_sub_account_margin_balances" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + 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 + + 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/sub_account_margin_balances', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[SubAccountMarginBalance]', # 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_sub_account_futures_balances(self, **kwargs): # noqa: E501 + """Query sub-account perpetual futures account balance 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_sub_account_futures_balances(async_req=True) + >>> result = thread.get() + + :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 str settle: Query balance of specified settlement currency + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.SubAccountFuturesBalance] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_sub_account_futures_balances_with_http_info(**kwargs) # noqa: E501 + + def list_sub_account_futures_balances_with_http_info(self, **kwargs): # noqa: E501 + """Query sub-account perpetual futures account balance 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_sub_account_futures_balances_with_http_info(async_req=True) + >>> result = thread.get() + + :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 str settle: Query balance of specified settlement currency + :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.SubAccountFuturesBalance], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'sub_uid', + 'settle' + ] + 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_sub_account_futures_balances" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + 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 'settle' in local_var_params and local_var_params['settle'] is not None: # noqa: E501 + query_params.append(('settle', local_var_params['settle'])) # 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/sub_account_futures_balances', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[SubAccountFuturesBalance]', # 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_sub_account_cross_margin_balances(self, **kwargs): # noqa: E501 + """Query sub-account cross margin account balance 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_sub_account_cross_margin_balances(async_req=True) + >>> result = thread.get() + + :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 _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.SubAccountCrossMarginBalance] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_sub_account_cross_margin_balances_with_http_info(**kwargs) # noqa: E501 + + def list_sub_account_cross_margin_balances_with_http_info(self, **kwargs): # noqa: E501 + """Query sub-account cross margin account balance 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_sub_account_cross_margin_balances_with_http_info(async_req=True) + >>> result = thread.get() + + :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 _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.SubAccountCrossMarginBalance], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'sub_uid' + ] + 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_sub_account_cross_margin_balances" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + 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 + + 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/sub_account_cross_margin_balances', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[SubAccountCrossMarginBalance]', # 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_saved_address(self, currency, **kwargs): # noqa: E501 + """Query withdrawal address whitelist # 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) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency: Currency (required) + :param str chain: Chain name + :param str limit: Maximum number returned, up to 100 + :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: list[gate_api.SavedAddress] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_saved_address_with_http_info(currency, **kwargs) # noqa: E501 + + def list_saved_address_with_http_info(self, currency, **kwargs): # noqa: E501 + """Query withdrawal address whitelist # 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) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency: Currency (required) + :param str chain: Chain name + :param str limit: Maximum number returned, up to 100 + :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(list[gate_api.SavedAddress], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'currency', + 'chain', + '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_saved_address" % k + ) + 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 + 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 '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 '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 = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/wallet/saved_address', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[SavedAddress]', # 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_trade_fee(self, **kwargs): # noqa: E501 + """Query personal trading fees # 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_trade_fee(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency_pair: Specify currency pair to get more accurate fee settings. This field is optional. Usually fee settings are the same for all currency pairs. + :param str settle: Specify the settlement currency of the contract to get more accurate fee settings. This field is optional. Generally, the fee settings for all settlement currencies are the same. + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.TradeFee + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_trade_fee_with_http_info(**kwargs) # noqa: E501 + + def get_trade_fee_with_http_info(self, **kwargs): # noqa: E501 + """Query personal trading fees # 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_trade_fee_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency_pair: Specify currency pair to get more accurate fee settings. This field is optional. Usually fee settings are the same for all currency pairs. + :param str settle: Specify the settlement currency of the contract to get more accurate fee settings. This field is optional. Generally, the fee settings for all settlement currencies are the same. + :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.TradeFee, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'currency_pair', + 'settle' + ] + 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_trade_fee" % 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 + if 'settle' in local_var_params and local_var_params['settle'] is not None: # noqa: E501 + query_params.append(('settle', local_var_params['settle'])) # 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/fee', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TradeFee', # 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_total_balance(self, **kwargs): # noqa: E501 + """Query personal account totals # noqa: E501 + + This query endpoint returns the total *estimated value* of all currencies in each account converted to the input currency. Exchange rates and related account balance information may be cached for up to 1 minute. It is not recommended to use this interface data for real-time calculations. For real-time calculations, query the corresponding balance interface based on account type, such as: - `GET /spot/accounts` to query spot account - `GET /margin/accounts` to query margin account - `GET /futures/{settle}/accounts` to query futures account # 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_total_balance(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency: Target currency type for statistical conversion. Accepts BTC, CNY, USD, and USDT. USDT is the default value + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.TotalBalance + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_total_balance_with_http_info(**kwargs) # noqa: E501 + + def get_total_balance_with_http_info(self, **kwargs): # noqa: E501 + """Query personal account totals # noqa: E501 + + This query endpoint returns the total *estimated value* of all currencies in each account converted to the input currency. Exchange rates and related account balance information may be cached for up to 1 minute. It is not recommended to use this interface data for real-time calculations. For real-time calculations, query the corresponding balance interface based on account type, such as: - `GET /spot/accounts` to query spot account - `GET /margin/accounts` to query margin account - `GET /futures/{settle}/accounts` to query futures account # 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_total_balance_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency: Target currency type for statistical conversion. Accepts BTC, CNY, USD, and USDT. USDT is the default value + :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.TotalBalance, 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 get_total_balance" % 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( + '/wallet/total_balance', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TotalBalance', # 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_small_balance(self, **kwargs): # noqa: E501 + """Get list of convertible small balance currencies # 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_small_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: list[gate_api.SmallBalance] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_small_balance_with_http_info(**kwargs) # noqa: E501 + + def list_small_balance_with_http_info(self, **kwargs): # noqa: E501 + """Get list of convertible small balance currencies # 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_small_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: tuple(list[gate_api.SmallBalance], 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_small_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 + # 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/small_balance', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[SmallBalance]', # 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 convert_small_balance(self, convert_small_balance, **kwargs): # noqa: E501 + """Convert small balance currency # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.convert_small_balance(convert_small_balance, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param ConvertSmallBalance convert_small_balance: (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.convert_small_balance_with_http_info(convert_small_balance, **kwargs) # noqa: E501 + + def convert_small_balance_with_http_info(self, convert_small_balance, **kwargs): # noqa: E501 + """Convert small balance currency # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.convert_small_balance_with_http_info(convert_small_balance, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param ConvertSmallBalance convert_small_balance: (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 = [ + 'convert_small_balance' + ] + 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 convert_small_balance" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'convert_small_balance' is set + if self.api_client.client_side_validation and ('convert_small_balance' not in local_var_params or # noqa: E501 + local_var_params['convert_small_balance'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `convert_small_balance` when calling `convert_small_balance`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'convert_small_balance' in local_var_params: + body_params = local_var_params['convert_small_balance'] + # 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( + '/wallet/small_balance', '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_small_balance_history(self, **kwargs): # noqa: E501 + """Get convertible small balance currency 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_small_balance_history(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency: Currency to convert + :param int page: Page number + :param int limit: Maximum number of items returned. Default: 100, minimum: 1, 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: list[gate_api.SmallBalanceHistory] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_small_balance_history_with_http_info(**kwargs) # noqa: E501 + + def list_small_balance_history_with_http_info(self, **kwargs): # noqa: E501 + """Get convertible small balance currency 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_small_balance_history_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency: Currency to convert + :param int page: Page number + :param int limit: Maximum number of items returned. Default: 100, minimum: 1, 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(list[gate_api.SmallBalanceHistory], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'currency', + '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_small_balance_history" % 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_small_balance_history`, 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_small_balance_history`, 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_small_balance_history`, 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 '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( + '/wallet/small_balance_history', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[SmallBalanceHistory]', # 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_push_orders(self, **kwargs): # noqa: E501 + """Get UID transfer 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_push_orders(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int id: Order ID + :param int _from: Start time for querying records. If not specified, defaults to 7 days before the current time. Unix timestamp in seconds + :param int to: End time for querying records. If not specified, defaults to the current time. Unix timestamp in seconds + :param int limit: Maximum number of items returned in the list, default value is 100 + :param int offset: List offset, starting from 0 + :param str transaction_type: Order type returned in the list: `withdraw`, `deposit`. Default is `withdraw`. + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for 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.UidPushOrder] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_push_orders_with_http_info(**kwargs) # noqa: E501 + + def list_push_orders_with_http_info(self, **kwargs): # noqa: E501 + """Get UID transfer 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_push_orders_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int id: Order ID + :param int _from: Start time for querying records. If not specified, defaults to 7 days before the current time. Unix timestamp in seconds + :param int to: End time for querying records. If not specified, defaults to the current time. Unix timestamp in seconds + :param int limit: Maximum number of items returned in the list, default value is 100 + :param int offset: List offset, starting from 0 + :param str transaction_type: Order type returned in the list: `withdraw`, `deposit`. Default is `withdraw`. + :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.UidPushOrder], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'id', + '_from', + 'to', + 'limit', + 'offset', + 'transaction_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_push_orders" % 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 `list_push_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_push_orders`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} + + path_params = {} + + 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 '_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 'transaction_type' in local_var_params and local_var_params['transaction_type'] is not None: # noqa: E501 + query_params.append(('transaction_type', local_var_params['transaction_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( + '/wallet/push', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[UidPushOrder]', # 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/withdrawal_api.py b/gate_api/api/withdrawal_api.py index 4b9ba17..7fb64dd 100644 --- a/gate_api/api/withdrawal_api.py +++ b/gate_api/api/withdrawal_api.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -18,7 +18,10 @@ import six from gate_api.api_client import ApiClient -from gate_api.exceptions import ApiTypeError, ApiValueError # noqa: F401 +from gate_api.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) class WithdrawalApi(object): @@ -36,6 +39,7 @@ def __init__(self, api_client=None): def withdraw(self, ledger_record, **kwargs): # noqa: E501 """Withdraw # noqa: E501 + If the recipient's on-chain address is also Gate, no transaction fee will be charged # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.withdraw(ledger_record, async_req=True) @@ -60,6 +64,7 @@ def withdraw(self, ledger_record, **kwargs): # noqa: E501 def withdraw_with_http_info(self, ledger_record, **kwargs): # noqa: E501 """Withdraw # noqa: E501 + If the recipient's on-chain address is also Gate, no transaction fee will be charged # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.withdraw_with_http_info(ledger_record, async_req=True) @@ -83,18 +88,29 @@ def withdraw_with_http_info(self, ledger_record, **kwargs): # noqa: E501 local_var_params = locals() - all_params = ['ledger_record'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'ledger_record' + ] + 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 withdraw" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method withdraw" % k + ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'ledger_record' is set - if self.api_client.client_side_validation and ( - 'ledger_record' not in local_var_params or local_var_params['ledger_record'] is None # noqa: E501 - ): # noqa: E501 + if self.api_client.client_side_validation and ('ledger_record' not in local_var_params or # noqa: E501 + local_var_params['ledger_record'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `ledger_record` when calling `withdraw`") # noqa: E501 collection_formats = {} @@ -112,19 +128,18 @@ def withdraw_with_http_info(self, ledger_record, **kwargs): # noqa: E501 if 'ledger_record' in local_var_params: body_params = local_var_params['ledger_record'] # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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 + ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( - '/withdrawals', - 'POST', + '/withdrawals', 'POST', path_params, query_params, header_params, @@ -137,9 +152,126 @@ def withdraw_with_http_info(self, ledger_record, **kwargs): # noqa: E501 _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, + collection_formats=collection_formats) + + def withdraw_push_order(self, uid_push_withdrawal, **kwargs): # noqa: E501 + """UID transfer # noqa: E501 + + Transfers between main spot accounts. Both parties cannot be sub-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.withdraw_push_order(uid_push_withdrawal, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param UidPushWithdrawal uid_push_withdrawal: (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.UidPushWithdrawalResp + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.withdraw_push_order_with_http_info(uid_push_withdrawal, **kwargs) # noqa: E501 + + def withdraw_push_order_with_http_info(self, uid_push_withdrawal, **kwargs): # noqa: E501 + """UID transfer # noqa: E501 + + Transfers between main spot accounts. Both parties cannot be sub-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.withdraw_push_order_with_http_info(uid_push_withdrawal, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param UidPushWithdrawal uid_push_withdrawal: (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.UidPushWithdrawalResp, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'uid_push_withdrawal' + ] + 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 withdraw_push_order" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'uid_push_withdrawal' is set + if self.api_client.client_side_validation and ('uid_push_withdrawal' not in local_var_params or # noqa: E501 + local_var_params['uid_push_withdrawal'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `uid_push_withdrawal` when calling `withdraw_push_order`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'uid_push_withdrawal' in local_var_params: + body_params = local_var_params['uid_push_withdrawal'] + # 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( + '/withdrawals/push', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='UidPushWithdrawalResp', # 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_withdrawal(self, withdrawal_id, **kwargs): # noqa: E501 """Cancel withdrawal with specified ID # noqa: E501 @@ -190,21 +322,30 @@ def cancel_withdrawal_with_http_info(self, withdrawal_id, **kwargs): # noqa: E5 local_var_params = locals() - all_params = ['withdrawal_id'] - all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + all_params = [ + 'withdrawal_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_withdrawal" % k) + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method cancel_withdrawal" % k + ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'withdrawal_id' is set - if self.api_client.client_side_validation and ( - 'withdrawal_id' not in local_var_params or local_var_params['withdrawal_id'] is None # noqa: E501 - ): # noqa: E501 - raise ApiValueError( - "Missing the required parameter `withdrawal_id` when calling `cancel_withdrawal`" - ) # noqa: E501 + if self.api_client.client_side_validation and ('withdrawal_id' not in local_var_params or # noqa: E501 + local_var_params['withdrawal_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `withdrawal_id` when calling `cancel_withdrawal`") # noqa: E501 collection_formats = {} @@ -221,14 +362,14 @@ def cancel_withdrawal_with_http_info(self, withdrawal_id, **kwargs): # noqa: E5 body_params = None # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + 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( - '/withdrawals/{withdrawal_id}', - 'DELETE', + '/withdrawals/{withdrawal_id}', 'DELETE', path_params, query_params, header_params, @@ -241,5 +382,4 @@ def cancel_withdrawal_with_http_info(self, withdrawal_id, **kwargs): # noqa: E5 _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, - ) + collection_formats=collection_formats) diff --git a/gate_api/api_client.py b/gate_api/api_client.py index 2105457..5d90c48 100644 --- a/gate_api/api_client.py +++ b/gate_api/api_client.py @@ -1,10 +1,10 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -70,7 +70,8 @@ class ApiClient(object): } _pool = None - def __init__(self, configuration=None, header_name=None, header_value=None, cookie=None, pool_threads=1): + def __init__(self, configuration=None, header_name=None, header_value=None, + cookie=None, pool_threads=1): if configuration is None: configuration = Configuration.get_default_copy() self.configuration = configuration @@ -82,7 +83,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None, cook self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/4.22.4/python' + self.user_agent = 'OpenAPI-Generator/7.1.8/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): @@ -122,23 +123,11 @@ def set_default_header(self, header_name, header_value): self.default_headers[header_name] = header_value def __call_api( - self, - resource_path, - method, - path_params=None, - query_params=None, - header_params=None, - body=None, - post_params=None, - files=None, - response_type=None, - auth_settings=None, - _return_http_data_only=None, - collection_formats=None, - _preload_content=True, - _request_timeout=None, - _host=None, - ): + self, resource_path, method, path_params=None, + query_params=None, header_params=None, body=None, post_params=None, + files=None, response_type=None, auth_settings=None, + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None, _host=None): config = self.configuration @@ -149,26 +138,33 @@ def __call_api( header_params['Cookie'] = self.cookie if header_params: header_params = self.sanitize_for_serialization(header_params) - header_params = dict(self.parameters_to_tuples(header_params, collection_formats)) + header_params = dict(self.parameters_to_tuples(header_params, + collection_formats)) # path parameters if path_params: path_params = self.sanitize_for_serialization(path_params) - path_params = self.parameters_to_tuples(path_params, collection_formats) + path_params = self.parameters_to_tuples(path_params, + collection_formats) for k, v in path_params: # specified safe chars, encode everything - resource_path = resource_path.replace('{%s}' % k, quote(str(v), safe=config.safe_chars_for_path_param)) + resource_path = resource_path.replace( + '{%s}' % k, + quote(str(v), safe=config.safe_chars_for_path_param) + ) # query parameters if query_params: query_params = self.sanitize_for_serialization(query_params) - query_params = self.parameters_to_tuples(query_params, collection_formats) + query_params = self.parameters_to_tuples(query_params, + collection_formats) # post parameters if post_params or files: post_params = post_params if post_params else [] post_params = self.sanitize_for_serialization(post_params) - post_params = self.parameters_to_tuples(post_params, collection_formats) + post_params = self.parameters_to_tuples(post_params, + collection_formats) post_params.extend(self.files_parameters(files)) # body @@ -188,15 +184,10 @@ def __call_api( try: # perform request and return response response_data = self.request( - method, - url, - query_params=query_params, - headers=header_params, - post_params=post_params, - body=body, + method, url, query_params=query_params, headers=header_params, + post_params=post_params, body=body, _preload_content=_preload_content, - _request_timeout=_request_timeout, - ) + _request_timeout=_request_timeout) except ApiException as e: e.body = e.body.decode('utf-8') if six.PY3 else e.body try: @@ -233,7 +224,8 @@ def __call_api( if _return_http_data_only: return return_data else: - return (return_data, response_data.status, response_data.getheaders()) + return (return_data, response_data.status, + response_data.getheaders()) def sanitize_for_serialization(self, obj): """Builds a JSON POST object. @@ -254,9 +246,11 @@ def sanitize_for_serialization(self, obj): elif isinstance(obj, self.PRIMITIVE_TYPES): return obj elif isinstance(obj, list): - return [self.sanitize_for_serialization(sub_obj) for sub_obj in obj] + return [self.sanitize_for_serialization(sub_obj) + for sub_obj in obj] elif isinstance(obj, tuple): - return tuple(self.sanitize_for_serialization(sub_obj) for sub_obj in obj) + return tuple(self.sanitize_for_serialization(sub_obj) + for sub_obj in obj) elif isinstance(obj, (datetime.datetime, datetime.date)): return obj.isoformat() @@ -268,13 +262,12 @@ def sanitize_for_serialization(self, obj): # and attributes which value is not None. # Convert attribute name to json key in # model definition for request. - obj_dict = { - obj.attribute_map[attr]: getattr(obj, attr) - for attr, _ in six.iteritems(obj.openapi_types) - if getattr(obj, attr) is not None - } + obj_dict = {obj.attribute_map[attr]: getattr(obj, attr) + for attr, _ in six.iteritems(obj.openapi_types) + if getattr(obj, attr) is not None} - return {key: self.sanitize_for_serialization(val) for key, val in six.iteritems(obj_dict)} + return {key: self.sanitize_for_serialization(val) + for key, val in six.iteritems(obj_dict)} def deserialize(self, response, response_type): """Deserializes response into an object. @@ -312,11 +305,13 @@ def __deserialize(self, data, klass): if type(klass) == str: if klass.startswith('list['): sub_kls = re.match(r'list\[(.*)\]', klass).group(1) - return [self.__deserialize(sub_data, sub_kls) for sub_data in data] + return [self.__deserialize(sub_data, sub_kls) + for sub_data in data] if klass.startswith('dict('): sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass).group(2) - return {k: self.__deserialize(v, sub_kls) for k, v in six.iteritems(data)} + return {k: self.__deserialize(v, sub_kls) + for k, v in six.iteritems(data)} # convert str to class if klass in self.NATIVE_TYPES_MAPPING: @@ -335,25 +330,12 @@ def __deserialize(self, data, klass): else: return self.__deserialize_model(data, klass) - def call_api( - self, - resource_path, - method, - path_params=None, - query_params=None, - header_params=None, - body=None, - post_params=None, - files=None, - response_type=None, - auth_settings=None, - async_req=None, - _return_http_data_only=None, - collection_formats=None, - _preload_content=True, - _request_timeout=None, - _host=None, - ): + def call_api(self, resource_path, method, + path_params=None, query_params=None, header_params=None, + body=None, post_params=None, files=None, + response_type=None, auth_settings=None, async_req=None, + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None, _host=None): """Makes the HTTP request (synchronous) and returns deserialized data. To make an async_req request, set the async_req parameter. @@ -392,122 +374,84 @@ def call_api( then the method will return the response directly. """ if not async_req: - return self.__call_api( - resource_path, - method, - path_params, - query_params, - header_params, - body, - post_params, - files, - response_type, - auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host, - ) - - return self.pool.apply_async( - self.__call_api, - ( - resource_path, - method, - path_params, - query_params, - header_params, - body, - post_params, - files, - response_type, - auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host, - ), - ) - - def request( - self, - method, - url, - query_params=None, - headers=None, - post_params=None, - body=None, - _preload_content=True, - _request_timeout=None, - ): + return self.__call_api(resource_path, method, + path_params, query_params, header_params, + body, post_params, files, + response_type, auth_settings, + _return_http_data_only, collection_formats, + _preload_content, _request_timeout, _host) + + return self.pool.apply_async(self.__call_api, (resource_path, + method, path_params, + query_params, + header_params, body, + post_params, files, + response_type, + auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, + _request_timeout, + _host)) + + def request(self, method, url, query_params=None, headers=None, + post_params=None, body=None, _preload_content=True, + _request_timeout=None): """Makes the HTTP request using RESTClient.""" if method == "GET": - return self.rest_client.GET( - url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers, - ) + return self.rest_client.GET(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) elif method == "HEAD": - return self.rest_client.HEAD( - url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers, - ) + return self.rest_client.HEAD(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) elif method == "OPTIONS": - return self.rest_client.OPTIONS( - url, - query_params=query_params, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - ) + return self.rest_client.OPTIONS(url, + query_params=query_params, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout) elif method == "POST": - return self.rest_client.POST( - url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, - ) + return self.rest_client.POST(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) elif method == "PUT": - return self.rest_client.PUT( - url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, - ) + return self.rest_client.PUT(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) elif method == "PATCH": - return self.rest_client.PATCH( - url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, - ) + return self.rest_client.PATCH(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) elif method == "DELETE": - return self.rest_client.DELETE( - url, - query_params=query_params, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, - ) + return self.rest_client.DELETE(url, + query_params=query_params, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) else: - raise ApiValueError("http method must be `GET`, `HEAD`, `OPTIONS`," " `POST`, `PATCH`, `PUT` or `DELETE`.") + raise ApiValueError( + "http method must be `GET`, `HEAD`, `OPTIONS`," + " `POST`, `PATCH`, `PUT` or `DELETE`." + ) def parameters_to_tuples(self, params, collection_formats): """Get parameters as list of tuples, formatting collections. @@ -533,7 +477,8 @@ def parameters_to_tuples(self, params, collection_formats): delimiter = '|' else: # csv is the default delimiter = ',' - new_params.append((k, delimiter.join(str(value) for value in v))) + new_params.append( + (k, delimiter.join(str(value) for value in v))) else: new_params.append((k, v)) return new_params @@ -555,8 +500,10 @@ def files_parameters(self, files=None): with open(n, 'rb') as f: filename = os.path.basename(f.name) filedata = f.read() - mimetype = mimetypes.guess_type(filename)[0] or 'application/octet-stream' - params.append(tuple([k, tuple([filename, filedata, mimetype])])) + mimetype = (mimetypes.guess_type(filename)[0] or + 'application/octet-stream') + params.append( + tuple([k, tuple([filename, filedata, mimetype])])) return params @@ -619,7 +566,9 @@ def update_params_for_auth(self, method, url, headers, querys, body, auth_settin elif auth_setting['in'] == 'query': querys.append((auth_setting['key'], auth_setting['value'])) else: - raise ApiValueError('Authentication token must be in `query` or `header`') + raise ApiValueError( + 'Authentication token must be in `query` or `header`' + ) def gen_sign(self, method, url, query_string=None, body=None): """generate authentication headers @@ -638,7 +587,8 @@ def gen_sign(self, method, url, query_string=None, body=None): m.update(body.encode('utf-8')) hashed_payload = m.hexdigest() s = '%s\n%s\n%s\n%s\n%s' % (method, url, query_string or "", hashed_payload, t) - sign = hmac.new(self.configuration.secret.encode('utf-8'), s.encode('utf-8'), hashlib.sha512).hexdigest() + sign = hmac.new(self.configuration.secret.encode('utf-8'), s.encode('utf-8'), + hashlib.sha512).hexdigest() return {'KEY': self.configuration.key, 'Timestamp': str(t), 'SIGN': sign} def __deserialize_file(self, response): @@ -656,7 +606,8 @@ def __deserialize_file(self, response): content_disposition = response.getheader("Content-Disposition") if content_disposition: - filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', content_disposition).group(1) + filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition).group(1) path = os.path.join(os.path.dirname(path), filename) with open(path, "wb") as f: @@ -697,7 +648,10 @@ def __deserialize_date(self, string): except ImportError: return string except ValueError: - raise rest.ApiException(status=0, reason="Failed to parse `{0}` as date object".format(string)) + raise rest.ApiException( + status=0, + reason="Failed to parse `{0}` as date object".format(string) + ) def __deserialize_datetime(self, string): """Deserializes string to datetime. @@ -712,7 +666,13 @@ def __deserialize_datetime(self, string): except ImportError: return string except ValueError: - raise rest.ApiException(status=0, reason=("Failed to parse `{0}` as datetime object".format(string))) + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as datetime object" + .format(string) + ) + ) def __deserialize_model(self, data, klass): """Deserializes list or dict to model. @@ -722,14 +682,17 @@ def __deserialize_model(self, data, klass): :return: model object. """ has_discriminator = False - if hasattr(klass, 'get_real_child_model') and klass.discriminator_value_class_map: + if (hasattr(klass, 'get_real_child_model') + and klass.discriminator_value_class_map): has_discriminator = True if not klass.openapi_types and has_discriminator is False: return data kwargs = {} - if data is not None and klass.openapi_types is not None and isinstance(data, (list, dict)): + if (data is not None and + klass.openapi_types is not None and + isinstance(data, (list, dict))): for attr, attr_type in six.iteritems(klass.openapi_types): if klass.attribute_map[attr] in data: value = data[klass.attribute_map[attr]] diff --git a/gate_api/configuration.py b/gate_api/configuration.py index aaafa83..e1a45a1 100644 --- a/gate_api/configuration.py +++ b/gate_api/configuration.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -62,15 +62,11 @@ class Configuration(object): _default = None - def __init__( - self, - host="https://api.gateio.ws/api/v4", - key=None, - secret=None, - username=None, - password=None, - discard_unknown_keys=False, - ): + def __init__(self, host="https://api.gateio.ws/api/v4", + key=None, secret=None, + username=None, password=None, + discard_unknown_keys=False, + ): """Constructor """ self.host = host @@ -291,7 +287,9 @@ def get_basic_auth_token(self): password = "" if self.password is not None: password = self.password - return urllib3.util.make_headers(basic_auth=username + ':' + password).get('authorization') + return urllib3.util.make_headers( + basic_auth=username + ':' + password + ).get('authorization') def auth_settings(self): """Gets Auth Settings dict for api client. @@ -312,13 +310,12 @@ def to_debug_report(self): :return: The report for debugging. """ - return ( - "Python SDK Debug Report:\n" - "OS: {env}\n" - "Python Version: {pyversion}\n" - "Version of the API: 4.22.4\n" - "SDK Package Version: 4.22.4".format(env=sys.platform, pyversion=sys.version) - ) + return "Python SDK Debug Report:\n"\ + "OS: {env}\n"\ + "Python Version: {pyversion}\n"\ + "Version of the API: v4.105.8\n"\ + "SDK Package Version: 7.1.8".\ + format(env=sys.platform, pyversion=sys.version) def get_host_settings(self): """Gets an array of host settings @@ -326,8 +323,14 @@ def get_host_settings(self): :return: An array of host settings """ return [ - {'url': "https://api.gateio.ws/api/v4", 'description': "Real Trading",}, - {'url': "https://fx-api-testnet.gateio.ws/api/v4", 'description': "TestNet Trading",}, + { + 'url': "https://api.gateio.ws/api/v4", + 'description': "Real trading", + }, + { + 'url': "https://fx-api-testnet.gateio.ws/api/v4", + 'description': "TestNet trading", + } ] def get_host_from_settings(self, index, variables=None): @@ -344,20 +347,22 @@ def get_host_from_settings(self, index, variables=None): except IndexError: raise ValueError( "Invalid index {0} when selecting the host settings. " - "Must be less than {1}".format(index, len(servers)) - ) + "Must be less than {1}".format(index, len(servers))) url = server['url'] # go through variables and replace placeholders for variable_name, variable in server['variables'].items(): - used_value = variables.get(variable_name, variable['default_value']) + used_value = variables.get( + variable_name, variable['default_value']) - if 'enum_values' in variable and used_value not in variable['enum_values']: + if 'enum_values' in variable \ + and used_value not in variable['enum_values']: raise ValueError( "The variable `{0}` in the host URL has invalid value " - "{1}. Must be {2}.".format(variable_name, variables[variable_name], variable['enum_values']) - ) + "{1}. Must be {2}.".format( + variable_name, variables[variable_name], + variable['enum_values'])) url = url.replace("{" + variable_name + "}", used_value) diff --git a/gate_api/exceptions.py b/gate_api/exceptions.py index 73f3d71..31ff2ea 100644 --- a/gate_api/exceptions.py +++ b/gate_api/exceptions.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -18,7 +18,8 @@ class OpenApiException(Exception): class ApiTypeError(OpenApiException, TypeError): - def __init__(self, msg, path_to_item=None, valid_classes=None, key_type=None): + def __init__(self, msg, path_to_item=None, valid_classes=None, + key_type=None): """ Raises an exception for TypeErrors Args: @@ -81,6 +82,7 @@ def __init__(self, msg, path_to_item=None): class ApiException(OpenApiException): + def __init__(self, status=None, reason=None, http_resp=None): if http_resp: self.status = http_resp.status @@ -95,9 +97,11 @@ def __init__(self, status=None, reason=None, http_resp=None): def __str__(self): """Custom error messages for exception""" - error_message = "({0})\n" "Reason: {1}\n".format(self.status, self.reason) + error_message = "({0})\n"\ + "Reason: {1}\n".format(self.status, self.reason) if self.headers: - error_message += "HTTP response headers: {0}\n".format(self.headers) + error_message += "HTTP response headers: {0}\n".format( + self.headers) if self.body: error_message += "HTTP response body: {0}\n".format(self.body) diff --git a/gate_api/models/__init__.py b/gate_api/models/__init__.py index c8594c6..4976416 100644 --- a/gate_api/models/__init__.py +++ b/gate_api/models/__init__.py @@ -2,11 +2,11 @@ # flake8: noqa """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -15,72 +15,256 @@ # import models into model package from gate_api.models.account_balance import AccountBalance +from gate_api.models.account_detail import AccountDetail +from gate_api.models.account_detail_key import AccountDetailKey +from gate_api.models.account_rate_limit import AccountRateLimit +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.auto_repay_setting import AutoRepaySetting +from gate_api.models.batch_amend_item import BatchAmendItem +from gate_api.models.batch_amend_order_req import BatchAmendOrderReq +from gate_api.models.batch_futures_order import BatchFuturesOrder from gate_api.models.batch_order import BatchOrder -from gate_api.models.cancel_order import CancelOrder +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_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.cancel_batch_order import CancelBatchOrder from gate_api.models.cancel_order_result import CancelOrderResult +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.contract import Contract from gate_api.models.contract_stat import ContractStat -from gate_api.models.cross_margin_account import CrossMarginAccount -from gate_api.models.cross_margin_account_book import CrossMarginAccountBook +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_multi_collateral_order import CreateMultiCollateralOrder +from gate_api.models.create_uni_lend import CreateUniLend +from gate_api.models.create_uni_loan import CreateUniLoan from gate_api.models.cross_margin_balance import CrossMarginBalance -from gate_api.models.cross_margin_borrowable import CrossMarginBorrowable -from gate_api.models.cross_margin_currency import CrossMarginCurrency from gate_api.models.cross_margin_loan import CrossMarginLoan -from gate_api.models.cross_margin_repay_request import CrossMarginRepayRequest from gate_api.models.cross_margin_repayment import CrossMarginRepayment -from gate_api.models.cross_margin_transferable import CrossMarginTransferable 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.delivery_candlestick import DeliveryCandlestick from gate_api.models.delivery_contract import DeliveryContract from gate_api.models.delivery_settlement import DeliverySettlement +from gate_api.models.delivery_ticker import DeliveryTicker from gate_api.models.deposit_address import DepositAddress +from gate_api.models.deposit_record import DepositRecord +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.flash_swap_currency_pair import FlashSwapCurrencyPair +from gate_api.models.flash_swap_order import FlashSwapOrder +from gate_api.models.flash_swap_order_preview import FlashSwapOrderPreview +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 -from gate_api.models.funding_book_item import FundingBookItem from gate_api.models.funding_rate_record import FundingRateRecord +from gate_api.models.future_cancel_order_result import FutureCancelOrderResult from gate_api.models.futures_account import FuturesAccount from gate_api.models.futures_account_book import FuturesAccountBook +from gate_api.models.futures_account_history import FuturesAccountHistory +from gate_api.models.futures_auto_deleverage import FuturesAutoDeleverage +from gate_api.models.futures_batch_amend_order_request import FuturesBatchAmendOrderRequest from gate_api.models.futures_candlestick import FuturesCandlestick +from gate_api.models.futures_fee import FuturesFee +from gate_api.models.futures_index_constituents import FuturesIndexConstituents from gate_api.models.futures_initial_order import FuturesInitialOrder +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 from gate_api.models.futures_order import FuturesOrder +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_position_cross_mode import FuturesPositionCrossMode +from gate_api.models.futures_premium_index import FuturesPremiumIndex from gate_api.models.futures_price_trigger import FuturesPriceTrigger from gate_api.models.futures_price_triggered_order import FuturesPriceTriggeredOrder +from gate_api.models.futures_risk_limit_tier import FuturesRiskLimitTier from gate_api.models.futures_ticker import FuturesTicker from gate_api.models.futures_trade import FuturesTrade +from gate_api.models.index_constituent import IndexConstituent +from gate_api.models.inline_object import InlineObject +from gate_api.models.inline_response200 import InlineResponse200 +from gate_api.models.inline_response2001 import InlineResponse2001 from gate_api.models.insurance_record import InsuranceRecord from gate_api.models.ledger_record import LedgerRecord -from gate_api.models.loan import Loan -from gate_api.models.loan_patch import LoanPatch -from gate_api.models.loan_record import LoanRecord +from gate_api.models.liquidate_order import LiquidateOrder 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_borrowable import MarginBorrowable -from gate_api.models.margin_currency_pair import MarginCurrencyPair +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 from gate_api.models.margin_transferable import MarginTransferable +from gate_api.models.max_uni_borrowable import MaxUniBorrowable +from gate_api.models.mock_futures_order import MockFuturesOrder +from gate_api.models.mock_futures_position import MockFuturesPosition +from gate_api.models.mock_margin_result import MockMarginResult +from gate_api.models.mock_options_order import MockOptionsOrder +from gate_api.models.mock_options_position import MockOptionsPosition +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.multi_chain_address_item import MultiChainAddressItem +from gate_api.models.multi_collateral_currency import MultiCollateralCurrency +from gate_api.models.multi_collateral_item import MultiCollateralItem +from gate_api.models.multi_collateral_order import MultiCollateralOrder +from gate_api.models.multi_collateral_record import MultiCollateralRecord +from gate_api.models.multi_collateral_record_currency import MultiCollateralRecordCurrency +from gate_api.models.multi_loan_item import MultiLoanItem +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_futures_trade import MyFuturesTrade +from gate_api.models.my_futures_trade_time_range import MyFuturesTradeTimeRange from gate_api.models.open_orders import OpenOrders +from gate_api.models.options_account import OptionsAccount +from gate_api.models.options_account_book import OptionsAccountBook +from gate_api.models.options_candlestick import OptionsCandlestick +from gate_api.models.options_contract import OptionsContract +from gate_api.models.options_mmp import OptionsMMP +from gate_api.models.options_mmp_reset import OptionsMMPReset +from gate_api.models.options_my_settlements import OptionsMySettlements +from gate_api.models.options_my_trade import OptionsMyTrade +from gate_api.models.options_order import OptionsOrder +from gate_api.models.options_position import OptionsPosition +from gate_api.models.options_position_close import OptionsPositionClose +from gate_api.models.options_position_close_order import OptionsPositionCloseOrder +from gate_api.models.options_settlement import OptionsSettlement +from gate_api.models.options_ticker import OptionsTicker +from gate_api.models.options_underlying import OptionsUnderlying +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_cancel import OrderCancel +from gate_api.models.order_patch import OrderPatch +from gate_api.models.order_resp import OrderResp +from gate_api.models.partner_commission_history import PartnerCommissionHistory +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_dual_investment_order import PlaceDualInvestmentOrder 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.repay_request import RepayRequest -from gate_api.models.repayment import Repayment +from gate_api.models.profit_loss_range import ProfitLossRange +from gate_api.models.rebate_user_info import RebateUserInfo +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.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_insurance_history import SpotInsuranceHistory 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.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.sub_account import SubAccount from gate_api.models.sub_account_balance import SubAccountBalance +from gate_api.models.sub_account_cross_margin_balance import SubAccountCrossMarginBalance +from gate_api.models.sub_account_futures_balance import SubAccountFuturesBalance +from gate_api.models.sub_account_key import SubAccountKey +from gate_api.models.sub_account_key_perms import SubAccountKeyPerms +from gate_api.models.sub_account_margin_balance import SubAccountMarginBalance +from gate_api.models.sub_account_to_sub_account import SubAccountToSubAccount from gate_api.models.sub_account_transfer import SubAccountTransfer +from gate_api.models.sub_account_transfer_record_item import SubAccountTransferRecordItem +from gate_api.models.sub_cross_margin_account import SubCrossMarginAccount +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.system_time import SystemTime from gate_api.models.ticker import Ticker from gate_api.models.total_balance import TotalBalance from gate_api.models.trade import Trade from gate_api.models.trade_fee import TradeFee +from gate_api.models.transaction_id import TransactionID from gate_api.models.transfer import Transfer +from gate_api.models.transfer_order_status import TransferOrderStatus +from gate_api.models.transferables_result import TransferablesResult from gate_api.models.trigger_order_response import TriggerOrderResponse +from gate_api.models.trigger_time import TriggerTime +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_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_interest_record import UniInterestRecord +from gate_api.models.uni_lend import UniLend +from gate_api.models.uni_lend_interest import UniLendInterest +from gate_api.models.uni_lend_record import UniLendRecord +from gate_api.models.uni_loan import UniLoan +from gate_api.models.uni_loan_interest_record import UniLoanInterestRecord +from gate_api.models.uni_loan_record import UniLoanRecord +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 +from gate_api.models.unified_discount import UnifiedDiscount +from gate_api.models.unified_discount_tiers import UnifiedDiscountTiers +from gate_api.models.unified_history_loan_rate import UnifiedHistoryLoanRate +from gate_api.models.unified_history_loan_rate_rates import UnifiedHistoryLoanRateRates +from gate_api.models.unified_leverage_config import UnifiedLeverageConfig +from gate_api.models.unified_leverage_setting import UnifiedLeverageSetting +from gate_api.models.unified_loan import UnifiedLoan +from gate_api.models.unified_loan_record import UnifiedLoanRecord +from gate_api.models.unified_loan_result import UnifiedLoanResult +from gate_api.models.unified_margin_tiers import UnifiedMarginTiers +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_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.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 diff --git a/gate_api/models/account_balance.py b/gate_api/models/account_balance.py index 70d9ef7..f213fb7 100644 --- a/gate_api/models/account_balance.py +++ b/gate_api/models/account_balance.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -32,12 +32,22 @@ class AccountBalance(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {'amount': 'str', 'currency': 'str'} - - attribute_map = {'amount': 'amount', 'currency': 'currency'} - - def __init__(self, amount=None, currency=None, local_vars_configuration=None): # noqa: E501 - # type: (str, str, Configuration) -> None + openapi_types = { + 'amount': 'str', + 'currency': 'str', + 'unrealised_pnl': 'str', + 'borrowed': 'str' + } + + attribute_map = { + 'amount': 'amount', + 'currency': 'currency', + 'unrealised_pnl': 'unrealised_pnl', + 'borrowed': 'borrowed' + } + + def __init__(self, amount=None, currency=None, unrealised_pnl=None, borrowed=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, Configuration) -> None """AccountBalance - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -45,12 +55,18 @@ def __init__(self, amount=None, currency=None, local_vars_configuration=None): self._amount = None self._currency = None + self._unrealised_pnl = None + self._borrowed = None self.discriminator = None if amount is not None: self.amount = amount if currency is not None: self.currency = currency + if unrealised_pnl is not None: + self.unrealised_pnl = unrealised_pnl + if borrowed is not None: + self.borrowed = borrowed @property def amount(self): @@ -98,11 +114,58 @@ def currency(self, currency): allowed_values = ["BTC", "CNY", "USD", "USDT"] # noqa: E501 if self.local_vars_configuration.client_side_validation and currency not in allowed_values: # noqa: E501 raise ValueError( - "Invalid value for `currency` ({0}), must be one of {1}".format(currency, allowed_values) # noqa: E501 + "Invalid value for `currency` ({0}), must be one of {1}" # noqa: E501 + .format(currency, allowed_values) ) self._currency = currency + @property + def unrealised_pnl(self): + """Gets the unrealised_pnl of this AccountBalance. # noqa: E501 + + Unrealised_pnl, this field will only appear in futures, options, delivery, and total accounts # noqa: E501 + + :return: The unrealised_pnl of this AccountBalance. # noqa: E501 + :rtype: str + """ + return self._unrealised_pnl + + @unrealised_pnl.setter + def unrealised_pnl(self, unrealised_pnl): + """Sets the unrealised_pnl of this AccountBalance. + + Unrealised_pnl, this field will only appear in futures, options, delivery, and total accounts # noqa: E501 + + :param unrealised_pnl: The unrealised_pnl of this AccountBalance. # noqa: E501 + :type: str + """ + + self._unrealised_pnl = unrealised_pnl + + @property + def borrowed(self): + """Gets the borrowed of this AccountBalance. # noqa: E501 + + Total borrowed amount, this field will only appear in margin and cross_margin accounts # noqa: E501 + + :return: The borrowed of this AccountBalance. # noqa: E501 + :rtype: str + """ + return self._borrowed + + @borrowed.setter + def borrowed(self, borrowed): + """Sets the borrowed of this AccountBalance. + + Total borrowed amount, this field will only appear in margin and cross_margin accounts # noqa: E501 + + :param borrowed: The borrowed of this AccountBalance. # noqa: E501 + :type: str + """ + + self._borrowed = borrowed + def to_dict(self): """Returns the model properties as a dict""" result = {} @@ -110,16 +173,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/account_detail.py b/gate_api/models/account_detail.py new file mode 100644 index 0000000..7854045 --- /dev/null +++ b/gate_api/models/account_detail.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 AccountDetail(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'ip_whitelist': 'list[str]', + 'currency_pairs': 'list[str]', + 'user_id': 'int', + 'tier': 'int', + 'key': 'AccountDetailKey', + 'copy_trading_role': 'int' + } + + attribute_map = { + 'ip_whitelist': 'ip_whitelist', + 'currency_pairs': 'currency_pairs', + 'user_id': 'user_id', + 'tier': 'tier', + 'key': 'key', + 'copy_trading_role': 'copy_trading_role' + } + + def __init__(self, ip_whitelist=None, currency_pairs=None, user_id=None, tier=None, key=None, copy_trading_role=None, local_vars_configuration=None): # noqa: E501 + # type: (list[str], list[str], int, int, AccountDetailKey, int, Configuration) -> None + """AccountDetail - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._ip_whitelist = None + self._currency_pairs = None + self._user_id = None + self._tier = None + self._key = None + self._copy_trading_role = None + self.discriminator = None + + if ip_whitelist is not None: + self.ip_whitelist = ip_whitelist + if currency_pairs is not None: + self.currency_pairs = currency_pairs + if user_id is not None: + self.user_id = user_id + if tier is not None: + self.tier = tier + if key is not None: + self.key = key + if copy_trading_role is not None: + self.copy_trading_role = copy_trading_role + + @property + def ip_whitelist(self): + """Gets the ip_whitelist of this AccountDetail. # noqa: E501 + + IP Whitelist # noqa: E501 + + :return: The ip_whitelist of this AccountDetail. # noqa: E501 + :rtype: list[str] + """ + return self._ip_whitelist + + @ip_whitelist.setter + def ip_whitelist(self, ip_whitelist): + """Sets the ip_whitelist of this AccountDetail. + + IP Whitelist # noqa: E501 + + :param ip_whitelist: The ip_whitelist of this AccountDetail. # noqa: E501 + :type: list[str] + """ + + self._ip_whitelist = ip_whitelist + + @property + def currency_pairs(self): + """Gets the currency_pairs of this AccountDetail. # noqa: E501 + + Trading pair whitelist # noqa: E501 + + :return: The currency_pairs of this AccountDetail. # noqa: E501 + :rtype: list[str] + """ + return self._currency_pairs + + @currency_pairs.setter + def currency_pairs(self, currency_pairs): + """Sets the currency_pairs of this AccountDetail. + + Trading pair whitelist # noqa: E501 + + :param currency_pairs: The currency_pairs of this AccountDetail. # noqa: E501 + :type: list[str] + """ + + self._currency_pairs = currency_pairs + + @property + def user_id(self): + """Gets the user_id of this AccountDetail. # noqa: E501 + + User ID # noqa: E501 + + :return: The user_id of this AccountDetail. # noqa: E501 + :rtype: int + """ + return self._user_id + + @user_id.setter + def user_id(self, user_id): + """Sets the user_id of this AccountDetail. + + User ID # noqa: E501 + + :param user_id: The user_id of this AccountDetail. # noqa: E501 + :type: int + """ + + self._user_id = user_id + + @property + def tier(self): + """Gets the tier of this AccountDetail. # noqa: E501 + + User VIP level # noqa: E501 + + :return: The tier of this AccountDetail. # noqa: E501 + :rtype: int + """ + return self._tier + + @tier.setter + def tier(self, tier): + """Sets the tier of this AccountDetail. + + User VIP level # noqa: E501 + + :param tier: The tier of this AccountDetail. # noqa: E501 + :type: int + """ + + self._tier = tier + + @property + def key(self): + """Gets the key of this AccountDetail. # noqa: E501 + + + :return: The key of this AccountDetail. # noqa: E501 + :rtype: AccountDetailKey + """ + return self._key + + @key.setter + def key(self, key): + """Sets the key of this AccountDetail. + + + :param key: The key of this AccountDetail. # noqa: E501 + :type: AccountDetailKey + """ + + self._key = key + + @property + def copy_trading_role(self): + """Gets the copy_trading_role of this AccountDetail. # noqa: E501 + + User role: 0 - Normal user, 1 - Copy trading leader, 2 - Follower, 3 - Both leader and follower # noqa: E501 + + :return: The copy_trading_role of this AccountDetail. # noqa: E501 + :rtype: int + """ + return self._copy_trading_role + + @copy_trading_role.setter + def copy_trading_role(self, copy_trading_role): + """Sets the copy_trading_role of this AccountDetail. + + User role: 0 - Normal user, 1 - Copy trading leader, 2 - Follower, 3 - Both leader and follower # noqa: E501 + + :param copy_trading_role: The copy_trading_role of this AccountDetail. # noqa: E501 + :type: int + """ + + self._copy_trading_role = copy_trading_role + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AccountDetail): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AccountDetail): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/account_detail_key.py b/gate_api/models/account_detail_key.py new file mode 100644 index 0000000..d9e3728 --- /dev/null +++ b/gate_api/models/account_detail_key.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 AccountDetailKey(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'mode': 'int' + } + + attribute_map = { + 'mode': 'mode' + } + + def __init__(self, mode=None, local_vars_configuration=None): # noqa: E501 + # type: (int, Configuration) -> None + """AccountDetailKey - a 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.discriminator = None + + if mode is not None: + self.mode = mode + + @property + def mode(self): + """Gets the mode of this AccountDetailKey. # noqa: E501 + + Mode: 1 - Classic mode, 2 - Legacy unified mode # noqa: E501 + + :return: The mode of this AccountDetailKey. # noqa: E501 + :rtype: int + """ + return self._mode + + @mode.setter + def mode(self, mode): + """Sets the mode of this AccountDetailKey. + + Mode: 1 - Classic mode, 2 - Legacy unified mode # noqa: E501 + + :param mode: The mode of this AccountDetailKey. # noqa: E501 + :type: int + """ + + self._mode = 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, AccountDetailKey): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AccountDetailKey): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/account_rate_limit.py b/gate_api/models/account_rate_limit.py new file mode 100644 index 0000000..2fd7e27 --- /dev/null +++ b/gate_api/models/account_rate_limit.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 AccountRateLimit(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'tier': 'str', + 'ratio': 'str', + 'main_ratio': 'str', + 'updated_at': 'str' + } + + attribute_map = { + 'tier': 'tier', + 'ratio': 'ratio', + 'main_ratio': 'main_ratio', + 'updated_at': 'updated_at' + } + + def __init__(self, tier=None, ratio=None, main_ratio=None, updated_at=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, Configuration) -> None + """AccountRateLimit - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._tier = None + self._ratio = None + self._main_ratio = None + self._updated_at = None + self.discriminator = None + + if tier is not None: + self.tier = tier + if ratio is not None: + self.ratio = ratio + if main_ratio is not None: + self.main_ratio = main_ratio + if updated_at is not None: + self.updated_at = updated_at + + @property + def tier(self): + """Gets the tier of this AccountRateLimit. # noqa: E501 + + Frequency limit level (For detailed frequency limit rules, see [Transaction ratio frequency limit](#rate-limit-based-on-fill-ratio)) # noqa: E501 + + :return: The tier of this AccountRateLimit. # noqa: E501 + :rtype: str + """ + return self._tier + + @tier.setter + def tier(self, tier): + """Sets the tier of this AccountRateLimit. + + Frequency limit level (For detailed frequency limit rules, see [Transaction ratio frequency limit](#rate-limit-based-on-fill-ratio)) # noqa: E501 + + :param tier: The tier of this AccountRateLimit. # noqa: E501 + :type: str + """ + + self._tier = tier + + @property + def ratio(self): + """Gets the ratio of this AccountRateLimit. # noqa: E501 + + Fill rate # noqa: E501 + + :return: The ratio of this AccountRateLimit. # noqa: E501 + :rtype: str + """ + return self._ratio + + @ratio.setter + def ratio(self, ratio): + """Sets the ratio of this AccountRateLimit. + + Fill rate # noqa: E501 + + :param ratio: The ratio of this AccountRateLimit. # noqa: E501 + :type: str + """ + + self._ratio = ratio + + @property + def main_ratio(self): + """Gets the main_ratio of this AccountRateLimit. # noqa: E501 + + Total fill ratio of main account # noqa: E501 + + :return: The main_ratio of this AccountRateLimit. # noqa: E501 + :rtype: str + """ + return self._main_ratio + + @main_ratio.setter + def main_ratio(self, main_ratio): + """Sets the main_ratio of this AccountRateLimit. + + Total fill ratio of main account # noqa: E501 + + :param main_ratio: The main_ratio of this AccountRateLimit. # noqa: E501 + :type: str + """ + + self._main_ratio = main_ratio + + @property + def updated_at(self): + """Gets the updated_at of this AccountRateLimit. # noqa: E501 + + Update time # noqa: E501 + + :return: The updated_at of this AccountRateLimit. # noqa: E501 + :rtype: str + """ + return self._updated_at + + @updated_at.setter + def updated_at(self, updated_at): + """Sets the updated_at of this AccountRateLimit. + + Update time # noqa: E501 + + :param updated_at: The updated_at of this AccountRateLimit. # noqa: E501 + :type: str + """ + + self._updated_at = updated_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, AccountRateLimit): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AccountRateLimit): + 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 new file mode 100644 index 0000000..d843953 --- /dev/null +++ b/gate_api/models/agency_commission.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 AgencyCommission(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'commission_time': 'int', + 'user_id': 'int', + 'group_name': 'str', + 'commission_amount': 'str', + 'commission_asset': 'str', + 'source': 'str' + } + + attribute_map = { + 'commission_time': 'commission_time', + 'user_id': 'user_id', + 'group_name': 'group_name', + 'commission_amount': 'commission_amount', + 'commission_asset': 'commission_asset', + 'source': 'source' + } + + def __init__(self, commission_time=None, user_id=None, group_name=None, commission_amount=None, commission_asset=None, source=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, str, str, str, str, Configuration) -> None + """AgencyCommission - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._commission_time = None + self._user_id = None + self._group_name = None + self._commission_amount = None + self._commission_asset = None + self._source = None + self.discriminator = None + + if commission_time is not None: + self.commission_time = commission_time + if user_id is not None: + self.user_id = user_id + if group_name is not None: + self.group_name = group_name + if commission_amount is not None: + self.commission_amount = commission_amount + if commission_asset is not None: + self.commission_asset = commission_asset + if source is not None: + self.source = source + + @property + def commission_time(self): + """Gets the commission_time of this AgencyCommission. # noqa: E501 + + Commission time (Unix timestamp in seconds) # noqa: E501 + + :return: The commission_time of this AgencyCommission. # noqa: E501 + :rtype: int + """ + return self._commission_time + + @commission_time.setter + def commission_time(self, commission_time): + """Sets the commission_time of this AgencyCommission. + + Commission time (Unix timestamp in seconds) # noqa: E501 + + :param commission_time: The commission_time of this AgencyCommission. # noqa: E501 + :type: int + """ + + self._commission_time = commission_time + + @property + def user_id(self): + """Gets the user_id of this AgencyCommission. # noqa: E501 + + User ID # noqa: E501 + + :return: The user_id of this AgencyCommission. # noqa: E501 + :rtype: int + """ + return self._user_id + + @user_id.setter + def user_id(self, user_id): + """Sets the user_id of this AgencyCommission. + + User ID # noqa: E501 + + :param user_id: The user_id of this AgencyCommission. # noqa: E501 + :type: int + """ + + self._user_id = user_id + + @property + def group_name(self): + """Gets the group_name of this AgencyCommission. # noqa: E501 + + Group name # noqa: E501 + + :return: The group_name of this AgencyCommission. # noqa: E501 + :rtype: str + """ + return self._group_name + + @group_name.setter + def group_name(self, group_name): + """Sets the group_name of this AgencyCommission. + + Group name # noqa: E501 + + :param group_name: The group_name of this AgencyCommission. # noqa: E501 + :type: str + """ + + self._group_name = group_name + + @property + def commission_amount(self): + """Gets the commission_amount of this AgencyCommission. # noqa: E501 + + Transaction amount # noqa: E501 + + :return: The commission_amount of this AgencyCommission. # noqa: E501 + :rtype: str + """ + return self._commission_amount + + @commission_amount.setter + def commission_amount(self, commission_amount): + """Sets the commission_amount of this AgencyCommission. + + Transaction amount # noqa: E501 + + :param commission_amount: The commission_amount of this AgencyCommission. # noqa: E501 + :type: str + """ + + self._commission_amount = commission_amount + + @property + def commission_asset(self): + """Gets the commission_asset of this AgencyCommission. # noqa: E501 + + Commission Asset # noqa: E501 + + :return: The commission_asset of this AgencyCommission. # noqa: E501 + :rtype: str + """ + return self._commission_asset + + @commission_asset.setter + def commission_asset(self, commission_asset): + """Sets the commission_asset of this AgencyCommission. + + Commission Asset # noqa: E501 + + :param commission_asset: The commission_asset of this AgencyCommission. # noqa: E501 + :type: str + """ + + self._commission_asset = commission_asset + + @property + def source(self): + """Gets the source of this AgencyCommission. # noqa: E501 + + Commission source: SPOT - Spot commission, FUTURES - Futures commission # noqa: E501 + + :return: The source of this AgencyCommission. # noqa: E501 + :rtype: str + """ + return self._source + + @source.setter + def source(self, source): + """Sets the source of this AgencyCommission. + + Commission source: SPOT - Spot commission, FUTURES - Futures commission # noqa: E501 + + :param source: The source of this AgencyCommission. # noqa: E501 + :type: str + """ + + self._source = 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, AgencyCommission): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AgencyCommission): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/agency_commission_history.py b/gate_api/models/agency_commission_history.py new file mode 100644 index 0000000..50fd672 --- /dev/null +++ b/gate_api/models/agency_commission_history.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 AgencyCommissionHistory(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'total': 'int', + 'list': 'list[AgencyCommission]' + } + + attribute_map = { + 'currency_pair': 'currency_pair', + 'total': 'total', + 'list': 'list' + } + + def __init__(self, currency_pair=None, total=None, list=None, local_vars_configuration=None): # noqa: E501 + # type: (str, int, list[AgencyCommission], Configuration) -> None + """AgencyCommissionHistory - a 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._total = None + self._list = None + self.discriminator = None + + if currency_pair is not None: + self.currency_pair = currency_pair + if total is not None: + self.total = total + if list is not None: + self.list = list + + @property + def currency_pair(self): + """Gets the currency_pair of this AgencyCommissionHistory. # noqa: E501 + + Currency pair # noqa: E501 + + :return: The currency_pair of this AgencyCommissionHistory. # noqa: E501 + :rtype: str + """ + return self._currency_pair + + @currency_pair.setter + def currency_pair(self, currency_pair): + """Sets the currency_pair of this AgencyCommissionHistory. + + Currency pair # noqa: E501 + + :param currency_pair: The currency_pair of this AgencyCommissionHistory. # noqa: E501 + :type: str + """ + + self._currency_pair = currency_pair + + @property + def total(self): + """Gets the total of this AgencyCommissionHistory. # noqa: E501 + + Total # noqa: E501 + + :return: The total of this AgencyCommissionHistory. # noqa: E501 + :rtype: int + """ + return self._total + + @total.setter + def total(self, total): + """Sets the total of this AgencyCommissionHistory. + + Total # noqa: E501 + + :param total: The total of this AgencyCommissionHistory. # noqa: E501 + :type: int + """ + + self._total = total + + @property + def list(self): + """Gets the list of this AgencyCommissionHistory. # noqa: E501 + + List of commission history # noqa: E501 + + :return: The list of this AgencyCommissionHistory. # noqa: E501 + :rtype: list[AgencyCommission] + """ + return self._list + + @list.setter + def list(self, list): + """Sets the list of this AgencyCommissionHistory. + + List of commission history # noqa: E501 + + :param list: The list of this AgencyCommissionHistory. # noqa: E501 + :type: list[AgencyCommission] + """ + + 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, AgencyCommissionHistory): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AgencyCommissionHistory): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/agency_transaction.py b/gate_api/models/agency_transaction.py new file mode 100644 index 0000000..abdf119 --- /dev/null +++ b/gate_api/models/agency_transaction.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 AgencyTransaction(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'fee_asset': 'str', + 'currency_pair': 'str', + 'amount': 'str', + 'amount_asset': 'str', + 'source': 'str' + } + + attribute_map = { + 'transaction_time': 'transaction_time', + 'user_id': 'user_id', + 'group_name': 'group_name', + 'fee': 'fee', + 'fee_asset': 'fee_asset', + 'currency_pair': 'currency_pair', + 'amount': 'amount', + 'amount_asset': 'amount_asset', + 'source': 'source' + } + + def __init__(self, transaction_time=None, user_id=None, group_name=None, fee=None, fee_asset=None, currency_pair=None, amount=None, amount_asset=None, source=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, str, str, str, str, str, str, str, Configuration) -> None + """AgencyTransaction - a 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._fee_asset = None + self._currency_pair = None + self._amount = None + self._amount_asset = None + self._source = 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 fee_asset is not None: + self.fee_asset = fee_asset + if currency_pair is not None: + self.currency_pair = currency_pair + if amount is not None: + self.amount = amount + if amount_asset is not None: + self.amount_asset = amount_asset + if source is not None: + self.source = source + + @property + def transaction_time(self): + """Gets the transaction_time of this AgencyTransaction. # noqa: E501 + + Transaction Time. (unix timestamp) # noqa: E501 + + :return: The transaction_time of this AgencyTransaction. # noqa: E501 + :rtype: int + """ + return self._transaction_time + + @transaction_time.setter + def transaction_time(self, transaction_time): + """Sets the transaction_time of this AgencyTransaction. + + Transaction Time. (unix timestamp) # noqa: E501 + + :param transaction_time: The transaction_time of this AgencyTransaction. # noqa: E501 + :type: int + """ + + self._transaction_time = transaction_time + + @property + def user_id(self): + """Gets the user_id of this AgencyTransaction. # noqa: E501 + + User ID # noqa: E501 + + :return: The user_id of this AgencyTransaction. # noqa: E501 + :rtype: int + """ + return self._user_id + + @user_id.setter + def user_id(self, user_id): + """Sets the user_id of this AgencyTransaction. + + User ID # noqa: E501 + + :param user_id: The user_id of this AgencyTransaction. # noqa: E501 + :type: int + """ + + self._user_id = user_id + + @property + def group_name(self): + """Gets the group_name of this AgencyTransaction. # noqa: E501 + + Group name # noqa: E501 + + :return: The group_name of this AgencyTransaction. # noqa: E501 + :rtype: str + """ + return self._group_name + + @group_name.setter + def group_name(self, group_name): + """Sets the group_name of this AgencyTransaction. + + Group name # noqa: E501 + + :param group_name: The group_name of this AgencyTransaction. # noqa: E501 + :type: str + """ + + self._group_name = group_name + + @property + def fee(self): + """Gets the fee of this AgencyTransaction. # noqa: E501 + + Fee # noqa: E501 + + :return: The fee of this AgencyTransaction. # noqa: E501 + :rtype: str + """ + return self._fee + + @fee.setter + def fee(self, fee): + """Sets the fee of this AgencyTransaction. + + Fee # noqa: E501 + + :param fee: The fee of this AgencyTransaction. # noqa: E501 + :type: str + """ + + self._fee = fee + + @property + def fee_asset(self): + """Gets the fee_asset of this AgencyTransaction. # noqa: E501 + + Fee currency # noqa: E501 + + :return: The fee_asset of this AgencyTransaction. # noqa: E501 + :rtype: str + """ + return self._fee_asset + + @fee_asset.setter + def fee_asset(self, fee_asset): + """Sets the fee_asset of this AgencyTransaction. + + Fee currency # noqa: E501 + + :param fee_asset: The fee_asset of this AgencyTransaction. # noqa: E501 + :type: str + """ + + self._fee_asset = fee_asset + + @property + def currency_pair(self): + """Gets the currency_pair of this AgencyTransaction. # noqa: E501 + + Currency pair # noqa: E501 + + :return: The currency_pair of this AgencyTransaction. # noqa: E501 + :rtype: str + """ + return self._currency_pair + + @currency_pair.setter + def currency_pair(self, currency_pair): + """Sets the currency_pair of this AgencyTransaction. + + Currency pair # noqa: E501 + + :param currency_pair: The currency_pair of this AgencyTransaction. # noqa: E501 + :type: str + """ + + self._currency_pair = currency_pair + + @property + def amount(self): + """Gets the amount of this AgencyTransaction. # noqa: E501 + + Transaction amount # noqa: E501 + + :return: The amount of this AgencyTransaction. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this AgencyTransaction. + + Transaction amount # noqa: E501 + + :param amount: The amount of this AgencyTransaction. # noqa: E501 + :type: str + """ + + self._amount = amount + + @property + def amount_asset(self): + """Gets the amount_asset of this AgencyTransaction. # noqa: E501 + + Commission Asset # noqa: E501 + + :return: The amount_asset of this AgencyTransaction. # noqa: E501 + :rtype: str + """ + return self._amount_asset + + @amount_asset.setter + def amount_asset(self, amount_asset): + """Sets the amount_asset of this AgencyTransaction. + + Commission Asset # noqa: E501 + + :param amount_asset: The amount_asset of this AgencyTransaction. # noqa: E501 + :type: str + """ + + self._amount_asset = amount_asset + + @property + def source(self): + """Gets the source of this AgencyTransaction. # noqa: E501 + + Commission source: SPOT - Spot commission, FUTURES - Futures commission # noqa: E501 + + :return: The source of this AgencyTransaction. # noqa: E501 + :rtype: str + """ + return self._source + + @source.setter + def source(self, source): + """Sets the source of this AgencyTransaction. + + Commission source: SPOT - Spot commission, FUTURES - Futures commission # noqa: E501 + + :param source: The source of this AgencyTransaction. # noqa: E501 + :type: str + """ + + self._source = 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, AgencyTransaction): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AgencyTransaction): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/agency_transaction_history.py b/gate_api/models/agency_transaction_history.py new file mode 100644 index 0000000..99dfdeb --- /dev/null +++ b/gate_api/models/agency_transaction_history.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 AgencyTransactionHistory(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'total': 'int', + 'list': 'list[AgencyTransaction]' + } + + attribute_map = { + 'currency_pair': 'currency_pair', + 'total': 'total', + 'list': 'list' + } + + def __init__(self, currency_pair=None, total=None, list=None, local_vars_configuration=None): # noqa: E501 + # type: (str, int, list[AgencyTransaction], Configuration) -> None + """AgencyTransactionHistory - a 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._total = None + self._list = None + self.discriminator = None + + if currency_pair is not None: + self.currency_pair = currency_pair + if total is not None: + self.total = total + if list is not None: + self.list = list + + @property + def currency_pair(self): + """Gets the currency_pair of this AgencyTransactionHistory. # noqa: E501 + + Currency pair # noqa: E501 + + :return: The currency_pair of this AgencyTransactionHistory. # noqa: E501 + :rtype: str + """ + return self._currency_pair + + @currency_pair.setter + def currency_pair(self, currency_pair): + """Sets the currency_pair of this AgencyTransactionHistory. + + Currency pair # noqa: E501 + + :param currency_pair: The currency_pair of this AgencyTransactionHistory. # noqa: E501 + :type: str + """ + + self._currency_pair = currency_pair + + @property + def total(self): + """Gets the total of this AgencyTransactionHistory. # noqa: E501 + + Total # noqa: E501 + + :return: The total of this AgencyTransactionHistory. # noqa: E501 + :rtype: int + """ + return self._total + + @total.setter + def total(self, total): + """Sets the total of this AgencyTransactionHistory. + + Total # noqa: E501 + + :param total: The total of this AgencyTransactionHistory. # noqa: E501 + :type: int + """ + + self._total = total + + @property + def list(self): + """Gets the list of this AgencyTransactionHistory. # noqa: E501 + + List of transaction history # noqa: E501 + + :return: The list of this AgencyTransactionHistory. # noqa: E501 + :rtype: list[AgencyTransaction] + """ + return self._list + + @list.setter + def list(self, list): + """Sets the list of this AgencyTransactionHistory. + + List of transaction history # noqa: E501 + + :param list: The list of this AgencyTransactionHistory. # noqa: E501 + :type: list[AgencyTransaction] + """ + + 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, AgencyTransactionHistory): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AgencyTransactionHistory): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/auto_repay_setting.py b/gate_api/models/auto_repay_setting.py index f7a157b..a3d0994 100644 --- a/gate_api/models/auto_repay_setting.py +++ b/gate_api/models/auto_repay_setting.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -32,9 +32,13 @@ class AutoRepaySetting(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {'status': 'str'} + openapi_types = { + 'status': 'str' + } - attribute_map = {'status': 'status'} + attribute_map = { + 'status': 'status' + } def __init__(self, status=None, local_vars_configuration=None): # noqa: E501 # type: (str, Configuration) -> None @@ -53,7 +57,7 @@ def __init__(self, status=None, local_vars_configuration=None): # noqa: E501 def status(self): """Gets the status of this AutoRepaySetting. # noqa: E501 - Auto repayment status. `on` - enabled, `off` - disabled # noqa: E501 + Auto repayment status: `on` - enabled, `off` - disabled # noqa: E501 :return: The status of this AutoRepaySetting. # noqa: E501 :rtype: str @@ -64,7 +68,7 @@ def status(self): def status(self, status): """Sets the status of this AutoRepaySetting. - Auto repayment status. `on` - enabled, `off` - disabled # noqa: E501 + Auto repayment status: `on` - enabled, `off` - disabled # noqa: E501 :param status: The status of this AutoRepaySetting. # noqa: E501 :type: str @@ -72,7 +76,8 @@ def status(self, status): allowed_values = ["on", "off"] # 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}".format(status, allowed_values) # noqa: E501 + "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 + .format(status, allowed_values) ) self._status = status @@ -84,16 +89,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/batch_amend_item.py b/gate_api/models/batch_amend_item.py new file mode 100644 index 0000000..7125ac0 --- /dev/null +++ b/gate_api/models/batch_amend_item.py @@ -0,0 +1,296 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class BatchAmendItem(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'currency_pair': 'str', + 'account': 'str', + 'amount': 'str', + 'price': 'str', + 'amend_text': 'str', + 'action_mode': 'str' + } + + attribute_map = { + 'order_id': 'order_id', + 'currency_pair': 'currency_pair', + 'account': 'account', + 'amount': 'amount', + 'price': 'price', + 'amend_text': 'amend_text', + 'action_mode': 'action_mode' + } + + 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 + """BatchAmendItem - a 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._currency_pair = None + self._account = None + self._amount = None + self._price = None + self._amend_text = None + self._action_mode = None + self.discriminator = None + + self.order_id = order_id + self.currency_pair = currency_pair + if account is not None: + self.account = account + if amount is not None: + self.amount = amount + if price is not None: + 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): + """Gets the order_id of this BatchAmendItem. # noqa: E501 + + The order ID returned upon successful creation or the custom ID specified by the user during creation (i.e., the 'text' field) # noqa: E501 + + :return: The order_id of this BatchAmendItem. # noqa: E501 + :rtype: str + """ + return self._order_id + + @order_id.setter + def order_id(self, order_id): + """Sets the order_id of this BatchAmendItem. + + The order ID returned upon successful creation or the custom ID specified by the user during creation (i.e., the 'text' field) # noqa: E501 + + :param order_id: The order_id of this BatchAmendItem. # 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 currency_pair(self): + """Gets the currency_pair of this BatchAmendItem. # noqa: E501 + + Currency pair # noqa: E501 + + :return: The currency_pair of this BatchAmendItem. # noqa: E501 + :rtype: str + """ + return self._currency_pair + + @currency_pair.setter + def currency_pair(self, currency_pair): + """Sets the currency_pair of this BatchAmendItem. + + Currency pair # noqa: E501 + + :param currency_pair: The currency_pair of this BatchAmendItem. # 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 account(self): + """Gets the account of this BatchAmendItem. # noqa: E501 + + Default spot, unified account and warehouse-by-store leverage account # noqa: E501 + + :return: The account of this BatchAmendItem. # noqa: E501 + :rtype: str + """ + return self._account + + @account.setter + def account(self, account): + """Sets the account of this BatchAmendItem. + + Default spot, unified account and warehouse-by-store leverage account # noqa: E501 + + :param account: The account of this BatchAmendItem. # noqa: E501 + :type: str + """ + + self._account = account + + @property + def amount(self): + """Gets the amount of this BatchAmendItem. # noqa: E501 + + Trading Quantity. Only one of `amount` or `price` can be specified # noqa: E501 + + :return: The amount of this BatchAmendItem. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this BatchAmendItem. + + Trading Quantity. Only one of `amount` or `price` can be specified # noqa: E501 + + :param amount: The amount of this BatchAmendItem. # noqa: E501 + :type: str + """ + + self._amount = amount + + @property + def price(self): + """Gets the price of this BatchAmendItem. # noqa: E501 + + Trading Price. Only one of `amount` or `price` can be specified # noqa: E501 + + :return: The price of this BatchAmendItem. # noqa: E501 + :rtype: str + """ + return self._price + + @price.setter + def price(self, price): + """Sets the price of this BatchAmendItem. + + Trading Price. Only one of `amount` or `price` can be specified # noqa: E501 + + :param price: The price of this BatchAmendItem. # noqa: E501 + :type: str + """ + + self._price = price + + @property + def amend_text(self): + """Gets the amend_text of this BatchAmendItem. # noqa: E501 + + Custom info during order amendment # noqa: E501 + + :return: The amend_text of this BatchAmendItem. # noqa: E501 + :rtype: str + """ + return self._amend_text + + @amend_text.setter + def amend_text(self, amend_text): + """Sets the amend_text of this BatchAmendItem. + + Custom info during order amendment # noqa: E501 + + :param amend_text: The amend_text of this BatchAmendItem. # noqa: E501 + :type: str + """ + if (self.local_vars_configuration.client_side_validation and + amend_text is not None and len(amend_text) > 31): + raise ValueError("Invalid value for `amend_text`, length must be less than or equal to `31`") # noqa: E501 + + self._amend_text = amend_text + + @property + def action_mode(self): + """Gets the action_mode of this BatchAmendItem. # noqa: E501 + + 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) # noqa: E501 + + :return: The action_mode of this BatchAmendItem. # noqa: E501 + :rtype: str + """ + return self._action_mode + + @action_mode.setter + def action_mode(self, action_mode): + """Sets the action_mode of this BatchAmendItem. + + 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) # noqa: E501 + + :param action_mode: The action_mode of this BatchAmendItem. # noqa: E501 + :type: str + """ + + self._action_mode = action_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, BatchAmendItem): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, BatchAmendItem): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/batch_amend_order_req.py b/gate_api/models/batch_amend_order_req.py new file mode 100644 index 0000000..c357589 --- /dev/null +++ b/gate_api/models/batch_amend_order_req.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 BatchAmendOrderReq(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'text': 'str', + 'size': 'int', + 'price': 'str', + 'amend_text': 'str' + } + + attribute_map = { + 'order_id': 'order_id', + 'text': 'text', + 'size': 'size', + 'price': 'price', + 'amend_text': 'amend_text' + } + + def __init__(self, order_id=None, text=None, size=None, price=None, amend_text=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, int, str, str, Configuration) -> None + """BatchAmendOrderReq - a 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._size = None + self._price = None + self._amend_text = None + self.discriminator = None + + if order_id is not None: + self.order_id = order_id + if text is not None: + self.text = text + if size is not None: + self.size = size + if price is not None: + self.price = price + if amend_text is not None: + self.amend_text = amend_text + + @property + def order_id(self): + """Gets the order_id of this BatchAmendOrderReq. # noqa: E501 + + Order id, order_id and text must contain at least one # noqa: E501 + + :return: The order_id of this BatchAmendOrderReq. # noqa: E501 + :rtype: int + """ + return self._order_id + + @order_id.setter + def order_id(self, order_id): + """Sets the order_id of this BatchAmendOrderReq. + + Order id, order_id and text must contain at least one # noqa: E501 + + :param order_id: The order_id of this BatchAmendOrderReq. # noqa: E501 + :type: int + """ + + self._order_id = order_id + + @property + def text(self): + """Gets the text of this BatchAmendOrderReq. # noqa: E501 + + User-defined order text, at least one of order_id and text must be passed # noqa: E501 + + :return: The text of this BatchAmendOrderReq. # noqa: E501 + :rtype: str + """ + return self._text + + @text.setter + def text(self, text): + """Sets the text of this BatchAmendOrderReq. + + User-defined order text, at least one of order_id and text must be passed # noqa: E501 + + :param text: The text of this BatchAmendOrderReq. # noqa: E501 + :type: str + """ + + self._text = text + + @property + def size(self): + """Gets the size of this BatchAmendOrderReq. # noqa: E501 + + 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. # noqa: E501 + + :return: The size of this BatchAmendOrderReq. # noqa: E501 + :rtype: int + """ + return self._size + + @size.setter + def size(self, size): + """Sets the size of this BatchAmendOrderReq. + + 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. # noqa: E501 + + :param size: The size of this BatchAmendOrderReq. # noqa: E501 + :type: int + """ + + self._size = size + + @property + def price(self): + """Gets the price of this BatchAmendOrderReq. # noqa: E501 + + New order price # noqa: E501 + + :return: The price of this BatchAmendOrderReq. # noqa: E501 + :rtype: str + """ + return self._price + + @price.setter + def price(self, price): + """Sets the price of this BatchAmendOrderReq. + + New order price # noqa: E501 + + :param price: The price of this BatchAmendOrderReq. # noqa: E501 + :type: str + """ + + self._price = price + + @property + def amend_text(self): + """Gets the amend_text of this BatchAmendOrderReq. # noqa: E501 + + Custom info during order amendment # noqa: E501 + + :return: The amend_text of this BatchAmendOrderReq. # noqa: E501 + :rtype: str + """ + return self._amend_text + + @amend_text.setter + def amend_text(self, amend_text): + """Sets the amend_text of this BatchAmendOrderReq. + + Custom info during order amendment # noqa: E501 + + :param amend_text: The amend_text of this BatchAmendOrderReq. # noqa: E501 + :type: str + """ + + self._amend_text = amend_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, BatchAmendOrderReq): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, BatchAmendOrderReq): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/batch_futures_order.py b/gate_api/models/batch_futures_order.py new file mode 100644 index 0000000..0448f1a --- /dev/null +++ b/gate_api/models/batch_futures_order.py @@ -0,0 +1,909 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class BatchFuturesOrder(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'succeeded': 'bool', + 'label': 'str', + 'detail': 'str', + 'id': 'int', + 'user': 'int', + 'create_time': 'float', + 'finish_time': 'float', + 'finish_as': 'str', + 'status': 'str', + 'contract': 'str', + 'size': 'int', + 'iceberg': 'int', + 'price': 'str', + 'close': 'bool', + 'is_close': 'bool', + 'reduce_only': 'bool', + 'is_reduce_only': 'bool', + 'is_liq': 'bool', + 'tif': 'str', + 'left': 'int', + 'fill_price': 'str', + 'text': 'str', + 'tkfr': 'str', + 'mkfr': 'str', + 'refu': 'int', + 'auto_size': 'str', + 'stp_act': 'str', + 'stp_id': 'int' + } + + attribute_map = { + 'succeeded': 'succeeded', + 'label': 'label', + 'detail': 'detail', + 'id': 'id', + 'user': 'user', + 'create_time': 'create_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_act': 'stp_act', + 'stp_id': 'stp_id' + } + + def __init__(self, succeeded=None, label=None, detail=None, id=None, user=None, create_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_act=None, stp_id=None, local_vars_configuration=None): # noqa: E501 + # type: (bool, str, str, int, int, float, float, str, str, str, int, int, str, bool, bool, bool, bool, bool, str, int, str, str, str, str, int, str, str, int, Configuration) -> None + """BatchFuturesOrder - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._succeeded = None + self._label = None + self._detail = None + self._id = None + self._user = None + self._create_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_act = None + self._stp_id = None + self.discriminator = None + + if succeeded is not None: + self.succeeded = succeeded + if label is not None: + self.label = label + if detail is not None: + self.detail = detail + 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 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 + if contract is not None: + self.contract = contract + if size is not None: + self.size = size + if iceberg is not None: + self.iceberg = iceberg + if price is not None: + 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_act is not None: + self.stp_act = stp_act + if stp_id is not None: + self.stp_id = stp_id + + @property + def succeeded(self): + """Gets the succeeded of this BatchFuturesOrder. # noqa: E501 + + Request execution result # noqa: E501 + + :return: The succeeded of this BatchFuturesOrder. # noqa: E501 + :rtype: bool + """ + return self._succeeded + + @succeeded.setter + def succeeded(self, succeeded): + """Sets the succeeded of this BatchFuturesOrder. + + Request execution result # noqa: E501 + + :param succeeded: The succeeded of this BatchFuturesOrder. # noqa: E501 + :type: bool + """ + + self._succeeded = succeeded + + @property + def label(self): + """Gets the label of this BatchFuturesOrder. # noqa: E501 + + Error label, only exists if execution fails # noqa: E501 + + :return: The label of this BatchFuturesOrder. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this BatchFuturesOrder. + + Error label, only exists if execution fails # noqa: E501 + + :param label: The label of this BatchFuturesOrder. # noqa: E501 + :type: str + """ + + self._label = label + + @property + def detail(self): + """Gets the detail of this BatchFuturesOrder. # noqa: E501 + + Error detail, only present if execution failed and details need to be given # noqa: E501 + + :return: The detail of this BatchFuturesOrder. # noqa: E501 + :rtype: str + """ + return self._detail + + @detail.setter + def detail(self, detail): + """Sets the detail of this BatchFuturesOrder. + + Error detail, only present if execution failed and details need to be given # noqa: E501 + + :param detail: The detail of this BatchFuturesOrder. # noqa: E501 + :type: str + """ + + self._detail = detail + + @property + def id(self): + """Gets the id of this BatchFuturesOrder. # noqa: E501 + + Futures order ID # noqa: E501 + + :return: The id of this BatchFuturesOrder. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this BatchFuturesOrder. + + Futures order ID # noqa: E501 + + :param id: The id of this BatchFuturesOrder. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def user(self): + """Gets the user of this BatchFuturesOrder. # noqa: E501 + + User ID # noqa: E501 + + :return: The user of this BatchFuturesOrder. # noqa: E501 + :rtype: int + """ + return self._user + + @user.setter + def user(self, user): + """Sets the user of this BatchFuturesOrder. + + User ID # noqa: E501 + + :param user: The user of this BatchFuturesOrder. # noqa: E501 + :type: int + """ + + self._user = user + + @property + def create_time(self): + """Gets the create_time of this BatchFuturesOrder. # noqa: E501 + + Creation time of order # noqa: E501 + + :return: The create_time of this BatchFuturesOrder. # noqa: E501 + :rtype: float + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this BatchFuturesOrder. + + Creation time of order # noqa: E501 + + :param create_time: The create_time of this BatchFuturesOrder. # noqa: E501 + :type: float + """ + + self._create_time = create_time + + @property + def finish_time(self): + """Gets the finish_time of this BatchFuturesOrder. # noqa: E501 + + Order finished time. Not returned if order is open # noqa: E501 + + :return: The finish_time of this BatchFuturesOrder. # noqa: E501 + :rtype: float + """ + return self._finish_time + + @finish_time.setter + def finish_time(self, finish_time): + """Sets the finish_time of this BatchFuturesOrder. + + Order finished time. Not returned if order is open # noqa: E501 + + :param finish_time: The finish_time of this BatchFuturesOrder. # noqa: E501 + :type: float + """ + + self._finish_time = finish_time + + @property + def finish_as(self): + """Gets the finish_as of this BatchFuturesOrder. # 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 BatchFuturesOrder. # noqa: E501 + :rtype: str + """ + return self._finish_as + + @finish_as.setter + def finish_as(self, finish_as): + """Sets the finish_as of this BatchFuturesOrder. + + 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 BatchFuturesOrder. # 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 BatchFuturesOrder. # noqa: E501 + + Order status - `open`: Pending - `finished`: Completed # noqa: E501 + + :return: The status of this BatchFuturesOrder. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this BatchFuturesOrder. + + Order status - `open`: Pending - `finished`: Completed # noqa: E501 + + :param status: The status of this BatchFuturesOrder. # 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 BatchFuturesOrder. # noqa: E501 + + Futures contract # noqa: E501 + + :return: The contract of this BatchFuturesOrder. # noqa: E501 + :rtype: str + """ + return self._contract + + @contract.setter + def contract(self, contract): + """Sets the contract of this BatchFuturesOrder. + + Futures contract # noqa: E501 + + :param contract: The contract of this BatchFuturesOrder. # noqa: E501 + :type: str + """ + + self._contract = contract + + @property + def size(self): + """Gets the size of this BatchFuturesOrder. # 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 BatchFuturesOrder. # noqa: E501 + :rtype: int + """ + return self._size + + @size.setter + def size(self, size): + """Sets the size of this BatchFuturesOrder. + + Required. Trading quantity. Positive for buy, negative for sell. Set to 0 for close position orders. # noqa: E501 + + :param size: The size of this BatchFuturesOrder. # noqa: E501 + :type: int + """ + + self._size = size + + @property + def iceberg(self): + """Gets the iceberg of this BatchFuturesOrder. # 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 BatchFuturesOrder. # noqa: E501 + :rtype: int + """ + return self._iceberg + + @iceberg.setter + def iceberg(self, iceberg): + """Sets the iceberg of this BatchFuturesOrder. + + 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 BatchFuturesOrder. # noqa: E501 + :type: int + """ + + self._iceberg = iceberg + + @property + def price(self): + """Gets the price of this BatchFuturesOrder. # noqa: E501 + + Order price. Price of 0 with `tif` set to `ioc` represents a market order. # noqa: E501 + + :return: The price of this BatchFuturesOrder. # noqa: E501 + :rtype: str + """ + return self._price + + @price.setter + def price(self, price): + """Sets the price of this BatchFuturesOrder. + + Order price. Price of 0 with `tif` set to `ioc` represents a market order. # noqa: E501 + + :param price: The price of this BatchFuturesOrder. # noqa: E501 + :type: str + """ + + self._price = price + + @property + def close(self): + """Gets the close of this BatchFuturesOrder. # noqa: E501 + + Set as `true` to close the position, with `size` set to 0 # noqa: E501 + + :return: The close of this BatchFuturesOrder. # noqa: E501 + :rtype: bool + """ + return self._close + + @close.setter + def close(self, close): + """Sets the close of this BatchFuturesOrder. + + Set as `true` to close the position, with `size` set to 0 # noqa: E501 + + :param close: The close of this BatchFuturesOrder. # noqa: E501 + :type: bool + """ + + self._close = close + + @property + def is_close(self): + """Gets the is_close of this BatchFuturesOrder. # noqa: E501 + + Is the order to close position # noqa: E501 + + :return: The is_close of this BatchFuturesOrder. # noqa: E501 + :rtype: bool + """ + return self._is_close + + @is_close.setter + def is_close(self, is_close): + """Sets the is_close of this BatchFuturesOrder. + + Is the order to close position # noqa: E501 + + :param is_close: The is_close of this BatchFuturesOrder. # noqa: E501 + :type: bool + """ + + self._is_close = is_close + + @property + def reduce_only(self): + """Gets the reduce_only of this BatchFuturesOrder. # noqa: E501 + + Set as `true` to be reduce-only order # noqa: E501 + + :return: The reduce_only of this BatchFuturesOrder. # noqa: E501 + :rtype: bool + """ + return self._reduce_only + + @reduce_only.setter + def reduce_only(self, reduce_only): + """Sets the reduce_only of this BatchFuturesOrder. + + Set as `true` to be reduce-only order # noqa: E501 + + :param reduce_only: The reduce_only of this BatchFuturesOrder. # noqa: E501 + :type: bool + """ + + self._reduce_only = reduce_only + + @property + def is_reduce_only(self): + """Gets the is_reduce_only of this BatchFuturesOrder. # noqa: E501 + + Is the order reduce-only # noqa: E501 + + :return: The is_reduce_only of this BatchFuturesOrder. # 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 BatchFuturesOrder. + + Is the order reduce-only # noqa: E501 + + :param is_reduce_only: The is_reduce_only of this BatchFuturesOrder. # noqa: E501 + :type: bool + """ + + self._is_reduce_only = is_reduce_only + + @property + def is_liq(self): + """Gets the is_liq of this BatchFuturesOrder. # noqa: E501 + + Is the order for liquidation # noqa: E501 + + :return: The is_liq of this BatchFuturesOrder. # noqa: E501 + :rtype: bool + """ + return self._is_liq + + @is_liq.setter + def is_liq(self, is_liq): + """Sets the is_liq of this BatchFuturesOrder. + + Is the order for liquidation # noqa: E501 + + :param is_liq: The is_liq of this BatchFuturesOrder. # noqa: E501 + :type: bool + """ + + self._is_liq = is_liq + + @property + def tif(self): + """Gets the tif of this BatchFuturesOrder. # 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 BatchFuturesOrder. # noqa: E501 + :rtype: str + """ + return self._tif + + @tif.setter + def tif(self, tif): + """Sets the tif of this BatchFuturesOrder. + + 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 BatchFuturesOrder. # 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 BatchFuturesOrder. # noqa: E501 + + Unfilled quantity # noqa: E501 + + :return: The left of this BatchFuturesOrder. # noqa: E501 + :rtype: int + """ + return self._left + + @left.setter + def left(self, left): + """Sets the left of this BatchFuturesOrder. + + Unfilled quantity # noqa: E501 + + :param left: The left of this BatchFuturesOrder. # noqa: E501 + :type: int + """ + + self._left = left + + @property + def fill_price(self): + """Gets the fill_price of this BatchFuturesOrder. # noqa: E501 + + Fill price # noqa: E501 + + :return: The fill_price of this BatchFuturesOrder. # noqa: E501 + :rtype: str + """ + return self._fill_price + + @fill_price.setter + def fill_price(self, fill_price): + """Sets the fill_price of this BatchFuturesOrder. + + Fill price # noqa: E501 + + :param fill_price: The fill_price of this BatchFuturesOrder. # noqa: E501 + :type: str + """ + + self._fill_price = fill_price + + @property + def text(self): + """Gets the text of this BatchFuturesOrder. # 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: - web: from web - api: from API - app: from mobile phones - auto_deleveraging: from ADL - liquidation: from liquidation - insurance: from insurance # noqa: E501 + + :return: The text of this BatchFuturesOrder. # noqa: E501 + :rtype: str + """ + return self._text + + @text.setter + def text(self, text): + """Sets the text of this BatchFuturesOrder. + + 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: - web: from web - api: from API - app: from mobile phones - auto_deleveraging: from ADL - liquidation: from liquidation - insurance: from insurance # noqa: E501 + + :param text: The text of this BatchFuturesOrder. # noqa: E501 + :type: str + """ + + self._text = text + + @property + def tkfr(self): + """Gets the tkfr of this BatchFuturesOrder. # noqa: E501 + + Taker fee # noqa: E501 + + :return: The tkfr of this BatchFuturesOrder. # noqa: E501 + :rtype: str + """ + return self._tkfr + + @tkfr.setter + def tkfr(self, tkfr): + """Sets the tkfr of this BatchFuturesOrder. + + Taker fee # noqa: E501 + + :param tkfr: The tkfr of this BatchFuturesOrder. # noqa: E501 + :type: str + """ + + self._tkfr = tkfr + + @property + def mkfr(self): + """Gets the mkfr of this BatchFuturesOrder. # noqa: E501 + + Maker fee # noqa: E501 + + :return: The mkfr of this BatchFuturesOrder. # noqa: E501 + :rtype: str + """ + return self._mkfr + + @mkfr.setter + def mkfr(self, mkfr): + """Sets the mkfr of this BatchFuturesOrder. + + Maker fee # noqa: E501 + + :param mkfr: The mkfr of this BatchFuturesOrder. # noqa: E501 + :type: str + """ + + self._mkfr = mkfr + + @property + def refu(self): + """Gets the refu of this BatchFuturesOrder. # noqa: E501 + + Referrer user ID # noqa: E501 + + :return: The refu of this BatchFuturesOrder. # noqa: E501 + :rtype: int + """ + return self._refu + + @refu.setter + def refu(self, refu): + """Sets the refu of this BatchFuturesOrder. + + Referrer user ID # noqa: E501 + + :param refu: The refu of this BatchFuturesOrder. # noqa: E501 + :type: int + """ + + self._refu = refu + + @property + def auto_size(self): + """Gets the auto_size of this BatchFuturesOrder. # 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 BatchFuturesOrder. # noqa: E501 + :rtype: str + """ + return self._auto_size + + @auto_size.setter + def auto_size(self, auto_size): + """Sets the auto_size of this BatchFuturesOrder. + + 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 BatchFuturesOrder. # 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_act(self): + """Gets the stp_act of this BatchFuturesOrder. # 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 BatchFuturesOrder. # noqa: E501 + :rtype: str + """ + return self._stp_act + + @stp_act.setter + def stp_act(self, stp_act): + """Sets the stp_act of this BatchFuturesOrder. + + 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 BatchFuturesOrder. # 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 stp_id(self): + """Gets the stp_id of this BatchFuturesOrder. # 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 BatchFuturesOrder. # noqa: E501 + :rtype: int + """ + return self._stp_id + + @stp_id.setter + def stp_id(self, stp_id): + """Sets the stp_id of this BatchFuturesOrder. + + 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 BatchFuturesOrder. # noqa: E501 + :type: int + """ + + self._stp_id = stp_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, BatchFuturesOrder): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, BatchFuturesOrder): + 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 417fe1a..12d30e9 100644 --- a/gate_api/models/batch_order.py +++ b/gate_api/models/batch_order.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -33,6 +33,8 @@ class BatchOrder(object): and the value is json key in definition. """ openapi_types = { + 'order_id': 'str', + 'amend_text': 'str', 'text': 'str', 'succeeded': 'bool', 'label': 'str', @@ -54,8 +56,10 @@ class BatchOrder(object): 'auto_borrow': 'bool', 'auto_repay': 'bool', 'left': 'str', + 'filled_amount': 'str', 'fill_price': 'str', 'filled_total': 'str', + 'avg_deal_price': 'str', 'fee': 'str', 'fee_currency': 'str', 'point_fee': 'str', @@ -63,9 +67,14 @@ class BatchOrder(object): 'gt_discount': 'bool', 'rebated_fee': 'str', 'rebated_fee_currency': 'str', + 'stp_id': 'int', + 'stp_act': 'str', + 'finish_as': 'str' } attribute_map = { + 'order_id': 'order_id', + 'amend_text': 'amend_text', 'text': 'text', 'succeeded': 'succeeded', 'label': 'label', @@ -87,8 +96,10 @@ class BatchOrder(object): 'auto_borrow': 'auto_borrow', 'auto_repay': 'auto_repay', 'left': 'left', + 'filled_amount': 'filled_amount', 'fill_price': 'fill_price', 'filled_total': 'filled_total', + 'avg_deal_price': 'avg_deal_price', 'fee': 'fee', 'fee_currency': 'fee_currency', 'point_fee': 'point_fee', @@ -96,48 +107,20 @@ class BatchOrder(object): 'gt_discount': 'gt_discount', 'rebated_fee': 'rebated_fee', 'rebated_fee_currency': 'rebated_fee_currency', + 'stp_id': 'stp_id', + 'stp_act': 'stp_act', + 'finish_as': 'finish_as' } - def __init__( - self, - 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, - fill_price=None, - filled_total=None, - fee=None, - fee_currency=None, - point_fee=None, - gt_fee=None, - gt_discount=None, - rebated_fee=None, - rebated_fee_currency=None, - local_vars_configuration=None, - ): # noqa: E501 - # type: (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, bool, 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, 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, Configuration) -> None """BatchOrder - a 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._amend_text = None self._text = None self._succeeded = None self._label = None @@ -159,8 +142,10 @@ def __init__( self._auto_borrow = None self._auto_repay = None self._left = None + self._filled_amount = None self._fill_price = None self._filled_total = None + self._avg_deal_price = None self._fee = None self._fee_currency = None self._point_fee = None @@ -168,8 +153,15 @@ def __init__( self._gt_discount = None self._rebated_fee = None self._rebated_fee_currency = None + self._stp_id = None + self._stp_act = None + self._finish_as = None self.discriminator = None + if order_id is not None: + self.order_id = order_id + if amend_text is not None: + self.amend_text = amend_text if text is not None: self.text = text if succeeded is not None: @@ -212,10 +204,14 @@ def __init__( self.auto_repay = auto_repay if left is not None: self.left = left + if filled_amount is not None: + self.filled_amount = filled_amount if fill_price is not None: self.fill_price = fill_price if filled_total is not None: self.filled_total = filled_total + if avg_deal_price is not None: + self.avg_deal_price = avg_deal_price if fee is not None: self.fee = fee if fee_currency is not None: @@ -230,12 +226,64 @@ def __init__( self.rebated_fee = rebated_fee if rebated_fee_currency is not None: self.rebated_fee_currency = rebated_fee_currency + if stp_id is not None: + self.stp_id = stp_id + if stp_act is not None: + self.stp_act = stp_act + if finish_as is not None: + self.finish_as = finish_as + + @property + def order_id(self): + """Gets the order_id of this BatchOrder. # noqa: E501 + + Order ID # noqa: E501 + + :return: The order_id of this BatchOrder. # noqa: E501 + :rtype: str + """ + return self._order_id + + @order_id.setter + def order_id(self, order_id): + """Sets the order_id of this BatchOrder. + + Order ID # noqa: E501 + + :param order_id: The order_id of this BatchOrder. # noqa: E501 + :type: str + """ + + self._order_id = order_id + + @property + def amend_text(self): + """Gets the amend_text of this BatchOrder. # noqa: E501 + + The custom data that the user remarked when amending the order # noqa: E501 + + :return: The amend_text of this BatchOrder. # noqa: E501 + :rtype: str + """ + return self._amend_text + + @amend_text.setter + def amend_text(self, amend_text): + """Sets the amend_text of this BatchOrder. + + The custom data that the user remarked when amending the order # noqa: E501 + + :param amend_text: The amend_text of this BatchOrder. # noqa: E501 + :type: str + """ + + self._amend_text = amend_text @property def text(self): """Gets the text of this BatchOrder. # 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(.) # 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 BatchOrder. # noqa: E501 :rtype: str @@ -246,7 +294,7 @@ def text(self): def text(self, text): """Sets the text of this BatchOrder. - 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(.) # 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 :param text: The text of this BatchOrder. # noqa: E501 :type: str @@ -258,7 +306,7 @@ def text(self, text): def succeeded(self): """Gets the succeeded of this BatchOrder. # noqa: E501 - Whether the batch of orders succeeded # noqa: E501 + Request execution result # noqa: E501 :return: The succeeded of this BatchOrder. # noqa: E501 :rtype: bool @@ -269,7 +317,7 @@ def succeeded(self): def succeeded(self, succeeded): """Sets the succeeded of this BatchOrder. - Whether the batch of orders succeeded # noqa: E501 + Request execution result # noqa: E501 :param succeeded: The succeeded of this BatchOrder. # noqa: E501 :type: bool @@ -461,7 +509,8 @@ def status(self, status): allowed_values = ["open", "closed", "cancelled"] # 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}".format(status, allowed_values) # noqa: E501 + "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 + .format(status, allowed_values) ) self._status = status @@ -493,7 +542,7 @@ def currency_pair(self, currency_pair): def type(self): """Gets the type of this BatchOrder. # noqa: E501 - Order type. limit - limit order # noqa: E501 + Order Type - limit : Limit Order - market : Market Order # noqa: E501 :return: The type of this BatchOrder. # noqa: E501 :rtype: str @@ -504,15 +553,16 @@ def type(self): def type(self, type): """Sets the type of this BatchOrder. - Order type. limit - limit order # noqa: E501 + Order Type - limit : Limit Order - market : Market Order # noqa: E501 :param type: The type of this BatchOrder. # noqa: E501 :type: str """ - allowed_values = ["limit"] # noqa: E501 + 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}".format(type, allowed_values) # noqa: E501 + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) ) self._type = type @@ -521,7 +571,7 @@ def type(self, type): def account(self): """Gets the account of this BatchOrder. # noqa: E501 - Account type. spot - use spot account; margin - use margin account; cross_margin - use cross margin account # noqa: E501 + Account type, spot - spot account, margin - leveraged account, unified - unified account # noqa: E501 :return: The account of this BatchOrder. # noqa: E501 :rtype: str @@ -532,15 +582,16 @@ def account(self): def account(self, account): """Sets the account of this BatchOrder. - Account type. spot - use spot account; margin - use margin account; cross_margin - use cross margin account # noqa: E501 + Account type, spot - spot account, margin - leveraged account, unified - unified account # noqa: E501 :param account: The account of this BatchOrder. # noqa: E501 :type: str """ - allowed_values = ["spot", "margin", "cross_margin"] # noqa: E501 + allowed_values = ["spot", "margin", "cross_margin", "unified"] # noqa: E501 if self.local_vars_configuration.client_side_validation and account not in allowed_values: # noqa: E501 raise ValueError( - "Invalid value for `account` ({0}), must be one of {1}".format(account, allowed_values) # noqa: E501 + "Invalid value for `account` ({0}), must be one of {1}" # noqa: E501 + .format(account, allowed_values) ) self._account = account @@ -549,7 +600,7 @@ def account(self, account): def side(self): """Gets the side of this BatchOrder. # noqa: E501 - Order side # noqa: E501 + Buy or sell order # noqa: E501 :return: The side of this BatchOrder. # noqa: E501 :rtype: str @@ -560,7 +611,7 @@ def side(self): def side(self, side): """Sets the side of this BatchOrder. - Order side # noqa: E501 + Buy or sell order # noqa: E501 :param side: The side of this BatchOrder. # noqa: E501 :type: str @@ -568,7 +619,8 @@ def side(self, side): 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}".format(side, allowed_values) # noqa: E501 + "Invalid value for `side` ({0}), must be one of {1}" # noqa: E501 + .format(side, allowed_values) ) self._side = side @@ -623,7 +675,7 @@ def price(self, price): def time_in_force(self): """Gets the time_in_force of this BatchOrder. # noqa: E501 - Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee # 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 time_in_force of this BatchOrder. # noqa: E501 :rtype: str @@ -634,17 +686,16 @@ def time_in_force(self): def time_in_force(self, time_in_force): """Sets the time_in_force of this BatchOrder. - Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee # 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 :param time_in_force: The time_in_force of this BatchOrder. # noqa: E501 :type: str """ - allowed_values = ["gtc", "ioc", "poc"] # noqa: E501 + allowed_values = ["gtc", "ioc", "poc", "fok"] # 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}".format( # noqa: E501 - time_in_force, allowed_values - ) + "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 @@ -653,7 +704,7 @@ def time_in_force(self, time_in_force): def iceberg(self): """Gets the iceberg of this BatchOrder. # noqa: E501 - Amount to display for the iceberg order. Null or 0 for normal orders. Set to -1 to hide the order completely # noqa: E501 + Amount to display for the iceberg order. Null or 0 for normal orders. Hiding all amount is not supported # noqa: E501 :return: The iceberg of this BatchOrder. # noqa: E501 :rtype: str @@ -664,7 +715,7 @@ def iceberg(self): def iceberg(self, iceberg): """Sets the iceberg of this BatchOrder. - Amount to display for the iceberg order. Null or 0 for normal orders. Set to -1 to hide the order completely # noqa: E501 + Amount to display for the iceberg order. Null or 0 for normal orders. Hiding all amount is not supported # noqa: E501 :param iceberg: The iceberg of this BatchOrder. # noqa: E501 :type: str @@ -676,7 +727,7 @@ def iceberg(self, iceberg): def auto_borrow(self): """Gets the auto_borrow of this BatchOrder. # noqa: E501 - Used in margin or cross margin trading to allow automatic loan of insufficient amount if balance is not enough. # noqa: E501 + Used in margin or cross margin trading to allow automatic loan of insufficient amount if balance is not enough # noqa: E501 :return: The auto_borrow of this BatchOrder. # noqa: E501 :rtype: bool @@ -687,7 +738,7 @@ def auto_borrow(self): def auto_borrow(self, auto_borrow): """Sets the auto_borrow of this BatchOrder. - Used in margin or cross margin trading to allow automatic loan of insufficient amount if balance is not enough. # noqa: E501 + Used in margin or cross margin trading to allow automatic loan of insufficient amount if balance is not enough # noqa: E501 :param auto_borrow: The auto_borrow of this BatchOrder. # noqa: E501 :type: bool @@ -699,7 +750,7 @@ def auto_borrow(self, auto_borrow): def auto_repay(self): """Gets the auto_repay of this BatchOrder. # noqa: E501 - Enable or disable automatic repayment for automatic borrow loan generated by cross margin order. Default is disabled. Note that: 1. This field is only effective for cross margin orders. Margin account does not support setting auto repayment for orders. 2. `auto_borrow` and `auto_repay` cannot be both set to true in one order. # noqa: E501 + Enable or disable automatic repayment for automatic borrow loan generated by cross margin order. Default is disabled. Note that: 1. This field is only effective for cross margin orders. Margin account does not support setting auto repayment for orders. 2. `auto_borrow` and `auto_repay` can be both set to true in one order # noqa: E501 :return: The auto_repay of this BatchOrder. # noqa: E501 :rtype: bool @@ -710,7 +761,7 @@ def auto_repay(self): def auto_repay(self, auto_repay): """Sets the auto_repay of this BatchOrder. - Enable or disable automatic repayment for automatic borrow loan generated by cross margin order. Default is disabled. Note that: 1. This field is only effective for cross margin orders. Margin account does not support setting auto repayment for orders. 2. `auto_borrow` and `auto_repay` cannot be both set to true in one order. # noqa: E501 + Enable or disable automatic repayment for automatic borrow loan generated by cross margin order. Default is disabled. Note that: 1. This field is only effective for cross margin orders. Margin account does not support setting auto repayment for orders. 2. `auto_borrow` and `auto_repay` can be both set to true in one order # noqa: E501 :param auto_repay: The auto_repay of this BatchOrder. # noqa: E501 :type: bool @@ -741,6 +792,29 @@ def left(self, left): self._left = left + @property + def filled_amount(self): + """Gets the filled_amount of this BatchOrder. # noqa: E501 + + Amount filled # noqa: E501 + + :return: The filled_amount of this BatchOrder. # noqa: E501 + :rtype: str + """ + return self._filled_amount + + @filled_amount.setter + def filled_amount(self, filled_amount): + """Sets the filled_amount of this BatchOrder. + + Amount filled # noqa: E501 + + :param filled_amount: The filled_amount of this BatchOrder. # noqa: E501 + :type: str + """ + + self._filled_amount = filled_amount + @property def fill_price(self): """Gets the fill_price of this BatchOrder. # noqa: E501 @@ -787,6 +861,29 @@ def filled_total(self, filled_total): self._filled_total = filled_total + @property + def avg_deal_price(self): + """Gets the avg_deal_price of this BatchOrder. # noqa: E501 + + Average fill price # noqa: E501 + + :return: The avg_deal_price of this BatchOrder. # noqa: E501 + :rtype: str + """ + return self._avg_deal_price + + @avg_deal_price.setter + def avg_deal_price(self, avg_deal_price): + """Sets the avg_deal_price of this BatchOrder. + + Average fill price # noqa: E501 + + :param avg_deal_price: The avg_deal_price of this BatchOrder. # noqa: E501 + :type: str + """ + + self._avg_deal_price = avg_deal_price + @property def fee(self): """Gets the fee of this BatchOrder. # noqa: E501 @@ -883,7 +980,7 @@ def gt_fee(self, gt_fee): def gt_discount(self): """Gets the gt_discount of this BatchOrder. # noqa: E501 - Whether GT fee discount is used # noqa: E501 + Whether GT fee deduction is enabled # noqa: E501 :return: The gt_discount of this BatchOrder. # noqa: E501 :rtype: bool @@ -894,7 +991,7 @@ def gt_discount(self): def gt_discount(self, gt_discount): """Sets the gt_discount of this BatchOrder. - Whether GT fee discount is used # noqa: E501 + Whether GT fee deduction is enabled # noqa: E501 :param gt_discount: The gt_discount of this BatchOrder. # noqa: E501 :type: bool @@ -948,6 +1045,87 @@ def rebated_fee_currency(self, rebated_fee_currency): self._rebated_fee_currency = rebated_fee_currency + @property + def stp_id(self): + """Gets the stp_id of this BatchOrder. # 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 BatchOrder. # noqa: E501 + :rtype: int + """ + return self._stp_id + + @stp_id.setter + def stp_id(self, stp_id): + """Sets the stp_id of this BatchOrder. + + 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 BatchOrder. # noqa: E501 + :type: int + """ + + self._stp_id = stp_id + + @property + def stp_act(self): + """Gets the stp_act of this BatchOrder. # noqa: E501 + + 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 # noqa: E501 + + :return: The stp_act of this BatchOrder. # noqa: E501 + :rtype: str + """ + return self._stp_act + + @stp_act.setter + def stp_act(self, stp_act): + """Sets the stp_act of this BatchOrder. + + 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 # noqa: E501 + + :param stp_act: The stp_act of this BatchOrder. # noqa: E501 + :type: str + """ + allowed_values = ["cn", "co", "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 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 + + :return: The finish_as of this BatchOrder. # noqa: E501 + :rtype: str + """ + return self._finish_as + + @finish_as.setter + 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 + + :param finish_as: The finish_as of this BatchOrder. # noqa: E501 + :type: str + """ + allowed_values = ["open", "filled", "cancelled", "ioc", "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 + def to_dict(self): """Returns the model properties as a dict""" result = {} @@ -955,16 +1133,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/borrow_currency_info.py b/gate_api/models/borrow_currency_info.py new file mode 100644 index 0000000..4c6b514 --- /dev/null +++ b/gate_api/models/borrow_currency_info.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 BorrowCurrencyInfo(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'index_price': 'str', + 'left_repay_principal': 'str', + 'left_repay_interest': 'str', + 'left_repay_usdt': 'str' + } + + attribute_map = { + 'currency': 'currency', + 'index_price': 'index_price', + 'left_repay_principal': 'left_repay_principal', + 'left_repay_interest': 'left_repay_interest', + 'left_repay_usdt': 'left_repay_usdt' + } + + def __init__(self, currency=None, index_price=None, left_repay_principal=None, left_repay_interest=None, left_repay_usdt=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, Configuration) -> None + """BorrowCurrencyInfo - a 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._index_price = None + self._left_repay_principal = None + self._left_repay_interest = None + self._left_repay_usdt = None + self.discriminator = None + + if currency is not None: + self.currency = currency + if index_price is not None: + self.index_price = index_price + 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 + if left_repay_usdt is not None: + self.left_repay_usdt = left_repay_usdt + + @property + def currency(self): + """Gets the currency of this BorrowCurrencyInfo. # noqa: E501 + + Currency # noqa: E501 + + :return: The currency of this BorrowCurrencyInfo. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this BorrowCurrencyInfo. + + Currency # noqa: E501 + + :param currency: The currency of this BorrowCurrencyInfo. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def index_price(self): + """Gets the index_price of this BorrowCurrencyInfo. # noqa: E501 + + Currency Index Price # noqa: E501 + + :return: The index_price of this BorrowCurrencyInfo. # noqa: E501 + :rtype: str + """ + return self._index_price + + @index_price.setter + def index_price(self, index_price): + """Sets the index_price of this BorrowCurrencyInfo. + + Currency Index Price # noqa: E501 + + :param index_price: The index_price of this BorrowCurrencyInfo. # noqa: E501 + :type: str + """ + + self._index_price = index_price + + @property + def left_repay_principal(self): + """Gets the left_repay_principal of this BorrowCurrencyInfo. # noqa: E501 + + Outstanding principal # noqa: E501 + + :return: The left_repay_principal of this BorrowCurrencyInfo. # 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 BorrowCurrencyInfo. + + Outstanding principal # noqa: E501 + + :param left_repay_principal: The left_repay_principal of this BorrowCurrencyInfo. # noqa: E501 + :type: str + """ + + self._left_repay_principal = left_repay_principal + + @property + def left_repay_interest(self): + """Gets the left_repay_interest of this BorrowCurrencyInfo. # noqa: E501 + + Outstanding interest # noqa: E501 + + :return: The left_repay_interest of this BorrowCurrencyInfo. # 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 BorrowCurrencyInfo. + + Outstanding interest # noqa: E501 + + :param left_repay_interest: The left_repay_interest of this BorrowCurrencyInfo. # noqa: E501 + :type: str + """ + + self._left_repay_interest = left_repay_interest + + @property + def left_repay_usdt(self): + """Gets the left_repay_usdt of this BorrowCurrencyInfo. # noqa: E501 + + Remaining total outstanding value converted to USDT # noqa: E501 + + :return: The left_repay_usdt of this BorrowCurrencyInfo. # noqa: E501 + :rtype: str + """ + return self._left_repay_usdt + + @left_repay_usdt.setter + def left_repay_usdt(self, left_repay_usdt): + """Sets the left_repay_usdt of this BorrowCurrencyInfo. + + Remaining total outstanding value converted to USDT # noqa: E501 + + :param left_repay_usdt: The left_repay_usdt of this BorrowCurrencyInfo. # noqa: E501 + :type: str + """ + + self._left_repay_usdt = left_repay_usdt + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, BorrowCurrencyInfo): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, BorrowCurrencyInfo): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/broker_commission.py b/gate_api/models/broker_commission.py new file mode 100644 index 0000000..cc6e70a --- /dev/null +++ b/gate_api/models/broker_commission.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 BrokerCommission(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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[BrokerCommission1]' + } + + attribute_map = { + 'total': 'total', + 'list': 'list' + } + + def __init__(self, total=None, list=None, local_vars_configuration=None): # noqa: E501 + # type: (int, list[BrokerCommission1], Configuration) -> None + """BrokerCommission - a 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 BrokerCommission. # noqa: E501 + + Total # noqa: E501 + + :return: The total of this BrokerCommission. # noqa: E501 + :rtype: int + """ + return self._total + + @total.setter + def total(self, total): + """Sets the total of this BrokerCommission. + + Total # noqa: E501 + + :param total: The total of this BrokerCommission. # noqa: E501 + :type: int + """ + + self._total = total + + @property + def list(self): + """Gets the list of this BrokerCommission. # noqa: E501 + + List of commission history # noqa: E501 + + :return: The list of this BrokerCommission. # noqa: E501 + :rtype: list[BrokerCommission1] + """ + return self._list + + @list.setter + def list(self, list): + """Sets the list of this BrokerCommission. + + List of commission history # noqa: E501 + + :param list: The list of this BrokerCommission. # noqa: E501 + :type: list[BrokerCommission1] + """ + + 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, BrokerCommission): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, BrokerCommission): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/broker_commission1.py b/gate_api/models/broker_commission1.py new file mode 100644 index 0000000..71474fc --- /dev/null +++ b/gate_api/models/broker_commission1.py @@ -0,0 +1,401 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class BrokerCommission1(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'commission_time': 'int', + 'user_id': 'int', + 'group_name': 'str', + 'amount': 'str', + 'fee': 'str', + 'fee_asset': 'str', + 'rebate_fee': 'str', + 'source': 'str', + 'currency_pair': 'str', + 'sub_broker_info': 'BrokerCommissionSubBrokerInfo', + 'alpha_contract_addr': 'str' + } + + attribute_map = { + 'commission_time': 'commission_time', + 'user_id': 'user_id', + 'group_name': 'group_name', + 'amount': 'amount', + 'fee': 'fee', + 'fee_asset': 'fee_asset', + 'rebate_fee': 'rebate_fee', + 'source': 'source', + 'currency_pair': 'currency_pair', + 'sub_broker_info': 'sub_broker_info', + 'alpha_contract_addr': 'alpha_contract_addr' + } + + 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 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._commission_time = None + self._user_id = None + self._group_name = None + self._amount = None + self._fee = None + self._fee_asset = None + self._rebate_fee = None + self._source = None + self._currency_pair = None + self._sub_broker_info = None + self._alpha_contract_addr = None + self.discriminator = None + + if commission_time is not None: + self.commission_time = commission_time + if user_id is not None: + self.user_id = user_id + if group_name is not None: + self.group_name = group_name + if amount is not None: + self.amount = amount + if fee is not None: + self.fee = fee + if fee_asset is not None: + self.fee_asset = fee_asset + if rebate_fee is not None: + self.rebate_fee = rebate_fee + if source is not None: + self.source = source + if currency_pair is not None: + self.currency_pair = currency_pair + 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 commission_time(self): + """Gets the commission_time of this BrokerCommission1. # noqa: E501 + + Commission time (Unix timestamp in seconds) # noqa: E501 + + :return: The commission_time of this BrokerCommission1. # noqa: E501 + :rtype: int + """ + return self._commission_time + + @commission_time.setter + def commission_time(self, commission_time): + """Sets the commission_time of this BrokerCommission1. + + Commission time (Unix timestamp in seconds) # noqa: E501 + + :param commission_time: The commission_time of this BrokerCommission1. # noqa: E501 + :type: int + """ + + self._commission_time = commission_time + + @property + def user_id(self): + """Gets the user_id of this BrokerCommission1. # noqa: E501 + + User ID # noqa: E501 + + :return: The user_id of this BrokerCommission1. # noqa: E501 + :rtype: int + """ + return self._user_id + + @user_id.setter + def user_id(self, user_id): + """Sets the user_id of this BrokerCommission1. + + User ID # noqa: E501 + + :param user_id: The user_id of this BrokerCommission1. # noqa: E501 + :type: int + """ + + self._user_id = user_id + + @property + def group_name(self): + """Gets the group_name of this BrokerCommission1. # noqa: E501 + + Group name # noqa: E501 + + :return: The group_name of this BrokerCommission1. # noqa: E501 + :rtype: str + """ + return self._group_name + + @group_name.setter + def group_name(self, group_name): + """Sets the group_name of this BrokerCommission1. + + Group name # noqa: E501 + + :param group_name: The group_name of this BrokerCommission1. # noqa: E501 + :type: str + """ + + self._group_name = group_name + + @property + def amount(self): + """Gets the amount of this BrokerCommission1. # noqa: E501 + + The amount of commission rebates # noqa: E501 + + :return: The amount of this BrokerCommission1. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this BrokerCommission1. + + The amount of commission rebates # noqa: E501 + + :param amount: The amount of this BrokerCommission1. # noqa: E501 + :type: str + """ + + self._amount = amount + + @property + def fee(self): + """Gets the fee of this BrokerCommission1. # noqa: E501 + + Fee # noqa: E501 + + :return: The fee of this BrokerCommission1. # noqa: E501 + :rtype: str + """ + return self._fee + + @fee.setter + def fee(self, fee): + """Sets the fee of this BrokerCommission1. + + Fee # noqa: E501 + + :param fee: The fee of this BrokerCommission1. # noqa: E501 + :type: str + """ + + self._fee = fee + + @property + def fee_asset(self): + """Gets the fee_asset of this BrokerCommission1. # noqa: E501 + + Fee currency # noqa: E501 + + :return: The fee_asset of this BrokerCommission1. # noqa: E501 + :rtype: str + """ + return self._fee_asset + + @fee_asset.setter + def fee_asset(self, fee_asset): + """Sets the fee_asset of this BrokerCommission1. + + Fee currency # noqa: E501 + + :param fee_asset: The fee_asset of this BrokerCommission1. # noqa: E501 + :type: str + """ + + self._fee_asset = fee_asset + + @property + def rebate_fee(self): + """Gets the rebate_fee of this BrokerCommission1. # noqa: E501 + + The income from rebates, converted to USDT # noqa: E501 + + :return: The rebate_fee of this BrokerCommission1. # noqa: E501 + :rtype: str + """ + return self._rebate_fee + + @rebate_fee.setter + def rebate_fee(self, rebate_fee): + """Sets the rebate_fee of this BrokerCommission1. + + The income from rebates, converted to USDT # noqa: E501 + + :param rebate_fee: The rebate_fee of this BrokerCommission1. # noqa: E501 + :type: str + """ + + self._rebate_fee = rebate_fee + + @property + def source(self): + """Gets the source of this BrokerCommission1. # noqa: E501 + + Commission transaction type: Spot, Futures, Options, Alpha # noqa: E501 + + :return: The source of this BrokerCommission1. # noqa: E501 + :rtype: str + """ + return self._source + + @source.setter + def source(self, source): + """Sets the source of this BrokerCommission1. + + Commission transaction type: Spot, Futures, Options, Alpha # noqa: E501 + + :param source: The source of this BrokerCommission1. # noqa: E501 + :type: str + """ + + self._source = source + + @property + def currency_pair(self): + """Gets the currency_pair of this BrokerCommission1. # noqa: E501 + + Currency pair # noqa: E501 + + :return: The currency_pair of this BrokerCommission1. # noqa: E501 + :rtype: str + """ + return self._currency_pair + + @currency_pair.setter + def currency_pair(self, currency_pair): + """Sets the currency_pair of this BrokerCommission1. + + Currency pair # noqa: E501 + + :param currency_pair: The currency_pair of this BrokerCommission1. # noqa: E501 + :type: str + """ + + self._currency_pair = currency_pair + + @property + def sub_broker_info(self): + """Gets the sub_broker_info of this BrokerCommission1. # noqa: E501 + + + :return: The sub_broker_info of this BrokerCommission1. # 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. + + + :param sub_broker_info: The sub_broker_info of this BrokerCommission1. # noqa: E501 + :type: BrokerCommissionSubBrokerInfo + """ + + self._sub_broker_info = sub_broker_info + + @property + def alpha_contract_addr(self): + """Gets the alpha_contract_addr of this BrokerCommission1. # noqa: E501 + + Alpha contract address # noqa: E501 + + :return: The alpha_contract_addr of this BrokerCommission1. # 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. + + Alpha contract address # noqa: E501 + + :param alpha_contract_addr: The alpha_contract_addr of this BrokerCommission1. # 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, BrokerCommission1): + return 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): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/broker_commission_sub_broker_info.py b/gate_api/models/broker_commission_sub_broker_info.py new file mode 100644 index 0000000..220166c --- /dev/null +++ b/gate_api/models/broker_commission_sub_broker_info.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 BrokerCommissionSubBrokerInfo(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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': 'int', + 'original_commission_rate': 'str', + 'relative_commission_rate': 'str', + 'commission_rate': 'str' + } + + attribute_map = { + 'user_id': 'user_id', + 'original_commission_rate': 'original_commission_rate', + 'relative_commission_rate': 'relative_commission_rate', + 'commission_rate': 'commission_rate' + } + + def __init__(self, user_id=None, original_commission_rate=None, relative_commission_rate=None, commission_rate=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, str, str, Configuration) -> None + """BrokerCommissionSubBrokerInfo - a 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._original_commission_rate = None + self._relative_commission_rate = None + self._commission_rate = None + self.discriminator = None + + if user_id is not None: + self.user_id = user_id + if original_commission_rate is not None: + self.original_commission_rate = original_commission_rate + if relative_commission_rate is not None: + self.relative_commission_rate = relative_commission_rate + if commission_rate is not None: + self.commission_rate = commission_rate + + @property + def user_id(self): + """Gets the user_id of this BrokerCommissionSubBrokerInfo. # noqa: E501 + + Sub-broker user ID # noqa: E501 + + :return: The user_id of this BrokerCommissionSubBrokerInfo. # noqa: E501 + :rtype: int + """ + return self._user_id + + @user_id.setter + def user_id(self, user_id): + """Sets the user_id of this BrokerCommissionSubBrokerInfo. + + Sub-broker user ID # noqa: E501 + + :param user_id: The user_id of this BrokerCommissionSubBrokerInfo. # noqa: E501 + :type: int + """ + + self._user_id = user_id + + @property + def original_commission_rate(self): + """Gets the original_commission_rate of this BrokerCommissionSubBrokerInfo. # noqa: E501 + + Sub-broker original commission rate # noqa: E501 + + :return: The original_commission_rate of this BrokerCommissionSubBrokerInfo. # noqa: E501 + :rtype: str + """ + return self._original_commission_rate + + @original_commission_rate.setter + def original_commission_rate(self, original_commission_rate): + """Sets the original_commission_rate of this BrokerCommissionSubBrokerInfo. + + Sub-broker original commission rate # noqa: E501 + + :param original_commission_rate: The original_commission_rate of this BrokerCommissionSubBrokerInfo. # noqa: E501 + :type: str + """ + + self._original_commission_rate = original_commission_rate + + @property + def relative_commission_rate(self): + """Gets the relative_commission_rate of this BrokerCommissionSubBrokerInfo. # noqa: E501 + + Sub-broker relative commission rate # noqa: E501 + + :return: The relative_commission_rate of this BrokerCommissionSubBrokerInfo. # noqa: E501 + :rtype: str + """ + return self._relative_commission_rate + + @relative_commission_rate.setter + def relative_commission_rate(self, relative_commission_rate): + """Sets the relative_commission_rate of this BrokerCommissionSubBrokerInfo. + + Sub-broker relative commission rate # noqa: E501 + + :param relative_commission_rate: The relative_commission_rate of this BrokerCommissionSubBrokerInfo. # noqa: E501 + :type: str + """ + + self._relative_commission_rate = relative_commission_rate + + @property + def commission_rate(self): + """Gets the commission_rate of this BrokerCommissionSubBrokerInfo. # noqa: E501 + + Sub-broker actual commission rate # noqa: E501 + + :return: The commission_rate of this BrokerCommissionSubBrokerInfo. # noqa: E501 + :rtype: str + """ + return self._commission_rate + + @commission_rate.setter + def commission_rate(self, commission_rate): + """Sets the commission_rate of this BrokerCommissionSubBrokerInfo. + + Sub-broker actual commission rate # noqa: E501 + + :param commission_rate: The commission_rate of this BrokerCommissionSubBrokerInfo. # noqa: E501 + :type: str + """ + + self._commission_rate = commission_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, BrokerCommissionSubBrokerInfo): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, BrokerCommissionSubBrokerInfo): + 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 new file mode 100644 index 0000000..0a85977 --- /dev/null +++ b/gate_api/models/broker_transaction.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 BrokerTransaction(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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[BrokerTransaction1]' + } + + attribute_map = { + 'total': 'total', + 'list': 'list' + } + + def __init__(self, total=None, list=None, local_vars_configuration=None): # noqa: E501 + # type: (int, list[BrokerTransaction1], 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.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 BrokerTransaction. # noqa: E501 + + Total # noqa: E501 + + :return: The total of this BrokerTransaction. # noqa: E501 + :rtype: int + """ + return self._total + + @total.setter + def total(self, total): + """Sets the total of this BrokerTransaction. + + Total # noqa: E501 + + :param total: The total of this BrokerTransaction. # noqa: E501 + :type: int + """ + + self._total = total + + @property + def list(self): + """Gets the list of this BrokerTransaction. # noqa: E501 + + List of transaction history # noqa: E501 + + :return: The list of this BrokerTransaction. # noqa: E501 + :rtype: list[BrokerTransaction1] + """ + return self._list + + @list.setter + def list(self, list): + """Sets the list of this BrokerTransaction. + + List of transaction history # noqa: E501 + + :param list: The list of this BrokerTransaction. # noqa: E501 + :type: list[BrokerTransaction1] + """ + + 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, BrokerTransaction): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, BrokerTransaction): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/broker_transaction1.py b/gate_api/models/broker_transaction1.py new file mode 100644 index 0000000..87a12d0 --- /dev/null +++ b/gate_api/models/broker_transaction1.py @@ -0,0 +1,373 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@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/cancel_batch_order.py b/gate_api/models/cancel_batch_order.py new file mode 100644 index 0000000..bfc7bd9 --- /dev/null +++ b/gate_api/models/cancel_batch_order.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 CancelBatchOrder(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'id': 'str', + 'account': 'str', + 'action_mode': 'str' + } + + attribute_map = { + 'currency_pair': 'currency_pair', + 'id': 'id', + 'account': 'account', + 'action_mode': 'action_mode' + } + + def __init__(self, currency_pair=None, id=None, account=None, action_mode=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, Configuration) -> None + """CancelBatchOrder - a 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._id = None + self._account = None + self._action_mode = None + self.discriminator = None + + self.currency_pair = currency_pair + self.id = id + if account is not None: + self.account = account + if action_mode is not None: + self.action_mode = action_mode + + @property + def currency_pair(self): + """Gets the currency_pair of this CancelBatchOrder. # noqa: E501 + + Order currency pair # noqa: E501 + + :return: The currency_pair of this CancelBatchOrder. # noqa: E501 + :rtype: str + """ + return self._currency_pair + + @currency_pair.setter + def currency_pair(self, currency_pair): + """Sets the currency_pair of this CancelBatchOrder. + + Order currency pair # noqa: E501 + + :param currency_pair: The currency_pair of this CancelBatchOrder. # 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 id(self): + """Gets the id of this CancelBatchOrder. # noqa: E501 + + Order ID or user custom ID. Custom ID are accepted only within 30 minutes after order creation # noqa: E501 + + :return: The id of this CancelBatchOrder. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this CancelBatchOrder. + + Order ID or user custom ID. Custom ID are accepted only within 30 minutes after order creation # noqa: E501 + + :param id: The id of this CancelBatchOrder. # 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 account(self): + """Gets the account of this CancelBatchOrder. # noqa: E501 + + If the canceled order is a unified account apikey, this field must be specified and set to `unified` # noqa: E501 + + :return: The account of this CancelBatchOrder. # noqa: E501 + :rtype: str + """ + return self._account + + @account.setter + def account(self, account): + """Sets the account of this CancelBatchOrder. + + If the canceled order is a unified account apikey, this field must be specified and set to `unified` # noqa: E501 + + :param account: The account of this CancelBatchOrder. # noqa: E501 + :type: str + """ + + self._account = account + + @property + def action_mode(self): + """Gets the action_mode of this CancelBatchOrder. # noqa: E501 + + 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) # noqa: E501 + + :return: The action_mode of this CancelBatchOrder. # noqa: E501 + :rtype: str + """ + return self._action_mode + + @action_mode.setter + def action_mode(self, action_mode): + """Sets the action_mode of this CancelBatchOrder. + + 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) # noqa: E501 + + :param action_mode: The action_mode of this CancelBatchOrder. # noqa: E501 + :type: str + """ + + self._action_mode = action_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, CancelBatchOrder): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CancelBatchOrder): + 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 deleted file mode 100644 index e969437..0000000 --- a/gate_api/models/cancel_order.py +++ /dev/null @@ -1,171 +0,0 @@ -# coding: utf-8 - -""" - Gate API v4 - - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 - - Contact: support@mail.gate.io - 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 = {'currency_pair': 'str', 'id': 'str', 'account': 'str'} - - attribute_map = {'currency_pair': 'currency_pair', 'id': 'id', 'account': 'account'} - - def __init__(self, currency_pair=None, id=None, account=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._currency_pair = None - self._id = None - self._account = None - self.discriminator = None - - self.currency_pair = currency_pair - self.id = id - if account is not None: - self.account = account - - @property - def currency_pair(self): - """Gets the currency_pair of this CancelOrder. # noqa: E501 - - Order currency pair # noqa: E501 - - :return: The currency_pair of this CancelOrder. # noqa: E501 - :rtype: str - """ - return self._currency_pair - - @currency_pair.setter - def currency_pair(self, currency_pair): - """Sets the currency_pair of this CancelOrder. - - Order currency pair # noqa: E501 - - :param currency_pair: The currency_pair of this CancelOrder. # 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 id(self): - """Gets the id of this CancelOrder. # noqa: E501 - - Order ID or user custom ID. Custom ID are accepted only within 30 minutes after order creation # noqa: E501 - - :return: The id of this CancelOrder. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this CancelOrder. - - Order ID or user custom ID. Custom ID are accepted only within 30 minutes after order creation # noqa: E501 - - :param id: The id of this CancelOrder. # 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 account(self): - """Gets the account of this CancelOrder. # noqa: E501 - - If cancelled order is cross margin order, this field must be set and can only be `cross_margin` # noqa: E501 - - :return: The account of this CancelOrder. # noqa: E501 - :rtype: str - """ - return self._account - - @account.setter - def account(self, account): - """Sets the account of this CancelOrder. - - If cancelled order is cross margin order, this field must be set and can only be `cross_margin` # noqa: E501 - - :param account: The account of this CancelOrder. # noqa: E501 - :type: str - """ - - self._account = account - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(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/cancel_order_result.py b/gate_api/models/cancel_order_result.py index a349770..487486a 100644 --- a/gate_api/models/cancel_order_result.py +++ b/gate_api/models/cancel_order_result.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -35,32 +35,25 @@ class CancelOrderResult(object): openapi_types = { 'currency_pair': 'str', 'id': 'str', + 'text': 'str', 'succeeded': 'bool', 'label': 'str', 'message': 'str', - 'account': 'str', + 'account': 'str' } attribute_map = { 'currency_pair': 'currency_pair', 'id': 'id', + 'text': 'text', 'succeeded': 'succeeded', 'label': 'label', 'message': 'message', - 'account': 'account', + 'account': 'account' } - def __init__( - self, - currency_pair=None, - id=None, - succeeded=None, - label=None, - message=None, - account=None, - local_vars_configuration=None, - ): # noqa: E501 - # type: (str, str, bool, str, str, str, Configuration) -> None + def __init__(self, currency_pair=None, id=None, text=None, succeeded=None, label=None, message=None, account=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, bool, str, str, str, Configuration) -> None """CancelOrderResult - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -68,6 +61,7 @@ def __init__( self._currency_pair = None self._id = None + self._text = None self._succeeded = None self._label = None self._message = None @@ -78,6 +72,8 @@ def __init__( self.currency_pair = currency_pair if id is not None: self.id = id + if text is not None: + self.text = text if succeeded is not None: self.succeeded = succeeded if label is not None: @@ -133,6 +129,29 @@ def id(self, id): self._id = id + @property + def text(self): + """Gets the text of this CancelOrderResult. # noqa: E501 + + Custom order information # noqa: E501 + + :return: The text of this CancelOrderResult. # noqa: E501 + :rtype: str + """ + return self._text + + @text.setter + def text(self, text): + """Sets the text of this CancelOrderResult. + + Custom order information # noqa: E501 + + :param text: The text of this CancelOrderResult. # noqa: E501 + :type: str + """ + + self._text = text + @property def succeeded(self): """Gets the succeeded of this CancelOrderResult. # noqa: E501 @@ -183,7 +202,7 @@ def label(self, label): def message(self): """Gets the message of this CancelOrderResult. # noqa: E501 - Error message when failed to cancel the order; empty if succeeded # noqa: E501 + Error description when cancellation fails, empty if successful # noqa: E501 :return: The message of this CancelOrderResult. # noqa: E501 :rtype: str @@ -194,7 +213,7 @@ def message(self): def message(self, message): """Sets the message of this CancelOrderResult. - Error message when failed to cancel the order; empty if succeeded # noqa: E501 + Error description when cancellation fails, empty if successful # noqa: E501 :param message: The message of this CancelOrderResult. # noqa: E501 :type: str @@ -206,7 +225,7 @@ def message(self, message): def account(self): """Gets the account of this CancelOrderResult. # noqa: E501 - Empty by default. If cancelled order is cross margin order, this field is set to `cross_margin` # noqa: E501 + Default is empty (deprecated) # noqa: E501 :return: The account of this CancelOrderResult. # noqa: E501 :rtype: str @@ -217,7 +236,7 @@ def account(self): def account(self, account): """Sets the account of this CancelOrderResult. - Empty by default. If cancelled order is cross margin order, this field is set to `cross_margin` # noqa: E501 + Default is empty (deprecated) # noqa: E501 :param account: The account of this CancelOrderResult. # noqa: E501 :type: str @@ -232,16 +251,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/collateral_adjust.py b/gate_api/models/collateral_adjust.py new file mode 100644 index 0000000..919556a --- /dev/null +++ b/gate_api/models/collateral_adjust.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 CollateralAdjust(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'type': 'str', + 'collaterals': 'list[CollateralCurrency]' + } + + attribute_map = { + 'order_id': 'order_id', + 'type': 'type', + 'collaterals': 'collaterals' + } + + def __init__(self, order_id=None, type=None, collaterals=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, list[CollateralCurrency], Configuration) -> None + """CollateralAdjust - a 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._type = None + self._collaterals = None + self.discriminator = None + + self.order_id = order_id + self.type = type + if collaterals is not None: + self.collaterals = collaterals + + @property + def order_id(self): + """Gets the order_id of this CollateralAdjust. # noqa: E501 + + Order ID # noqa: E501 + + :return: The order_id of this CollateralAdjust. # noqa: E501 + :rtype: int + """ + return self._order_id + + @order_id.setter + def order_id(self, order_id): + """Sets the order_id of this CollateralAdjust. + + Order ID # noqa: E501 + + :param order_id: The order_id of this CollateralAdjust. # 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 type(self): + """Gets the type of this CollateralAdjust. # noqa: E501 + + Operation type: append - add collateral, redeem - withdraw collateral # noqa: E501 + + :return: The type of this CollateralAdjust. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this CollateralAdjust. + + Operation type: append - add collateral, redeem - withdraw collateral # noqa: E501 + + :param type: The type of this CollateralAdjust. # 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 collaterals(self): + """Gets the collaterals of this CollateralAdjust. # noqa: E501 + + Collateral currency list # noqa: E501 + + :return: The collaterals of this CollateralAdjust. # noqa: E501 + :rtype: list[CollateralCurrency] + """ + return self._collaterals + + @collaterals.setter + def collaterals(self, collaterals): + """Sets the collaterals of this CollateralAdjust. + + Collateral currency list # noqa: E501 + + :param collaterals: The collaterals of this CollateralAdjust. # noqa: E501 + :type: list[CollateralCurrency] + """ + + self._collaterals = collaterals + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CollateralAdjust): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CollateralAdjust): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/collateral_adjust_res.py b/gate_api/models/collateral_adjust_res.py new file mode 100644 index 0000000..7cc0044 --- /dev/null +++ b/gate_api/models/collateral_adjust_res.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 CollateralAdjustRes(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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_currencies': 'list[CollateralCurrencyRes]' + } + + attribute_map = { + 'order_id': 'order_id', + 'collateral_currencies': 'collateral_currencies' + } + + def __init__(self, order_id=None, collateral_currencies=None, local_vars_configuration=None): # noqa: E501 + # type: (int, list[CollateralCurrencyRes], Configuration) -> None + """CollateralAdjustRes - a 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_currencies = None + self.discriminator = None + + if order_id is not None: + self.order_id = order_id + if collateral_currencies is not None: + self.collateral_currencies = collateral_currencies + + @property + def order_id(self): + """Gets the order_id of this CollateralAdjustRes. # noqa: E501 + + Order ID # noqa: E501 + + :return: The order_id of this CollateralAdjustRes. # noqa: E501 + :rtype: int + """ + return self._order_id + + @order_id.setter + def order_id(self, order_id): + """Sets the order_id of this CollateralAdjustRes. + + Order ID # noqa: E501 + + :param order_id: The order_id of this CollateralAdjustRes. # noqa: E501 + :type: int + """ + + self._order_id = order_id + + @property + def collateral_currencies(self): + """Gets the collateral_currencies of this CollateralAdjustRes. # noqa: E501 + + Collateral currency information # noqa: E501 + + :return: The collateral_currencies of this CollateralAdjustRes. # noqa: E501 + :rtype: list[CollateralCurrencyRes] + """ + return self._collateral_currencies + + @collateral_currencies.setter + def collateral_currencies(self, collateral_currencies): + """Sets the collateral_currencies of this CollateralAdjustRes. + + Collateral currency information # noqa: E501 + + :param collateral_currencies: The collateral_currencies of this CollateralAdjustRes. # noqa: E501 + :type: list[CollateralCurrencyRes] + """ + + self._collateral_currencies = collateral_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, CollateralAdjustRes): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CollateralAdjustRes): + 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 new file mode 100644 index 0000000..3bc3192 --- /dev/null +++ b/gate_api/models/collateral_align.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 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_currency.py b/gate_api/models/collateral_currency.py new file mode 100644 index 0000000..08c6811 --- /dev/null +++ b/gate_api/models/collateral_currency.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 CollateralCurrency(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'amount': 'str' + } + + attribute_map = { + 'currency': 'currency', + 'amount': 'amount' + } + + def __init__(self, currency=None, amount=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """CollateralCurrency - a 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.discriminator = None + + if currency is not None: + self.currency = currency + if amount is not None: + self.amount = amount + + @property + def currency(self): + """Gets the currency of this CollateralCurrency. # noqa: E501 + + Currency # noqa: E501 + + :return: The currency of this CollateralCurrency. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this CollateralCurrency. + + Currency # noqa: E501 + + :param currency: The currency of this CollateralCurrency. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def amount(self): + """Gets the amount of this CollateralCurrency. # noqa: E501 + + Size # noqa: E501 + + :return: The amount of this CollateralCurrency. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this CollateralCurrency. + + Size # noqa: E501 + + :param amount: The amount of this CollateralCurrency. # noqa: E501 + :type: str + """ + + 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, CollateralCurrency): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CollateralCurrency): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/collateral_currency_info.py b/gate_api/models/collateral_currency_info.py new file mode 100644 index 0000000..f555f62 --- /dev/null +++ b/gate_api/models/collateral_currency_info.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 CollateralCurrencyInfo(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'index_price': 'str', + 'left_collateral': 'str', + 'left_collateral_usdt': 'str' + } + + attribute_map = { + 'currency': 'currency', + 'index_price': 'index_price', + 'left_collateral': 'left_collateral', + 'left_collateral_usdt': 'left_collateral_usdt' + } + + def __init__(self, currency=None, index_price=None, left_collateral=None, left_collateral_usdt=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, Configuration) -> None + """CollateralCurrencyInfo - a 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._index_price = None + self._left_collateral = None + self._left_collateral_usdt = None + self.discriminator = None + + if currency is not None: + self.currency = currency + if index_price is not None: + self.index_price = index_price + if left_collateral is not None: + self.left_collateral = left_collateral + if left_collateral_usdt is not None: + self.left_collateral_usdt = left_collateral_usdt + + @property + def currency(self): + """Gets the currency of this CollateralCurrencyInfo. # noqa: E501 + + Currency # noqa: E501 + + :return: The currency of this CollateralCurrencyInfo. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this CollateralCurrencyInfo. + + Currency # noqa: E501 + + :param currency: The currency of this CollateralCurrencyInfo. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def index_price(self): + """Gets the index_price of this CollateralCurrencyInfo. # noqa: E501 + + Currency Index Price # noqa: E501 + + :return: The index_price of this CollateralCurrencyInfo. # noqa: E501 + :rtype: str + """ + return self._index_price + + @index_price.setter + def index_price(self, index_price): + """Sets the index_price of this CollateralCurrencyInfo. + + Currency Index Price # noqa: E501 + + :param index_price: The index_price of this CollateralCurrencyInfo. # noqa: E501 + :type: str + """ + + self._index_price = index_price + + @property + def left_collateral(self): + """Gets the left_collateral of this CollateralCurrencyInfo. # noqa: E501 + + Remaining collateral amount # noqa: E501 + + :return: The left_collateral of this CollateralCurrencyInfo. # noqa: E501 + :rtype: str + """ + return self._left_collateral + + @left_collateral.setter + def left_collateral(self, left_collateral): + """Sets the left_collateral of this CollateralCurrencyInfo. + + Remaining collateral amount # noqa: E501 + + :param left_collateral: The left_collateral of this CollateralCurrencyInfo. # noqa: E501 + :type: str + """ + + self._left_collateral = left_collateral + + @property + def left_collateral_usdt(self): + """Gets the left_collateral_usdt of this CollateralCurrencyInfo. # noqa: E501 + + Remaining collateral value converted to USDT # noqa: E501 + + :return: The left_collateral_usdt of this CollateralCurrencyInfo. # noqa: E501 + :rtype: str + """ + return self._left_collateral_usdt + + @left_collateral_usdt.setter + def left_collateral_usdt(self, left_collateral_usdt): + """Sets the left_collateral_usdt of this CollateralCurrencyInfo. + + Remaining collateral value converted to USDT # noqa: E501 + + :param left_collateral_usdt: The left_collateral_usdt of this CollateralCurrencyInfo. # noqa: E501 + :type: str + """ + + self._left_collateral_usdt = left_collateral_usdt + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CollateralCurrencyInfo): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CollateralCurrencyInfo): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/collateral_currency_res.py b/gate_api/models/collateral_currency_res.py new file mode 100644 index 0000000..610a406 --- /dev/null +++ b/gate_api/models/collateral_currency_res.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 CollateralCurrencyRes(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'succeeded': 'bool', + 'label': 'str', + 'message': 'str', + 'currency': 'str', + 'amount': 'str' + } + + attribute_map = { + 'succeeded': 'succeeded', + 'label': 'label', + 'message': 'message', + 'currency': 'currency', + 'amount': 'amount' + } + + def __init__(self, succeeded=None, label=None, message=None, currency=None, amount=None, local_vars_configuration=None): # noqa: E501 + # type: (bool, str, str, str, str, Configuration) -> None + """CollateralCurrencyRes - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._succeeded = None + self._label = None + self._message = None + self._currency = None + self._amount = None + self.discriminator = None + + if succeeded is not None: + self.succeeded = succeeded + if label is not None: + self.label = label + if message is not None: + self.message = message + if currency is not None: + self.currency = currency + if amount is not None: + self.amount = amount + + @property + def succeeded(self): + """Gets the succeeded of this CollateralCurrencyRes. # noqa: E501 + + Update success status # noqa: E501 + + :return: The succeeded of this CollateralCurrencyRes. # noqa: E501 + :rtype: bool + """ + return self._succeeded + + @succeeded.setter + def succeeded(self, succeeded): + """Sets the succeeded of this CollateralCurrencyRes. + + Update success status # noqa: E501 + + :param succeeded: The succeeded of this CollateralCurrencyRes. # noqa: E501 + :type: bool + """ + + self._succeeded = succeeded + + @property + def label(self): + """Gets the label of this CollateralCurrencyRes. # noqa: E501 + + Error identifier for failed operations; empty when successful # noqa: E501 + + :return: The label of this CollateralCurrencyRes. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this CollateralCurrencyRes. + + Error identifier for failed operations; empty when successful # noqa: E501 + + :param label: The label of this CollateralCurrencyRes. # noqa: E501 + :type: str + """ + + self._label = label + + @property + def message(self): + """Gets the message of this CollateralCurrencyRes. # noqa: E501 + + Error description for failed operations; empty when successful # noqa: E501 + + :return: The message of this CollateralCurrencyRes. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this CollateralCurrencyRes. + + Error description for failed operations; empty when successful # noqa: E501 + + :param message: The message of this CollateralCurrencyRes. # noqa: E501 + :type: str + """ + + self._message = message + + @property + def currency(self): + """Gets the currency of this CollateralCurrencyRes. # noqa: E501 + + Currency # noqa: E501 + + :return: The currency of this CollateralCurrencyRes. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this CollateralCurrencyRes. + + Currency # noqa: E501 + + :param currency: The currency of this CollateralCurrencyRes. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def amount(self): + """Gets the amount of this CollateralCurrencyRes. # noqa: E501 + + Successfully operated collateral quantity; 0 if operation fails # noqa: E501 + + :return: The amount of this CollateralCurrencyRes. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this CollateralCurrencyRes. + + Successfully operated collateral quantity; 0 if operation fails # noqa: E501 + + :param amount: The amount of this CollateralCurrencyRes. # noqa: E501 + :type: str + """ + + 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, CollateralCurrencyRes): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CollateralCurrencyRes): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/collateral_current_rate.py b/gate_api/models/collateral_current_rate.py new file mode 100644 index 0000000..5d00be0 --- /dev/null +++ b/gate_api/models/collateral_current_rate.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 CollateralCurrentRate(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'current_rate': 'str' + } + + attribute_map = { + 'currency': 'currency', + 'current_rate': 'current_rate' + } + + def __init__(self, currency=None, current_rate=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """CollateralCurrentRate - a 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._current_rate = None + self.discriminator = None + + if currency is not None: + self.currency = currency + if current_rate is not None: + self.current_rate = current_rate + + @property + def currency(self): + """Gets the currency of this CollateralCurrentRate. # noqa: E501 + + Currency # noqa: E501 + + :return: The currency of this CollateralCurrentRate. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this CollateralCurrentRate. + + Currency # noqa: E501 + + :param currency: The currency of this CollateralCurrentRate. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def current_rate(self): + """Gets the current_rate of this CollateralCurrentRate. # noqa: E501 + + Currency current interest rate # noqa: E501 + + :return: The current_rate of this CollateralCurrentRate. # noqa: E501 + :rtype: str + """ + return self._current_rate + + @current_rate.setter + def current_rate(self, current_rate): + """Sets the current_rate of this CollateralCurrentRate. + + Currency current interest rate # noqa: E501 + + :param current_rate: The current_rate of this CollateralCurrentRate. # noqa: E501 + :type: str + """ + + self._current_rate = current_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, CollateralCurrentRate): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CollateralCurrentRate): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/collateral_fix_rate.py b/gate_api/models/collateral_fix_rate.py new file mode 100644 index 0000000..0bdfb45 --- /dev/null +++ b/gate_api/models/collateral_fix_rate.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 CollateralFixRate(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'rate_7d': 'str', + 'rate_30d': 'str', + 'update_time': 'int' + } + + attribute_map = { + 'currency': 'currency', + 'rate_7d': 'rate_7d', + 'rate_30d': 'rate_30d', + 'update_time': 'update_time' + } + + def __init__(self, currency=None, rate_7d=None, rate_30d=None, update_time=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, int, Configuration) -> None + """CollateralFixRate - a 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._rate_7d = None + self._rate_30d = None + self._update_time = None + self.discriminator = None + + if currency is not None: + self.currency = currency + if rate_7d is not None: + self.rate_7d = rate_7d + if rate_30d is not None: + self.rate_30d = rate_30d + if update_time is not None: + self.update_time = update_time + + @property + def currency(self): + """Gets the currency of this CollateralFixRate. # noqa: E501 + + Currency # noqa: E501 + + :return: The currency of this CollateralFixRate. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this CollateralFixRate. + + Currency # noqa: E501 + + :param currency: The currency of this CollateralFixRate. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def rate_7d(self): + """Gets the rate_7d of this CollateralFixRate. # noqa: E501 + + Fixed interest rate for 7-day lending period # noqa: E501 + + :return: The rate_7d of this CollateralFixRate. # noqa: E501 + :rtype: str + """ + return self._rate_7d + + @rate_7d.setter + def rate_7d(self, rate_7d): + """Sets the rate_7d of this CollateralFixRate. + + Fixed interest rate for 7-day lending period # noqa: E501 + + :param rate_7d: The rate_7d of this CollateralFixRate. # noqa: E501 + :type: str + """ + + self._rate_7d = rate_7d + + @property + def rate_30d(self): + """Gets the rate_30d of this CollateralFixRate. # noqa: E501 + + Fixed interest rate for 30-day lending period # noqa: E501 + + :return: The rate_30d of this CollateralFixRate. # noqa: E501 + :rtype: str + """ + return self._rate_30d + + @rate_30d.setter + def rate_30d(self, rate_30d): + """Sets the rate_30d of this CollateralFixRate. + + Fixed interest rate for 30-day lending period # noqa: E501 + + :param rate_30d: The rate_30d of this CollateralFixRate. # noqa: E501 + :type: str + """ + + self._rate_30d = rate_30d + + @property + def update_time(self): + """Gets the update_time of this CollateralFixRate. # noqa: E501 + + Update time, timestamp in seconds # noqa: E501 + + :return: The update_time of this CollateralFixRate. # noqa: E501 + :rtype: int + """ + return self._update_time + + @update_time.setter + def update_time(self, update_time): + """Sets the update_time of this CollateralFixRate. + + Update time, timestamp in seconds # noqa: E501 + + :param update_time: The update_time of this CollateralFixRate. # noqa: E501 + :type: int + """ + + 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, CollateralFixRate): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CollateralFixRate): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/collateral_loan_currency.py b/gate_api/models/collateral_loan_currency.py new file mode 100644 index 0000000..67b6713 --- /dev/null +++ b/gate_api/models/collateral_loan_currency.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 CollateralLoanCurrency(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'loan_currency': 'str', + 'collateral_currency': 'list[str]' + } + + attribute_map = { + 'loan_currency': 'loan_currency', + 'collateral_currency': 'collateral_currency' + } + + 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 + 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.discriminator = None + + if loan_currency is not None: + self.loan_currency = loan_currency + if collateral_currency is not None: + self.collateral_currency = collateral_currency + + @property + def loan_currency(self): + """Gets the loan_currency of this CollateralLoanCurrency. # noqa: E501 + + Borrowed currency # noqa: E501 + + :return: The loan_currency of this CollateralLoanCurrency. # noqa: E501 + :rtype: str + """ + return self._loan_currency + + @loan_currency.setter + def loan_currency(self, loan_currency): + """Sets the loan_currency of this CollateralLoanCurrency. + + Borrowed currency # noqa: E501 + + :param loan_currency: The loan_currency of this CollateralLoanCurrency. # noqa: E501 + :type: str + """ + + self._loan_currency = loan_currency + + @property + def collateral_currency(self): + """Gets the collateral_currency of this CollateralLoanCurrency. # noqa: E501 + + List of supported collateral currencies # noqa: E501 + + :return: The collateral_currency of this CollateralLoanCurrency. # noqa: E501 + :rtype: list[str] + """ + return self._collateral_currency + + @collateral_currency.setter + def collateral_currency(self, collateral_currency): + """Sets the collateral_currency of this CollateralLoanCurrency. + + List of supported collateral currencies # noqa: E501 + + :param collateral_currency: The collateral_currency of this CollateralLoanCurrency. # noqa: E501 + :type: list[str] + """ + + self._collateral_currency = collateral_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, CollateralLoanCurrency): + return 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): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/collateral_ltv.py b/gate_api/models/collateral_ltv.py new file mode 100644 index 0000000..34c8653 --- /dev/null +++ b/gate_api/models/collateral_ltv.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 CollateralLtv(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'init_ltv': 'str', + 'alert_ltv': 'str', + 'liquidate_ltv': 'str' + } + + attribute_map = { + 'init_ltv': 'init_ltv', + 'alert_ltv': 'alert_ltv', + 'liquidate_ltv': 'liquidate_ltv' + } + + def __init__(self, init_ltv=None, alert_ltv=None, liquidate_ltv=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, Configuration) -> None + """CollateralLtv - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._init_ltv = None + self._alert_ltv = None + self._liquidate_ltv = None + self.discriminator = None + + 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 + + @property + def init_ltv(self): + """Gets the init_ltv of this CollateralLtv. # noqa: E501 + + Initial collateralization rate # noqa: E501 + + :return: The init_ltv of this CollateralLtv. # noqa: E501 + :rtype: str + """ + return self._init_ltv + + @init_ltv.setter + def init_ltv(self, init_ltv): + """Sets the init_ltv of this CollateralLtv. + + Initial collateralization rate # noqa: E501 + + :param init_ltv: The init_ltv of this CollateralLtv. # noqa: E501 + :type: str + """ + + self._init_ltv = init_ltv + + @property + def alert_ltv(self): + """Gets the alert_ltv of this CollateralLtv. # noqa: E501 + + Warning collateralization rate # noqa: E501 + + :return: The alert_ltv of this CollateralLtv. # noqa: E501 + :rtype: str + """ + return self._alert_ltv + + @alert_ltv.setter + def alert_ltv(self, alert_ltv): + """Sets the alert_ltv of this CollateralLtv. + + Warning collateralization rate # noqa: E501 + + :param alert_ltv: The alert_ltv of this CollateralLtv. # noqa: E501 + :type: str + """ + + self._alert_ltv = alert_ltv + + @property + def liquidate_ltv(self): + """Gets the liquidate_ltv of this CollateralLtv. # noqa: E501 + + Liquidation collateralization rate # noqa: E501 + + :return: The liquidate_ltv of this CollateralLtv. # noqa: E501 + :rtype: str + """ + return self._liquidate_ltv + + @liquidate_ltv.setter + def liquidate_ltv(self, liquidate_ltv): + """Sets the liquidate_ltv of this CollateralLtv. + + Liquidation collateralization rate # noqa: E501 + + :param liquidate_ltv: The liquidate_ltv of this CollateralLtv. # noqa: E501 + :type: str + """ + + self._liquidate_ltv = liquidate_ltv + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CollateralLtv): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CollateralLtv): + 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 new file mode 100644 index 0000000..f6cac73 --- /dev/null +++ b/gate_api/models/collateral_order.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 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 new file mode 100644 index 0000000..b5eeb09 --- /dev/null +++ b/gate_api/models/collateral_record.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 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/contract.py b/gate_api/models/contract.py index 53cee86..557f6ce 100644 --- a/gate_api/models/contract.py +++ b/gate_api/models/contract.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -65,6 +65,14 @@ class Contract(object): 'config_change_time': 'float', 'in_delisting': 'bool', 'orders_limit': 'int', + 'enable_bonus': 'bool', + 'enable_credit': 'bool', + 'create_time': 'float', + 'funding_cap_ratio': 'str', + 'status': 'str', + 'launch_time': 'int', + 'delisting_time': 'int', + 'delisted_time': 'int' } attribute_map = { @@ -100,45 +108,18 @@ class Contract(object): 'config_change_time': 'config_change_time', 'in_delisting': 'in_delisting', 'orders_limit': 'orders_limit', + 'enable_bonus': 'enable_bonus', + 'enable_credit': 'enable_credit', + 'create_time': 'create_time', + 'funding_cap_ratio': 'funding_cap_ratio', + 'status': 'status', + 'launch_time': 'launch_time', + 'delisting_time': 'delisting_time', + 'delisted_time': 'delisted_time' } - 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, - 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, int, int, str, str, str, int, int, int, int, float, bool, int, 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, 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, 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, int, int, str, str, str, int, int, int, int, float, bool, int, bool, bool, float, str, str, int, int, int, Configuration) -> None """Contract - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -176,6 +157,14 @@ def __init__( self._config_change_time = None self._in_delisting = None self._orders_limit = None + self._enable_bonus = None + self._enable_credit = None + self._create_time = None + self._funding_cap_ratio = None + self._status = None + self._launch_time = None + self._delisting_time = None + self._delisted_time = None self.discriminator = None if name is not None: @@ -242,6 +231,22 @@ def __init__( self.in_delisting = in_delisting if orders_limit is not None: self.orders_limit = orders_limit + if enable_bonus is not None: + self.enable_bonus = enable_bonus + if enable_credit is not None: + self.enable_credit = enable_credit + if create_time is not None: + self.create_time = create_time + if funding_cap_ratio is not None: + self.funding_cap_ratio = funding_cap_ratio + if status is not None: + self.status = status + if launch_time is not None: + self.launch_time = launch_time + if delisting_time is not None: + self.delisting_time = delisting_time + if delisted_time is not None: + self.delisted_time = delisted_time @property def name(self): @@ -270,7 +275,7 @@ def name(self, name): def type(self): """Gets the type of this Contract. # noqa: E501 - Futures contract type # noqa: E501 + Contract type: inverse - inverse contract, direct - direct contract # noqa: E501 :return: The type of this Contract. # noqa: E501 :rtype: str @@ -281,7 +286,7 @@ def type(self): def type(self, type): """Sets the type of this Contract. - Futures contract type # noqa: E501 + Contract type: inverse - inverse contract, direct - direct contract # noqa: E501 :param type: The type of this Contract. # noqa: E501 :type: str @@ -289,7 +294,8 @@ def type(self, type): allowed_values = ["inverse", "direct"] # 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}".format(type, allowed_values) # noqa: E501 + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) ) self._type = type @@ -390,7 +396,7 @@ def maintenance_rate(self, maintenance_rate): def mark_type(self): """Gets the mark_type of this Contract. # noqa: E501 - Mark price type, internal - based on internal trading, index - based on external index price # noqa: E501 + Mark price type: internal - internal trading price, index - external index price # noqa: E501 :return: The mark_type of this Contract. # noqa: E501 :rtype: str @@ -401,7 +407,7 @@ def mark_type(self): def mark_type(self, mark_type): """Sets the mark_type of this Contract. - Mark price type, internal - based on internal trading, index - based on external index price # noqa: E501 + Mark price type: internal - internal trading price, index - external index price # noqa: E501 :param mark_type: The mark_type of this Contract. # noqa: E501 :type: str @@ -409,9 +415,8 @@ def mark_type(self, mark_type): allowed_values = ["internal", "index"] # noqa: E501 if self.local_vars_configuration.client_side_validation and mark_type not in allowed_values: # noqa: E501 raise ValueError( - "Invalid value for `mark_type` ({0}), must be one of {1}".format( # noqa: E501 - mark_type, allowed_values - ) + "Invalid value for `mark_type` ({0}), must be one of {1}" # noqa: E501 + .format(mark_type, allowed_values) ) self._mark_type = mark_type @@ -489,7 +494,7 @@ def last_price(self, last_price): def maker_fee_rate(self): """Gets the maker_fee_rate of this Contract. # noqa: E501 - Maker fee rate, where negative means rebate # noqa: E501 + Maker fee rate, negative values indicate rebates # noqa: E501 :return: The maker_fee_rate of this Contract. # noqa: E501 :rtype: str @@ -500,7 +505,7 @@ def maker_fee_rate(self): def maker_fee_rate(self, maker_fee_rate): """Sets the maker_fee_rate of this Contract. - Maker fee rate, where negative means rebate # noqa: E501 + Maker fee rate, negative values indicate rebates # noqa: E501 :param maker_fee_rate: The maker_fee_rate of this Contract. # noqa: E501 :type: str @@ -650,7 +655,7 @@ def funding_next_apply(self, funding_next_apply): def risk_limit_base(self): """Gets the risk_limit_base of this Contract. # noqa: E501 - Risk limit base # noqa: E501 + Base risk limit (deprecated) # noqa: E501 :return: The risk_limit_base of this Contract. # noqa: E501 :rtype: str @@ -661,7 +666,7 @@ def risk_limit_base(self): def risk_limit_base(self, risk_limit_base): """Sets the risk_limit_base of this Contract. - Risk limit base # noqa: E501 + Base risk limit (deprecated) # noqa: E501 :param risk_limit_base: The risk_limit_base of this Contract. # noqa: E501 :type: str @@ -673,7 +678,7 @@ def risk_limit_base(self, risk_limit_base): def risk_limit_step(self): """Gets the risk_limit_step of this Contract. # noqa: E501 - Step of adjusting risk limit # noqa: E501 + Risk limit adjustment step (deprecated) # noqa: E501 :return: The risk_limit_step of this Contract. # noqa: E501 :rtype: str @@ -684,7 +689,7 @@ def risk_limit_step(self): def risk_limit_step(self, risk_limit_step): """Sets the risk_limit_step of this Contract. - Step of adjusting risk limit # noqa: E501 + Risk limit adjustment step (deprecated) # noqa: E501 :param risk_limit_step: The risk_limit_step of this Contract. # noqa: E501 :type: str @@ -696,7 +701,7 @@ def risk_limit_step(self, risk_limit_step): def risk_limit_max(self): """Gets the risk_limit_max of this Contract. # noqa: E501 - Maximum risk limit the contract allowed # noqa: E501 + Maximum risk limit allowed by the contract (deprecated). It is recommended to use /futures/{settle}/risk_limit_tiers to query risk limits # noqa: E501 :return: The risk_limit_max of this Contract. # noqa: E501 :rtype: str @@ -707,7 +712,7 @@ def risk_limit_max(self): def risk_limit_max(self, risk_limit_max): """Sets the risk_limit_max of this Contract. - Maximum risk limit the contract allowed # noqa: E501 + Maximum risk limit allowed by the contract (deprecated). It is recommended to use /futures/{settle}/risk_limit_tiers to query risk limits # noqa: E501 :param risk_limit_max: The risk_limit_max of this Contract. # noqa: E501 :type: str @@ -719,7 +724,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 the contract allowed # noqa: E501 + Minimum order size allowed by the contract # noqa: E501 :return: The order_size_min of this Contract. # noqa: E501 :rtype: int @@ -730,7 +735,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 the contract allowed # noqa: E501 + Minimum order size allowed by the contract # noqa: E501 :param order_size_min: The order_size_min of this Contract. # noqa: E501 :type: int @@ -742,7 +747,7 @@ def order_size_min(self, order_size_min): def order_size_max(self): """Gets the order_size_max of this Contract. # noqa: E501 - Maximum order size the contract allowed # noqa: E501 + Maximum order size allowed by the contract # noqa: E501 :return: The order_size_max of this Contract. # noqa: E501 :rtype: int @@ -753,7 +758,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 the contract allowed # noqa: E501 + Maximum order size allowed by the contract # noqa: E501 :param order_size_max: The order_size_max of this Contract. # noqa: E501 :type: int @@ -765,7 +770,7 @@ def order_size_max(self, order_size_max): def order_price_deviate(self): """Gets the order_price_deviate of this Contract. # noqa: E501 - deviation between order price and current index price. If price of an order is denoted as order_price, it must meet the following condition: abs(order_price - mark_price) <= mark_price * order_price_deviate # noqa: E501 + 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 # noqa: E501 :return: The order_price_deviate of this Contract. # noqa: E501 :rtype: str @@ -776,7 +781,7 @@ def order_price_deviate(self): def order_price_deviate(self, order_price_deviate): """Sets the order_price_deviate of this Contract. - deviation between order price and current index price. If price of an order is denoted as order_price, it must meet the following condition: abs(order_price - mark_price) <= mark_price * order_price_deviate # noqa: E501 + 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 # noqa: E501 :param order_price_deviate: The order_price_deviate of this Contract. # noqa: E501 :type: str @@ -788,7 +793,7 @@ def order_price_deviate(self, order_price_deviate): def ref_discount_rate(self): """Gets the ref_discount_rate of this Contract. # noqa: E501 - Referral fee rate discount # noqa: E501 + Trading fee discount for referred users # noqa: E501 :return: The ref_discount_rate of this Contract. # noqa: E501 :rtype: str @@ -799,7 +804,7 @@ def ref_discount_rate(self): def ref_discount_rate(self, ref_discount_rate): """Sets the ref_discount_rate of this Contract. - Referral fee rate discount # noqa: E501 + Trading fee discount for referred users # noqa: E501 :param ref_discount_rate: The ref_discount_rate of this Contract. # noqa: E501 :type: str @@ -811,7 +816,7 @@ def ref_discount_rate(self, ref_discount_rate): def ref_rebate_rate(self): """Gets the ref_rebate_rate of this Contract. # noqa: E501 - Referrer commission rate # noqa: E501 + Commission rate for referrers # noqa: E501 :return: The ref_rebate_rate of this Contract. # noqa: E501 :rtype: str @@ -822,7 +827,7 @@ def ref_rebate_rate(self): def ref_rebate_rate(self, ref_rebate_rate): """Sets the ref_rebate_rate of this Contract. - Referrer commission rate # noqa: E501 + Commission rate for referrers # noqa: E501 :param ref_rebate_rate: The ref_rebate_rate of this Contract. # noqa: E501 :type: str @@ -834,7 +839,7 @@ def ref_rebate_rate(self, ref_rebate_rate): def orderbook_id(self): """Gets the orderbook_id of this Contract. # noqa: E501 - Current orderbook ID # noqa: E501 + Orderbook update ID # noqa: E501 :return: The orderbook_id of this Contract. # noqa: E501 :rtype: int @@ -845,7 +850,7 @@ def orderbook_id(self): def orderbook_id(self, orderbook_id): """Sets the orderbook_id of this Contract. - Current orderbook ID # noqa: E501 + Orderbook update ID # noqa: E501 :param orderbook_id: The orderbook_id of this Contract. # noqa: E501 :type: int @@ -880,7 +885,7 @@ def trade_id(self, trade_id): def trade_size(self): """Gets the trade_size of this Contract. # noqa: E501 - Historical accumulated trade size # noqa: E501 + Historical cumulative trading volume # noqa: E501 :return: The trade_size of this Contract. # noqa: E501 :rtype: int @@ -891,7 +896,7 @@ def trade_size(self): def trade_size(self, trade_size): """Sets the trade_size of this Contract. - Historical accumulated trade size # noqa: E501 + Historical cumulative trading volume # noqa: E501 :param trade_size: The trade_size of this Contract. # noqa: E501 :type: int @@ -926,7 +931,7 @@ def position_size(self, position_size): def config_change_time(self): """Gets the config_change_time of this Contract. # noqa: E501 - Last changed time of configuration # noqa: E501 + Last configuration update time # noqa: E501 :return: The config_change_time of this Contract. # noqa: E501 :rtype: float @@ -937,7 +942,7 @@ def config_change_time(self): def config_change_time(self, config_change_time): """Sets the config_change_time of this Contract. - Last changed time of configuration # noqa: E501 + Last configuration update time # noqa: E501 :param config_change_time: The config_change_time of this Contract. # noqa: E501 :type: float @@ -949,7 +954,7 @@ def config_change_time(self, config_change_time): def in_delisting(self): """Gets the in_delisting of this Contract. # noqa: E501 - Contract is delisting # noqa: E501 + `in_delisting=true` and position_size>0 indicates the contract is in delisting transition period `in_delisting=true` and position_size=0 indicates the contract is delisted # noqa: E501 :return: The in_delisting of this Contract. # noqa: E501 :rtype: bool @@ -960,7 +965,7 @@ def in_delisting(self): def in_delisting(self, in_delisting): """Sets the in_delisting of this Contract. - Contract is delisting # noqa: E501 + `in_delisting=true` and position_size>0 indicates the contract is in delisting transition period `in_delisting=true` and position_size=0 indicates the contract is delisted # noqa: E501 :param in_delisting: The in_delisting of this Contract. # noqa: E501 :type: bool @@ -972,7 +977,7 @@ def in_delisting(self, in_delisting): def orders_limit(self): """Gets the orders_limit of this Contract. # noqa: E501 - Maximum number of open orders # noqa: E501 + Maximum number of pending orders # noqa: E501 :return: The orders_limit of this Contract. # noqa: E501 :rtype: int @@ -983,7 +988,7 @@ def orders_limit(self): def orders_limit(self, orders_limit): """Sets the orders_limit of this Contract. - Maximum number of open orders # noqa: E501 + Maximum number of pending orders # noqa: E501 :param orders_limit: The orders_limit of this Contract. # noqa: E501 :type: int @@ -991,6 +996,190 @@ def orders_limit(self, orders_limit): self._orders_limit = orders_limit + @property + def enable_bonus(self): + """Gets the enable_bonus of this Contract. # noqa: E501 + + Whether bonus is enabled # noqa: E501 + + :return: The enable_bonus of this Contract. # noqa: E501 + :rtype: bool + """ + return self._enable_bonus + + @enable_bonus.setter + def enable_bonus(self, enable_bonus): + """Sets the enable_bonus of this Contract. + + Whether bonus is enabled # noqa: E501 + + :param enable_bonus: The enable_bonus of this Contract. # noqa: E501 + :type: bool + """ + + self._enable_bonus = enable_bonus + + @property + def enable_credit(self): + """Gets the enable_credit of this Contract. # noqa: E501 + + Whether portfolio margin account is enabled # noqa: E501 + + :return: The enable_credit of this Contract. # noqa: E501 + :rtype: bool + """ + return self._enable_credit + + @enable_credit.setter + def enable_credit(self, enable_credit): + """Sets the enable_credit of this Contract. + + Whether portfolio margin account is enabled # noqa: E501 + + :param enable_credit: The enable_credit of this Contract. # noqa: E501 + :type: bool + """ + + self._enable_credit = enable_credit + + @property + def create_time(self): + """Gets the create_time of this Contract. # noqa: E501 + + Created time of the contract # noqa: E501 + + :return: The create_time of this Contract. # noqa: E501 + :rtype: float + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this Contract. + + Created time of the contract # noqa: E501 + + :param create_time: The create_time of this Contract. # noqa: E501 + :type: float + """ + + self._create_time = create_time + + @property + def funding_cap_ratio(self): + """Gets the funding_cap_ratio of this Contract. # noqa: E501 + + The factor for the maximum of the funding rate. Maximum of funding rate = (1/market maximum leverage - maintenance margin rate) * funding_cap_ratio # noqa: E501 + + :return: The funding_cap_ratio of this Contract. # noqa: E501 + :rtype: str + """ + return self._funding_cap_ratio + + @funding_cap_ratio.setter + def funding_cap_ratio(self, funding_cap_ratio): + """Sets the funding_cap_ratio of this Contract. + + The factor for the maximum of the funding rate. Maximum of funding rate = (1/market maximum leverage - maintenance margin rate) * funding_cap_ratio # noqa: E501 + + :param funding_cap_ratio: The funding_cap_ratio of this Contract. # noqa: E501 + :type: str + """ + + self._funding_cap_ratio = funding_cap_ratio + + @property + def status(self): + """Gets the status of this Contract. # noqa: E501 + + Contract status types include: prelaunch (pre-launch), trading (active), delisting (delisting), delisted (delisted), circuit_breaker (circuit breaker) # noqa: E501 + + :return: The status of this Contract. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this Contract. + + Contract status types include: prelaunch (pre-launch), trading (active), delisting (delisting), delisted (delisted), circuit_breaker (circuit breaker) # noqa: E501 + + :param status: The status of this Contract. # noqa: E501 + :type: str + """ + + self._status = status + + @property + def launch_time(self): + """Gets the launch_time of this Contract. # noqa: E501 + + Contract expiry timestamp # noqa: E501 + + :return: The launch_time of this Contract. # noqa: E501 + :rtype: int + """ + return self._launch_time + + @launch_time.setter + def launch_time(self, launch_time): + """Sets the launch_time of this Contract. + + Contract expiry timestamp # noqa: E501 + + :param launch_time: The launch_time of this Contract. # noqa: E501 + :type: int + """ + + self._launch_time = launch_time + + @property + def delisting_time(self): + """Gets the delisting_time of this Contract. # noqa: E501 + + Timestamp when contract enters reduce-only state # noqa: E501 + + :return: The delisting_time of this Contract. # noqa: E501 + :rtype: int + """ + return self._delisting_time + + @delisting_time.setter + def delisting_time(self, delisting_time): + """Sets the delisting_time of this Contract. + + Timestamp when contract enters reduce-only state # noqa: E501 + + :param delisting_time: The delisting_time of this Contract. # noqa: E501 + :type: int + """ + + self._delisting_time = delisting_time + + @property + def delisted_time(self): + """Gets the delisted_time of this Contract. # noqa: E501 + + Contract delisting time # noqa: E501 + + :return: The delisted_time of this Contract. # noqa: E501 + :rtype: int + """ + return self._delisted_time + + @delisted_time.setter + def delisted_time(self, delisted_time): + """Sets the delisted_time of this Contract. + + Contract delisting time # noqa: E501 + + :param delisted_time: The delisted_time of this Contract. # noqa: E501 + :type: int + """ + + self._delisted_time = delisted_time + def to_dict(self): """Returns the model properties as a dict""" result = {} @@ -998,16 +1187,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/contract_stat.py b/gate_api/models/contract_stat.py index c145b2b..cac370c 100644 --- a/gate_api/models/contract_stat.py +++ b/gate_api/models/contract_stat.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -46,6 +46,7 @@ class ContractStat(object): 'open_interest_usd': 'float', 'top_lsr_account': 'float', 'top_lsr_size': 'float', + 'mark_price': 'float' } attribute_map = { @@ -62,26 +63,11 @@ class ContractStat(object): 'open_interest_usd': 'open_interest_usd', 'top_lsr_account': 'top_lsr_account', 'top_lsr_size': 'top_lsr_size', + 'mark_price': 'mark_price' } - 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, - local_vars_configuration=None, - ): # noqa: E501 - # type: (int, float, float, int, float, float, int, float, float, int, float, float, 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, 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, int, float, float, int, float, float, int, float, float, float, float, Configuration) -> None """ContractStat - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -100,6 +86,7 @@ def __init__( self._open_interest_usd = None self._top_lsr_account = None self._top_lsr_size = None + self._mark_price = None self.discriminator = None if time is not None: @@ -128,6 +115,8 @@ def __init__( self.top_lsr_account = top_lsr_account if top_lsr_size is not None: self.top_lsr_size = top_lsr_size + if mark_price is not None: + self.mark_price = mark_price @property def time(self): @@ -156,7 +145,7 @@ def time(self, time): def lsr_taker(self): """Gets the lsr_taker of this ContractStat. # noqa: E501 - Long/short account number ratio # noqa: E501 + Long/short taker ratio # noqa: E501 :return: The lsr_taker of this ContractStat. # noqa: E501 :rtype: float @@ -167,7 +156,7 @@ def lsr_taker(self): def lsr_taker(self, lsr_taker): """Sets the lsr_taker of this ContractStat. - Long/short account number ratio # noqa: E501 + Long/short taker ratio # noqa: E501 :param lsr_taker: The lsr_taker of this ContractStat. # noqa: E501 :type: float @@ -179,7 +168,7 @@ def lsr_taker(self, lsr_taker): def lsr_account(self): """Gets the lsr_account of this ContractStat. # noqa: E501 - Long/short taker size ratio # noqa: E501 + Long/short position user ratio # noqa: E501 :return: The lsr_account of this ContractStat. # noqa: E501 :rtype: float @@ -190,7 +179,7 @@ def lsr_account(self): def lsr_account(self, lsr_account): """Sets the lsr_account of this ContractStat. - Long/short taker size ratio # noqa: E501 + Long/short position user ratio # noqa: E501 :param lsr_account: The lsr_account of this ContractStat. # noqa: E501 :type: float @@ -202,7 +191,7 @@ def lsr_account(self, lsr_account): def long_liq_size(self): """Gets the long_liq_size of this ContractStat. # noqa: E501 - Long liquidation size # noqa: E501 + Long liquidation size (contracts) # noqa: E501 :return: The long_liq_size of this ContractStat. # noqa: E501 :rtype: int @@ -213,7 +202,7 @@ def long_liq_size(self): def long_liq_size(self, long_liq_size): """Sets the long_liq_size of this ContractStat. - Long liquidation size # noqa: E501 + Long liquidation size (contracts) # noqa: E501 :param long_liq_size: The long_liq_size of this ContractStat. # noqa: E501 :type: int @@ -225,7 +214,7 @@ def long_liq_size(self, long_liq_size): def long_liq_amount(self): """Gets the long_liq_amount of this ContractStat. # noqa: E501 - Long liquidation amount(base currency) # noqa: E501 + Long liquidation amount (base currency) # noqa: E501 :return: The long_liq_amount of this ContractStat. # noqa: E501 :rtype: float @@ -236,7 +225,7 @@ def long_liq_amount(self): def long_liq_amount(self, long_liq_amount): """Sets the long_liq_amount of this ContractStat. - Long liquidation amount(base currency) # noqa: E501 + Long liquidation amount (base currency) # noqa: E501 :param long_liq_amount: The long_liq_amount of this ContractStat. # noqa: E501 :type: float @@ -248,7 +237,7 @@ def long_liq_amount(self, long_liq_amount): def long_liq_usd(self): """Gets the long_liq_usd of this ContractStat. # noqa: E501 - Long liquidation volume(quote currency) # noqa: E501 + Long liquidation volume (quote currency) # noqa: E501 :return: The long_liq_usd of this ContractStat. # noqa: E501 :rtype: float @@ -259,7 +248,7 @@ def long_liq_usd(self): def long_liq_usd(self, long_liq_usd): """Sets the long_liq_usd of this ContractStat. - Long liquidation volume(quote currency) # noqa: E501 + Long liquidation volume (quote currency) # noqa: E501 :param long_liq_usd: The long_liq_usd of this ContractStat. # noqa: E501 :type: float @@ -271,7 +260,7 @@ def long_liq_usd(self, long_liq_usd): def short_liq_size(self): """Gets the short_liq_size of this ContractStat. # noqa: E501 - Short liquidation size # noqa: E501 + Short liquidation size (contracts) # noqa: E501 :return: The short_liq_size of this ContractStat. # noqa: E501 :rtype: int @@ -282,7 +271,7 @@ def short_liq_size(self): def short_liq_size(self, short_liq_size): """Sets the short_liq_size of this ContractStat. - Short liquidation size # noqa: E501 + Short liquidation size (contracts) # noqa: E501 :param short_liq_size: The short_liq_size of this ContractStat. # noqa: E501 :type: int @@ -294,7 +283,7 @@ def short_liq_size(self, short_liq_size): def short_liq_amount(self): """Gets the short_liq_amount of this ContractStat. # noqa: E501 - Short liquidation amount(base currency) # noqa: E501 + Short liquidation amount (base currency) # noqa: E501 :return: The short_liq_amount of this ContractStat. # noqa: E501 :rtype: float @@ -305,7 +294,7 @@ def short_liq_amount(self): def short_liq_amount(self, short_liq_amount): """Sets the short_liq_amount of this ContractStat. - Short liquidation amount(base currency) # noqa: E501 + Short liquidation amount (base currency) # noqa: E501 :param short_liq_amount: The short_liq_amount of this ContractStat. # noqa: E501 :type: float @@ -317,7 +306,7 @@ def short_liq_amount(self, short_liq_amount): def short_liq_usd(self): """Gets the short_liq_usd of this ContractStat. # noqa: E501 - Short liquidation volume(quote currency) # noqa: E501 + Short liquidation volume (quote currency) # noqa: E501 :return: The short_liq_usd of this ContractStat. # noqa: E501 :rtype: float @@ -328,7 +317,7 @@ def short_liq_usd(self): def short_liq_usd(self, short_liq_usd): """Sets the short_liq_usd of this ContractStat. - Short liquidation volume(quote currency) # noqa: E501 + Short liquidation volume (quote currency) # noqa: E501 :param short_liq_usd: The short_liq_usd of this ContractStat. # noqa: E501 :type: float @@ -340,7 +329,7 @@ def short_liq_usd(self, short_liq_usd): def open_interest(self): """Gets the open_interest of this ContractStat. # noqa: E501 - Open interest size # noqa: E501 + Total open interest size (contracts) # noqa: E501 :return: The open_interest of this ContractStat. # noqa: E501 :rtype: int @@ -351,7 +340,7 @@ def open_interest(self): def open_interest(self, open_interest): """Sets the open_interest of this ContractStat. - Open interest size # noqa: E501 + Total open interest size (contracts) # noqa: E501 :param open_interest: The open_interest of this ContractStat. # noqa: E501 :type: int @@ -363,7 +352,7 @@ def open_interest(self, open_interest): def open_interest_usd(self): """Gets the open_interest_usd of this ContractStat. # noqa: E501 - Open interest volume(quote currency) # noqa: E501 + Total open interest volume (quote currency) # noqa: E501 :return: The open_interest_usd of this ContractStat. # noqa: E501 :rtype: float @@ -374,7 +363,7 @@ def open_interest_usd(self): def open_interest_usd(self, open_interest_usd): """Sets the open_interest_usd of this ContractStat. - Open interest volume(quote currency) # noqa: E501 + Total open interest volume (quote currency) # noqa: E501 :param open_interest_usd: The open_interest_usd of this ContractStat. # noqa: E501 :type: float @@ -428,6 +417,29 @@ def top_lsr_size(self, top_lsr_size): self._top_lsr_size = top_lsr_size + @property + def mark_price(self): + """Gets the mark_price of this ContractStat. # noqa: E501 + + Mark price # noqa: E501 + + :return: The mark_price of this ContractStat. # noqa: E501 + :rtype: float + """ + return self._mark_price + + @mark_price.setter + def mark_price(self, mark_price): + """Sets the mark_price of this ContractStat. + + Mark price # noqa: E501 + + :param mark_price: The mark_price of this ContractStat. # noqa: E501 + :type: float + """ + + self._mark_price = mark_price + def to_dict(self): """Returns the model properties as a dict""" result = {} @@ -435,16 +447,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/convert_small_balance.py b/gate_api/models/convert_small_balance.py new file mode 100644 index 0000000..dc47f37 --- /dev/null +++ b/gate_api/models/convert_small_balance.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 ConvertSmallBalance(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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': 'list[str]', + 'is_all': 'bool' + } + + attribute_map = { + 'currency': 'currency', + 'is_all': 'is_all' + } + + def __init__(self, currency=None, is_all=None, local_vars_configuration=None): # noqa: E501 + # type: (list[str], bool, Configuration) -> None + """ConvertSmallBalance - a 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._is_all = None + self.discriminator = None + + if currency is not None: + self.currency = currency + if is_all is not None: + self.is_all = is_all + + @property + def currency(self): + """Gets the currency of this ConvertSmallBalance. # noqa: E501 + + Currency to be converted # noqa: E501 + + :return: The currency of this ConvertSmallBalance. # noqa: E501 + :rtype: list[str] + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this ConvertSmallBalance. + + Currency to be converted # noqa: E501 + + :param currency: The currency of this ConvertSmallBalance. # noqa: E501 + :type: list[str] + """ + + self._currency = currency + + @property + def is_all(self): + """Gets the is_all of this ConvertSmallBalance. # noqa: E501 + + Whether to convert all # noqa: E501 + + :return: The is_all of this ConvertSmallBalance. # noqa: E501 + :rtype: bool + """ + return self._is_all + + @is_all.setter + def is_all(self, is_all): + """Sets the is_all of this ConvertSmallBalance. + + Whether to convert all # noqa: E501 + + :param is_all: The is_all of this ConvertSmallBalance. # noqa: E501 + :type: bool + """ + + self._is_all = is_all + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ConvertSmallBalance): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ConvertSmallBalance): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/countdown_cancel_all_futures_task.py b/gate_api/models/countdown_cancel_all_futures_task.py new file mode 100644 index 0000000..c927a3a --- /dev/null +++ b/gate_api/models/countdown_cancel_all_futures_task.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 CountdownCancelAllFuturesTask(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'timeout': 'int', + 'contract': 'str' + } + + attribute_map = { + 'timeout': 'timeout', + 'contract': 'contract' + } + + def __init__(self, timeout=None, contract=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, Configuration) -> None + """CountdownCancelAllFuturesTask - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._timeout = None + self._contract = None + self.discriminator = None + + self.timeout = timeout + if contract is not None: + self.contract = contract + + @property + def timeout(self): + """Gets the timeout of this CountdownCancelAllFuturesTask. # noqa: E501 + + Countdown time in seconds At least 5 seconds, 0 means cancel countdown # noqa: E501 + + :return: The timeout of this CountdownCancelAllFuturesTask. # noqa: E501 + :rtype: int + """ + return self._timeout + + @timeout.setter + def timeout(self, timeout): + """Sets the timeout of this CountdownCancelAllFuturesTask. + + Countdown time in seconds At least 5 seconds, 0 means cancel countdown # noqa: E501 + + :param timeout: The timeout of this CountdownCancelAllFuturesTask. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and timeout is None: # noqa: E501 + raise ValueError("Invalid value for `timeout`, must not be `None`") # noqa: E501 + + self._timeout = timeout + + @property + def contract(self): + """Gets the contract of this CountdownCancelAllFuturesTask. # noqa: E501 + + Futures contract # noqa: E501 + + :return: The contract of this CountdownCancelAllFuturesTask. # noqa: E501 + :rtype: str + """ + return self._contract + + @contract.setter + def contract(self, contract): + """Sets the contract of this CountdownCancelAllFuturesTask. + + Futures contract # noqa: E501 + + :param contract: The contract of this CountdownCancelAllFuturesTask. # noqa: E501 + :type: str + """ + + self._contract = contract + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CountdownCancelAllFuturesTask): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CountdownCancelAllFuturesTask): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/countdown_cancel_all_options_task.py b/gate_api/models/countdown_cancel_all_options_task.py new file mode 100644 index 0000000..b221659 --- /dev/null +++ b/gate_api/models/countdown_cancel_all_options_task.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 CountdownCancelAllOptionsTask(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'timeout': 'int', + 'contract': 'str', + 'underlying': 'str' + } + + attribute_map = { + 'timeout': 'timeout', + 'contract': 'contract', + 'underlying': 'underlying' + } + + def __init__(self, timeout=None, contract=None, underlying=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, str, Configuration) -> None + """CountdownCancelAllOptionsTask - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._timeout = None + self._contract = None + self._underlying = None + self.discriminator = None + + self.timeout = timeout + if contract is not None: + self.contract = contract + if underlying is not None: + self.underlying = underlying + + @property + def timeout(self): + """Gets the timeout of this CountdownCancelAllOptionsTask. # noqa: E501 + + Countdown time in seconds At least 5 seconds, 0 means cancel countdown # noqa: E501 + + :return: The timeout of this CountdownCancelAllOptionsTask. # noqa: E501 + :rtype: int + """ + return self._timeout + + @timeout.setter + def timeout(self, timeout): + """Sets the timeout of this CountdownCancelAllOptionsTask. + + Countdown time in seconds At least 5 seconds, 0 means cancel countdown # noqa: E501 + + :param timeout: The timeout of this CountdownCancelAllOptionsTask. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and timeout is None: # noqa: E501 + raise ValueError("Invalid value for `timeout`, must not be `None`") # noqa: E501 + + self._timeout = timeout + + @property + def contract(self): + """Gets the contract of this CountdownCancelAllOptionsTask. # noqa: E501 + + Options contract name # noqa: E501 + + :return: The contract of this CountdownCancelAllOptionsTask. # noqa: E501 + :rtype: str + """ + return self._contract + + @contract.setter + def contract(self, contract): + """Sets the contract of this CountdownCancelAllOptionsTask. + + Options contract name # noqa: E501 + + :param contract: The contract of this CountdownCancelAllOptionsTask. # noqa: E501 + :type: str + """ + + self._contract = contract + + @property + def underlying(self): + """Gets the underlying of this CountdownCancelAllOptionsTask. # noqa: E501 + + Underlying # noqa: E501 + + :return: The underlying of this CountdownCancelAllOptionsTask. # noqa: E501 + :rtype: str + """ + return self._underlying + + @underlying.setter + def underlying(self, underlying): + """Sets the underlying of this CountdownCancelAllOptionsTask. + + Underlying # noqa: E501 + + :param underlying: The underlying of this CountdownCancelAllOptionsTask. # noqa: E501 + :type: str + """ + + self._underlying = underlying + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CountdownCancelAllOptionsTask): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CountdownCancelAllOptionsTask): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/countdown_cancel_all_spot_task.py b/gate_api/models/countdown_cancel_all_spot_task.py new file mode 100644 index 0000000..2761477 --- /dev/null +++ b/gate_api/models/countdown_cancel_all_spot_task.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 CountdownCancelAllSpotTask(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'timeout': 'int', + 'currency_pair': 'str' + } + + attribute_map = { + 'timeout': 'timeout', + 'currency_pair': 'currency_pair' + } + + def __init__(self, timeout=None, currency_pair=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, Configuration) -> None + """CountdownCancelAllSpotTask - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._timeout = None + self._currency_pair = None + self.discriminator = None + + self.timeout = timeout + if currency_pair is not None: + self.currency_pair = currency_pair + + @property + def timeout(self): + """Gets the timeout of this CountdownCancelAllSpotTask. # noqa: E501 + + Countdown time in seconds At least 5 seconds, 0 means cancel countdown # noqa: E501 + + :return: The timeout of this CountdownCancelAllSpotTask. # noqa: E501 + :rtype: int + """ + return self._timeout + + @timeout.setter + def timeout(self, timeout): + """Sets the timeout of this CountdownCancelAllSpotTask. + + Countdown time in seconds At least 5 seconds, 0 means cancel countdown # noqa: E501 + + :param timeout: The timeout of this CountdownCancelAllSpotTask. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and timeout is None: # noqa: E501 + raise ValueError("Invalid value for `timeout`, must not be `None`") # noqa: E501 + + self._timeout = timeout + + @property + def currency_pair(self): + """Gets the currency_pair of this CountdownCancelAllSpotTask. # noqa: E501 + + Currency pair # noqa: E501 + + :return: The currency_pair of this CountdownCancelAllSpotTask. # noqa: E501 + :rtype: str + """ + return self._currency_pair + + @currency_pair.setter + def currency_pair(self, currency_pair): + """Sets the currency_pair of this CountdownCancelAllSpotTask. + + Currency pair # noqa: E501 + + :param currency_pair: The currency_pair of this CountdownCancelAllSpotTask. # 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, CountdownCancelAllSpotTask): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CountdownCancelAllSpotTask): + 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 new file mode 100644 index 0000000..f570586 --- /dev/null +++ b/gate_api/models/create_collateral_order.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 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_multi_collateral_order.py b/gate_api/models/create_multi_collateral_order.py new file mode 100644 index 0000000..b3cc035 --- /dev/null +++ b/gate_api/models/create_multi_collateral_order.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 CreateMultiCollateralOrder(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'order_type': 'str', + 'fixed_type': 'str', + 'fixed_rate': 'str', + 'auto_renew': 'bool', + 'auto_repay': 'bool', + 'borrow_currency': 'str', + 'borrow_amount': 'str', + 'collateral_currencies': 'list[CollateralCurrency]' + } + + attribute_map = { + 'order_id': 'order_id', + 'order_type': 'order_type', + 'fixed_type': 'fixed_type', + 'fixed_rate': 'fixed_rate', + 'auto_renew': 'auto_renew', + 'auto_repay': 'auto_repay', + 'borrow_currency': 'borrow_currency', + 'borrow_amount': 'borrow_amount', + 'collateral_currencies': 'collateral_currencies' + } + + def __init__(self, order_id=None, order_type=None, fixed_type=None, fixed_rate=None, auto_renew=None, auto_repay=None, borrow_currency=None, borrow_amount=None, collateral_currencies=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, bool, bool, str, str, list[CollateralCurrency], Configuration) -> None + """CreateMultiCollateralOrder - a 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._order_type = None + self._fixed_type = None + self._fixed_rate = None + self._auto_renew = None + self._auto_repay = None + self._borrow_currency = None + self._borrow_amount = None + self._collateral_currencies = None + self.discriminator = None + + if order_id is not None: + self.order_id = order_id + if order_type is not None: + self.order_type = order_type + if fixed_type is not None: + self.fixed_type = fixed_type + if fixed_rate is not None: + self.fixed_rate = fixed_rate + if auto_renew is not None: + self.auto_renew = auto_renew + if auto_repay is not None: + self.auto_repay = auto_repay + self.borrow_currency = borrow_currency + self.borrow_amount = borrow_amount + if collateral_currencies is not None: + self.collateral_currencies = collateral_currencies + + @property + def order_id(self): + """Gets the order_id of this CreateMultiCollateralOrder. # noqa: E501 + + Order ID # noqa: E501 + + :return: The order_id of this CreateMultiCollateralOrder. # noqa: E501 + :rtype: str + """ + return self._order_id + + @order_id.setter + def order_id(self, order_id): + """Sets the order_id of this CreateMultiCollateralOrder. + + Order ID # noqa: E501 + + :param order_id: The order_id of this CreateMultiCollateralOrder. # noqa: E501 + :type: str + """ + + self._order_id = order_id + + @property + def order_type(self): + """Gets the order_type of this CreateMultiCollateralOrder. # noqa: E501 + + current - current rate, fixed - fixed rate, defaults to current if not specified # noqa: E501 + + :return: The order_type of this CreateMultiCollateralOrder. # noqa: E501 + :rtype: str + """ + return self._order_type + + @order_type.setter + def order_type(self, order_type): + """Sets the order_type of this CreateMultiCollateralOrder. + + current - current rate, fixed - fixed rate, defaults to current if not specified # noqa: E501 + + :param order_type: The order_type of this CreateMultiCollateralOrder. # noqa: E501 + :type: str + """ + + self._order_type = order_type + + @property + def fixed_type(self): + """Gets the fixed_type of this CreateMultiCollateralOrder. # noqa: E501 + + Fixed interest rate lending period: 7d - 7 days, 30d - 30 days. Required for fixed rate # noqa: E501 + + :return: The fixed_type of this CreateMultiCollateralOrder. # noqa: E501 + :rtype: str + """ + return self._fixed_type + + @fixed_type.setter + def fixed_type(self, fixed_type): + """Sets the fixed_type of this CreateMultiCollateralOrder. + + Fixed interest rate lending period: 7d - 7 days, 30d - 30 days. Required for fixed rate # noqa: E501 + + :param fixed_type: The fixed_type of this CreateMultiCollateralOrder. # noqa: E501 + :type: str + """ + + self._fixed_type = fixed_type + + @property + def fixed_rate(self): + """Gets the fixed_rate of this CreateMultiCollateralOrder. # noqa: E501 + + Fixed interest rate, required for fixed rate # noqa: E501 + + :return: The fixed_rate of this CreateMultiCollateralOrder. # noqa: E501 + :rtype: str + """ + return self._fixed_rate + + @fixed_rate.setter + def fixed_rate(self, fixed_rate): + """Sets the fixed_rate of this CreateMultiCollateralOrder. + + Fixed interest rate, required for fixed rate # noqa: E501 + + :param fixed_rate: The fixed_rate of this CreateMultiCollateralOrder. # noqa: E501 + :type: str + """ + + self._fixed_rate = fixed_rate + + @property + def auto_renew(self): + """Gets the auto_renew of this CreateMultiCollateralOrder. # noqa: E501 + + Fixed interest rate, auto-renewal # noqa: E501 + + :return: The auto_renew of this CreateMultiCollateralOrder. # noqa: E501 + :rtype: bool + """ + return self._auto_renew + + @auto_renew.setter + def auto_renew(self, auto_renew): + """Sets the auto_renew of this CreateMultiCollateralOrder. + + Fixed interest rate, auto-renewal # noqa: E501 + + :param auto_renew: The auto_renew of this CreateMultiCollateralOrder. # noqa: E501 + :type: bool + """ + + self._auto_renew = auto_renew + + @property + def auto_repay(self): + """Gets the auto_repay of this CreateMultiCollateralOrder. # noqa: E501 + + Fixed interest rate, auto-repayment # noqa: E501 + + :return: The auto_repay of this CreateMultiCollateralOrder. # noqa: E501 + :rtype: bool + """ + return self._auto_repay + + @auto_repay.setter + def auto_repay(self, auto_repay): + """Sets the auto_repay of this CreateMultiCollateralOrder. + + Fixed interest rate, auto-repayment # noqa: E501 + + :param auto_repay: The auto_repay of this CreateMultiCollateralOrder. # noqa: E501 + :type: bool + """ + + self._auto_repay = auto_repay + + @property + def borrow_currency(self): + """Gets the borrow_currency of this CreateMultiCollateralOrder. # noqa: E501 + + Borrowed currency # noqa: E501 + + :return: The borrow_currency of this CreateMultiCollateralOrder. # noqa: E501 + :rtype: str + """ + return self._borrow_currency + + @borrow_currency.setter + def borrow_currency(self, borrow_currency): + """Sets the borrow_currency of this CreateMultiCollateralOrder. + + Borrowed currency # noqa: E501 + + :param borrow_currency: The borrow_currency of this CreateMultiCollateralOrder. # 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 + + @property + def borrow_amount(self): + """Gets the borrow_amount of this CreateMultiCollateralOrder. # noqa: E501 + + Borrowed amount # noqa: E501 + + :return: The borrow_amount of this CreateMultiCollateralOrder. # noqa: E501 + :rtype: str + """ + return self._borrow_amount + + @borrow_amount.setter + def borrow_amount(self, borrow_amount): + """Sets the borrow_amount of this CreateMultiCollateralOrder. + + Borrowed amount # noqa: E501 + + :param borrow_amount: The borrow_amount of this CreateMultiCollateralOrder. # 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 collateral_currencies(self): + """Gets the collateral_currencies of this CreateMultiCollateralOrder. # noqa: E501 + + Collateral currency and amount # noqa: E501 + + :return: The collateral_currencies of this CreateMultiCollateralOrder. # noqa: E501 + :rtype: list[CollateralCurrency] + """ + return self._collateral_currencies + + @collateral_currencies.setter + def collateral_currencies(self, collateral_currencies): + """Sets the collateral_currencies of this CreateMultiCollateralOrder. + + Collateral currency and amount # noqa: E501 + + :param collateral_currencies: The collateral_currencies of this CreateMultiCollateralOrder. # noqa: E501 + :type: list[CollateralCurrency] + """ + + self._collateral_currencies = collateral_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, CreateMultiCollateralOrder): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CreateMultiCollateralOrder): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/create_uni_lend.py b/gate_api/models/create_uni_lend.py new file mode 100644 index 0000000..ea40615 --- /dev/null +++ b/gate_api/models/create_uni_lend.py @@ -0,0 +1,216 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CreateUniLend(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'amount': 'str', + 'type': 'str', + 'min_rate': 'str' + } + + attribute_map = { + 'currency': 'currency', + 'amount': 'amount', + 'type': 'type', + 'min_rate': 'min_rate' + } + + def __init__(self, currency=None, amount=None, type=None, min_rate=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, Configuration) -> None + """CreateUniLend - a 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._type = None + self._min_rate = None + self.discriminator = None + + self.currency = currency + self.amount = amount + self.type = type + if min_rate is not None: + self.min_rate = min_rate + + @property + def currency(self): + """Gets the currency of this CreateUniLend. # noqa: E501 + + Currency name # noqa: E501 + + :return: The currency of this CreateUniLend. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this CreateUniLend. + + Currency name # noqa: E501 + + :param currency: The currency of this CreateUniLend. # 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 CreateUniLend. # noqa: E501 + + Amount to deposit into lending pool # noqa: E501 + + :return: The amount of this CreateUniLend. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this CreateUniLend. + + Amount to deposit into lending pool # noqa: E501 + + :param amount: The amount of this CreateUniLend. # 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 type(self): + """Gets the type of this CreateUniLend. # noqa: E501 + + Operation type: lend - Lend, redeem - Redeem # noqa: E501 + + :return: The type of this CreateUniLend. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this CreateUniLend. + + Operation type: lend - Lend, redeem - Redeem # noqa: E501 + + :param type: The type of this CreateUniLend. # 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 = ["lend", "redeem"] # 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 min_rate(self): + """Gets the min_rate of this CreateUniLend. # noqa: E501 + + Minimum interest rate. If set too high, lending may fail and no interest will be earned. Required for lending operations. # noqa: E501 + + :return: The min_rate of this CreateUniLend. # noqa: E501 + :rtype: str + """ + return self._min_rate + + @min_rate.setter + def min_rate(self, min_rate): + """Sets the min_rate of this CreateUniLend. + + Minimum interest rate. If set too high, lending may fail and no interest will be earned. Required for lending operations. # noqa: E501 + + :param min_rate: The min_rate of this CreateUniLend. # noqa: E501 + :type: str + """ + + self._min_rate = min_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, CreateUniLend): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CreateUniLend): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/create_uni_loan.py b/gate_api/models/create_uni_loan.py new file mode 100644 index 0000000..708db4a --- /dev/null +++ b/gate_api/models/create_uni_loan.py @@ -0,0 +1,245 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CreateUniLoan(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'type': 'str', + 'amount': 'str', + 'repaid_all': 'bool', + 'currency_pair': 'str' + } + + attribute_map = { + 'currency': 'currency', + 'type': 'type', + 'amount': 'amount', + 'repaid_all': 'repaid_all', + 'currency_pair': 'currency_pair' + } + + def __init__(self, currency=None, type=None, amount=None, repaid_all=None, currency_pair=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, bool, str, Configuration) -> None + """CreateUniLoan - a 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._type = None + self._amount = None + self._repaid_all = None + self._currency_pair = None + self.discriminator = None + + self.currency = currency + self.type = type + self.amount = amount + if repaid_all is not None: + self.repaid_all = repaid_all + self.currency_pair = currency_pair + + @property + def currency(self): + """Gets the currency of this CreateUniLoan. # noqa: E501 + + Currency # noqa: E501 + + :return: The currency of this CreateUniLoan. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this CreateUniLoan. + + Currency # noqa: E501 + + :param currency: The currency of this CreateUniLoan. # 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 type(self): + """Gets the type of this CreateUniLoan. # noqa: E501 + + Type: `borrow` - borrow, `repay` - repay # noqa: E501 + + :return: The type of this CreateUniLoan. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this CreateUniLoan. + + Type: `borrow` - borrow, `repay` - repay # noqa: E501 + + :param type: The type of this CreateUniLoan. # 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 = ["borrow", "repay"] # 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 amount(self): + """Gets the amount of this CreateUniLoan. # noqa: E501 + + Borrow or repayment amount # noqa: E501 + + :return: The amount of this CreateUniLoan. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this CreateUniLoan. + + Borrow or repayment amount # noqa: E501 + + :param amount: The amount of this CreateUniLoan. # 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 repaid_all(self): + """Gets the repaid_all of this CreateUniLoan. # noqa: E501 + + Full repayment. For repayment operations only. When `true`, overrides `amount` and repays the full amount # noqa: E501 + + :return: The repaid_all of this CreateUniLoan. # noqa: E501 + :rtype: bool + """ + return self._repaid_all + + @repaid_all.setter + def repaid_all(self, repaid_all): + """Sets the repaid_all of this CreateUniLoan. + + Full repayment. For repayment operations only. When `true`, overrides `amount` and repays the full amount # noqa: E501 + + :param repaid_all: The repaid_all of this CreateUniLoan. # noqa: E501 + :type: bool + """ + + self._repaid_all = repaid_all + + @property + def currency_pair(self): + """Gets the currency_pair of this CreateUniLoan. # noqa: E501 + + Currency pair # noqa: E501 + + :return: The currency_pair of this CreateUniLoan. # noqa: E501 + :rtype: str + """ + return self._currency_pair + + @currency_pair.setter + def currency_pair(self, currency_pair): + """Sets the currency_pair of this CreateUniLoan. + + Currency pair # noqa: E501 + + :param currency_pair: The currency_pair of this CreateUniLoan. # 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 + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CreateUniLoan): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CreateUniLoan): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/cross_margin_account.py b/gate_api/models/cross_margin_account.py deleted file mode 100644 index 3819ae1..0000000 --- a/gate_api/models/cross_margin_account.py +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - Gate API v4 - - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 - - Contact: support@mail.gate.io - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from gate_api.configuration import Configuration - - -class CrossMarginAccount(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - 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': 'int', - 'locked': 'bool', - 'balances': 'dict(str, CrossMarginBalance)', - 'total': 'str', - 'borrowed': 'str', - 'interest': 'str', - 'risk': 'str', - } - - attribute_map = { - 'user_id': 'user_id', - 'locked': 'locked', - 'balances': 'balances', - 'total': 'total', - 'borrowed': 'borrowed', - 'interest': 'interest', - 'risk': 'risk', - } - - def __init__( - self, - user_id=None, - locked=None, - balances=None, - total=None, - borrowed=None, - interest=None, - risk=None, - local_vars_configuration=None, - ): # noqa: E501 - # type: (int, bool, dict(str, CrossMarginBalance), str, str, str, str, Configuration) -> None - """CrossMarginAccount - a 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._locked = None - self._balances = None - self._total = None - self._borrowed = None - self._interest = None - self._risk = None - self.discriminator = None - - if user_id is not None: - self.user_id = user_id - if locked is not None: - self.locked = locked - if balances is not None: - self.balances = balances - if total is not None: - self.total = total - if borrowed is not None: - self.borrowed = borrowed - if interest is not None: - self.interest = interest - if risk is not None: - self.risk = risk - - @property - def user_id(self): - """Gets the user_id of this CrossMarginAccount. # noqa: E501 - - User ID # noqa: E501 - - :return: The user_id of this CrossMarginAccount. # noqa: E501 - :rtype: int - """ - return self._user_id - - @user_id.setter - def user_id(self, user_id): - """Sets the user_id of this CrossMarginAccount. - - User ID # noqa: E501 - - :param user_id: The user_id of this CrossMarginAccount. # noqa: E501 - :type: int - """ - - self._user_id = user_id - - @property - def locked(self): - """Gets the locked of this CrossMarginAccount. # noqa: E501 - - Whether account is locked # noqa: E501 - - :return: The locked of this CrossMarginAccount. # noqa: E501 - :rtype: bool - """ - return self._locked - - @locked.setter - def locked(self, locked): - """Sets the locked of this CrossMarginAccount. - - Whether account is locked # noqa: E501 - - :param locked: The locked of this CrossMarginAccount. # noqa: E501 - :type: bool - """ - - self._locked = locked - - @property - def balances(self): - """Gets the balances of this CrossMarginAccount. # noqa: E501 - - - :return: The balances of this CrossMarginAccount. # noqa: E501 - :rtype: dict(str, CrossMarginBalance) - """ - return self._balances - - @balances.setter - def balances(self, balances): - """Sets the balances of this CrossMarginAccount. - - - :param balances: The balances of this CrossMarginAccount. # noqa: E501 - :type: dict(str, CrossMarginBalance) - """ - - self._balances = balances - - @property - def total(self): - """Gets the total of this CrossMarginAccount. # noqa: E501 - - Total account value in USDT, i.e., the sum of all currencies' `(available+freeze)*price*discount` # noqa: E501 - - :return: The total of this CrossMarginAccount. # noqa: E501 - :rtype: str - """ - return self._total - - @total.setter - def total(self, total): - """Sets the total of this CrossMarginAccount. - - Total account value in USDT, i.e., the sum of all currencies' `(available+freeze)*price*discount` # noqa: E501 - - :param total: The total of this CrossMarginAccount. # noqa: E501 - :type: str - """ - - self._total = total - - @property - def borrowed(self): - """Gets the borrowed of this CrossMarginAccount. # noqa: E501 - - Total borrowed value in USDT, i.e., the sum of all currencies' `borrowed*price*discount` # noqa: E501 - - :return: The borrowed of this CrossMarginAccount. # noqa: E501 - :rtype: str - """ - return self._borrowed - - @borrowed.setter - def borrowed(self, borrowed): - """Sets the borrowed of this CrossMarginAccount. - - Total borrowed value in USDT, i.e., the sum of all currencies' `borrowed*price*discount` # noqa: E501 - - :param borrowed: The borrowed of this CrossMarginAccount. # noqa: E501 - :type: str - """ - - self._borrowed = borrowed - - @property - def interest(self): - """Gets the interest of this CrossMarginAccount. # noqa: E501 - - Total unpaid interests in USDT, i.e., the sum of all currencies' `interest*price*discount` # noqa: E501 - - :return: The interest of this CrossMarginAccount. # noqa: E501 - :rtype: str - """ - return self._interest - - @interest.setter - def interest(self, interest): - """Sets the interest of this CrossMarginAccount. - - Total unpaid interests in USDT, i.e., the sum of all currencies' `interest*price*discount` # noqa: E501 - - :param interest: The interest of this CrossMarginAccount. # noqa: E501 - :type: str - """ - - self._interest = interest - - @property - def risk(self): - """Gets the risk of this CrossMarginAccount. # noqa: E501 - - Risk rate. When it belows 110%, liquidation will be triggered. Calculation formula: `total / (borrowed+interest)` # noqa: E501 - - :return: The risk of this CrossMarginAccount. # noqa: E501 - :rtype: str - """ - return self._risk - - @risk.setter - def risk(self, risk): - """Sets the risk of this CrossMarginAccount. - - Risk rate. When it belows 110%, liquidation will be triggered. Calculation formula: `total / (borrowed+interest)` # noqa: E501 - - :param risk: The risk of this CrossMarginAccount. # noqa: E501 - :type: str - """ - - self._risk = risk - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, CrossMarginAccount): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, CrossMarginAccount): - return True - - return self.to_dict() != other.to_dict() diff --git a/gate_api/models/cross_margin_account_book.py b/gate_api/models/cross_margin_account_book.py deleted file mode 100644 index f783e3b..0000000 --- a/gate_api/models/cross_margin_account_book.py +++ /dev/null @@ -1,271 +0,0 @@ -# coding: utf-8 - -""" - Gate API v4 - - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 - - Contact: support@mail.gate.io - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from gate_api.configuration import Configuration - - -class CrossMarginAccountBook(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - 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', 'time': 'int', 'currency': 'str', 'change': 'str', 'balance': 'str', 'type': 'str'} - - attribute_map = { - 'id': 'id', - 'time': 'time', - 'currency': 'currency', - 'change': 'change', - 'balance': 'balance', - 'type': 'type', - } - - def __init__( - self, id=None, time=None, currency=None, change=None, balance=None, type=None, local_vars_configuration=None - ): # noqa: E501 - # type: (str, int, str, str, str, str, Configuration) -> None - """CrossMarginAccountBook - a 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._type = 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 - if type is not None: - self.type = type - - @property - def id(self): - """Gets the id of this CrossMarginAccountBook. # noqa: E501 - - Balance change record ID # noqa: E501 - - :return: The id of this CrossMarginAccountBook. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this CrossMarginAccountBook. - - Balance change record ID # noqa: E501 - - :param id: The id of this CrossMarginAccountBook. # noqa: E501 - :type: str - """ - - self._id = id - - @property - def time(self): - """Gets the time of this CrossMarginAccountBook. # noqa: E501 - - The timestamp of the change (in milliseconds) # noqa: E501 - - :return: The time of this CrossMarginAccountBook. # noqa: E501 - :rtype: int - """ - return self._time - - @time.setter - def time(self, time): - """Sets the time of this CrossMarginAccountBook. - - The timestamp of the change (in milliseconds) # noqa: E501 - - :param time: The time of this CrossMarginAccountBook. # noqa: E501 - :type: int - """ - - self._time = time - - @property - def currency(self): - """Gets the currency of this CrossMarginAccountBook. # noqa: E501 - - Currency changed # noqa: E501 - - :return: The currency of this CrossMarginAccountBook. # noqa: E501 - :rtype: str - """ - return self._currency - - @currency.setter - def currency(self, currency): - """Sets the currency of this CrossMarginAccountBook. - - Currency changed # noqa: E501 - - :param currency: The currency of this CrossMarginAccountBook. # noqa: E501 - :type: str - """ - - self._currency = currency - - @property - def change(self): - """Gets the change of this CrossMarginAccountBook. # noqa: E501 - - Amount changed. Positive value means transferring in, while negative out # noqa: E501 - - :return: The change of this CrossMarginAccountBook. # noqa: E501 - :rtype: str - """ - return self._change - - @change.setter - def change(self, change): - """Sets the change of this CrossMarginAccountBook. - - Amount changed. Positive value means transferring in, while negative out # noqa: E501 - - :param change: The change of this CrossMarginAccountBook. # noqa: E501 - :type: str - """ - - self._change = change - - @property - def balance(self): - """Gets the balance of this CrossMarginAccountBook. # noqa: E501 - - Balance after change # noqa: E501 - - :return: The balance of this CrossMarginAccountBook. # noqa: E501 - :rtype: str - """ - return self._balance - - @balance.setter - def balance(self, balance): - """Sets the balance of this CrossMarginAccountBook. - - Balance after change # noqa: E501 - - :param balance: The balance of this CrossMarginAccountBook. # noqa: E501 - :type: str - """ - - self._balance = balance - - @property - def type(self): - """Gets the type of this CrossMarginAccountBook. # noqa: E501 - - Account change type, including: - in: transferals into cross margin account - out: transferals out from cross margin account - repay: loan repayment - borrow: borrowed loan - new_order: new order locked - order_fill: order fills - referral_fee: fee refund from referrals - order_fee: order fee generated from fills - unknown: unknown type # noqa: E501 - - :return: The type of this CrossMarginAccountBook. # noqa: E501 - :rtype: str - """ - return self._type - - @type.setter - def type(self, type): - """Sets the type of this CrossMarginAccountBook. - - Account change type, including: - in: transferals into cross margin account - out: transferals out from cross margin account - repay: loan repayment - borrow: borrowed loan - new_order: new order locked - order_fill: order fills - referral_fee: fee refund from referrals - order_fee: order fee generated from fills - unknown: unknown type # noqa: E501 - - :param type: The type of this CrossMarginAccountBook. # noqa: E501 - :type: str - """ - allowed_values = [ - "in", - "out", - "repay", - "borrow", - "new_order", - "order_fill", - "referral_fee", - "order_fee", - "unknown", - ] # 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}".format(type, allowed_values) # 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, CrossMarginAccountBook): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, CrossMarginAccountBook): - return True - - return self.to_dict() != other.to_dict() diff --git a/gate_api/models/cross_margin_balance.py b/gate_api/models/cross_margin_balance.py index 904bb82..6b9d284 100644 --- a/gate_api/models/cross_margin_balance.py +++ b/gate_api/models/cross_margin_balance.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -32,13 +32,21 @@ class CrossMarginBalance(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {'available': 'str', 'freeze': 'str', 'borrowed': 'str', 'interest': 'str'} - - attribute_map = {'available': 'available', 'freeze': 'freeze', 'borrowed': 'borrowed', 'interest': 'interest'} - - def __init__( - self, available=None, freeze=None, borrowed=None, interest=None, local_vars_configuration=None - ): # noqa: E501 + openapi_types = { + 'available': 'str', + 'freeze': 'str', + 'borrowed': 'str', + 'interest': 'str' + } + + attribute_map = { + 'available': 'available', + 'freeze': 'freeze', + 'borrowed': 'borrowed', + 'interest': 'interest' + } + + def __init__(self, available=None, freeze=None, borrowed=None, interest=None, local_vars_configuration=None): # noqa: E501 # type: (str, str, str, str, Configuration) -> None """CrossMarginBalance - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: @@ -64,7 +72,7 @@ def __init__( def available(self): """Gets the available of this CrossMarginBalance. # noqa: E501 - Available amount # noqa: E501 + Available balance # noqa: E501 :return: The available of this CrossMarginBalance. # noqa: E501 :rtype: str @@ -75,7 +83,7 @@ def available(self): def available(self, available): """Sets the available of this CrossMarginBalance. - Available amount # noqa: E501 + Available balance # noqa: E501 :param available: The available of this CrossMarginBalance. # noqa: E501 :type: str @@ -87,7 +95,7 @@ def available(self, available): def freeze(self): """Gets the freeze of this CrossMarginBalance. # noqa: E501 - Locked amount # noqa: E501 + Locked balance # noqa: E501 :return: The freeze of this CrossMarginBalance. # noqa: E501 :rtype: str @@ -98,7 +106,7 @@ def freeze(self): def freeze(self, freeze): """Sets the freeze of this CrossMarginBalance. - Locked amount # noqa: E501 + Locked balance # noqa: E501 :param freeze: The freeze of this CrossMarginBalance. # noqa: E501 :type: str @@ -110,7 +118,7 @@ def freeze(self, freeze): def borrowed(self): """Gets the borrowed of this CrossMarginBalance. # noqa: E501 - Borrowed amount # noqa: E501 + Borrowed balance # noqa: E501 :return: The borrowed of this CrossMarginBalance. # noqa: E501 :rtype: str @@ -121,7 +129,7 @@ def borrowed(self): def borrowed(self, borrowed): """Sets the borrowed of this CrossMarginBalance. - Borrowed amount # noqa: E501 + Borrowed balance # noqa: E501 :param borrowed: The borrowed of this CrossMarginBalance. # noqa: E501 :type: str @@ -133,7 +141,7 @@ def borrowed(self, borrowed): def interest(self): """Gets the interest of this CrossMarginBalance. # noqa: E501 - Unpaid interests # noqa: E501 + Unpaid interest # noqa: E501 :return: The interest of this CrossMarginBalance. # noqa: E501 :rtype: str @@ -144,7 +152,7 @@ def interest(self): def interest(self, interest): """Sets the interest of this CrossMarginBalance. - Unpaid interests # noqa: E501 + Unpaid interest # noqa: E501 :param interest: The interest of this CrossMarginBalance. # noqa: E501 :type: str @@ -159,16 +167,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/cross_margin_currency.py b/gate_api/models/cross_margin_currency.py deleted file mode 100644 index 9c4d1fb..0000000 --- a/gate_api/models/cross_margin_currency.py +++ /dev/null @@ -1,328 +0,0 @@ -# coding: utf-8 - -""" - Gate API v4 - - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 - - Contact: support@mail.gate.io - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from gate_api.configuration import Configuration - - -class CrossMarginCurrency(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - 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', - 'rate': 'str', - 'prec': 'str', - 'discount': 'str', - 'min_borrow_amount': 'str', - 'user_max_borrow_amount': 'str', - 'total_max_borrow_amount': 'str', - 'price': 'str', - } - - attribute_map = { - 'name': 'name', - 'rate': 'rate', - 'prec': 'prec', - 'discount': 'discount', - 'min_borrow_amount': 'min_borrow_amount', - 'user_max_borrow_amount': 'user_max_borrow_amount', - 'total_max_borrow_amount': 'total_max_borrow_amount', - 'price': 'price', - } - - def __init__( - self, - name=None, - rate=None, - prec=None, - discount=None, - min_borrow_amount=None, - user_max_borrow_amount=None, - total_max_borrow_amount=None, - price=None, - local_vars_configuration=None, - ): # noqa: E501 - # type: (str, str, str, str, str, str, str, str, Configuration) -> None - """CrossMarginCurrency - a 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._rate = None - self._prec = None - self._discount = None - self._min_borrow_amount = None - self._user_max_borrow_amount = None - self._total_max_borrow_amount = None - self._price = None - self.discriminator = None - - if name is not None: - self.name = name - if rate is not None: - self.rate = rate - if prec is not None: - self.prec = prec - if discount is not None: - self.discount = discount - if min_borrow_amount is not None: - self.min_borrow_amount = min_borrow_amount - if user_max_borrow_amount is not None: - self.user_max_borrow_amount = user_max_borrow_amount - if total_max_borrow_amount is not None: - self.total_max_borrow_amount = total_max_borrow_amount - if price is not None: - self.price = price - - @property - def name(self): - """Gets the name of this CrossMarginCurrency. # noqa: E501 - - Currency name # noqa: E501 - - :return: The name of this CrossMarginCurrency. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this CrossMarginCurrency. - - Currency name # noqa: E501 - - :param name: The name of this CrossMarginCurrency. # noqa: E501 - :type: str - """ - - self._name = name - - @property - def rate(self): - """Gets the rate of this CrossMarginCurrency. # noqa: E501 - - Loan rate # noqa: E501 - - :return: The rate of this CrossMarginCurrency. # noqa: E501 - :rtype: str - """ - return self._rate - - @rate.setter - def rate(self, rate): - """Sets the rate of this CrossMarginCurrency. - - Loan rate # noqa: E501 - - :param rate: The rate of this CrossMarginCurrency. # noqa: E501 - :type: str - """ - - self._rate = rate - - @property - def prec(self): - """Gets the prec of this CrossMarginCurrency. # noqa: E501 - - Currency precision # noqa: E501 - - :return: The prec of this CrossMarginCurrency. # noqa: E501 - :rtype: str - """ - return self._prec - - @prec.setter - def prec(self, prec): - """Sets the prec of this CrossMarginCurrency. - - Currency precision # noqa: E501 - - :param prec: The prec of this CrossMarginCurrency. # noqa: E501 - :type: str - """ - - self._prec = prec - - @property - def discount(self): - """Gets the discount of this CrossMarginCurrency. # noqa: E501 - - Currency value discount, which is used in total value calculation # noqa: E501 - - :return: The discount of this CrossMarginCurrency. # noqa: E501 - :rtype: str - """ - return self._discount - - @discount.setter - def discount(self, discount): - """Sets the discount of this CrossMarginCurrency. - - Currency value discount, which is used in total value calculation # noqa: E501 - - :param discount: The discount of this CrossMarginCurrency. # noqa: E501 - :type: str - """ - - self._discount = discount - - @property - def min_borrow_amount(self): - """Gets the min_borrow_amount of this CrossMarginCurrency. # noqa: E501 - - Minimum currency borrow amount. Unit is currency itself # noqa: E501 - - :return: The min_borrow_amount of this CrossMarginCurrency. # 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 CrossMarginCurrency. - - Minimum currency borrow amount. Unit is currency itself # noqa: E501 - - :param min_borrow_amount: The min_borrow_amount of this CrossMarginCurrency. # noqa: E501 - :type: str - """ - - self._min_borrow_amount = min_borrow_amount - - @property - def user_max_borrow_amount(self): - """Gets the user_max_borrow_amount of this CrossMarginCurrency. # noqa: E501 - - Maximum borrow value allowed per user, in USDT # noqa: E501 - - :return: The user_max_borrow_amount of this CrossMarginCurrency. # noqa: E501 - :rtype: str - """ - return self._user_max_borrow_amount - - @user_max_borrow_amount.setter - def user_max_borrow_amount(self, user_max_borrow_amount): - """Sets the user_max_borrow_amount of this CrossMarginCurrency. - - Maximum borrow value allowed per user, in USDT # noqa: E501 - - :param user_max_borrow_amount: The user_max_borrow_amount of this CrossMarginCurrency. # noqa: E501 - :type: str - """ - - self._user_max_borrow_amount = user_max_borrow_amount - - @property - def total_max_borrow_amount(self): - """Gets the total_max_borrow_amount of this CrossMarginCurrency. # noqa: E501 - - Maximum borrow value allowed for this currency, in USDT # noqa: E501 - - :return: The total_max_borrow_amount of this CrossMarginCurrency. # noqa: E501 - :rtype: str - """ - return self._total_max_borrow_amount - - @total_max_borrow_amount.setter - def total_max_borrow_amount(self, total_max_borrow_amount): - """Sets the total_max_borrow_amount of this CrossMarginCurrency. - - Maximum borrow value allowed for this currency, in USDT # noqa: E501 - - :param total_max_borrow_amount: The total_max_borrow_amount of this CrossMarginCurrency. # noqa: E501 - :type: str - """ - - self._total_max_borrow_amount = total_max_borrow_amount - - @property - def price(self): - """Gets the price of this CrossMarginCurrency. # noqa: E501 - - Price change between this currency and USDT # noqa: E501 - - :return: The price of this CrossMarginCurrency. # noqa: E501 - :rtype: str - """ - return self._price - - @price.setter - def price(self, price): - """Sets the price of this CrossMarginCurrency. - - Price change between this currency and USDT # noqa: E501 - - :param price: The price of this CrossMarginCurrency. # 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, CrossMarginCurrency): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, CrossMarginCurrency): - return True - - return self.to_dict() != other.to_dict() diff --git a/gate_api/models/cross_margin_loan.py b/gate_api/models/cross_margin_loan.py index b6b1990..b085e67 100644 --- a/gate_api/models/cross_margin_loan.py +++ b/gate_api/models/cross_margin_loan.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -42,7 +42,7 @@ class CrossMarginLoan(object): 'status': 'int', 'repaid': 'str', 'repaid_interest': 'str', - 'unpaid_interest': 'str', + 'unpaid_interest': 'str' } attribute_map = { @@ -55,23 +55,10 @@ class CrossMarginLoan(object): 'status': 'status', 'repaid': 'repaid', 'repaid_interest': 'repaid_interest', - 'unpaid_interest': 'unpaid_interest', + 'unpaid_interest': 'unpaid_interest' } - def __init__( - self, - id=None, - create_time=None, - update_time=None, - currency=None, - amount=None, - text=None, - status=None, - repaid=None, - repaid_interest=None, - unpaid_interest=None, - local_vars_configuration=None, - ): # noqa: E501 + def __init__(self, id=None, create_time=None, update_time=None, currency=None, amount=None, text=None, status=None, repaid=None, repaid_interest=None, unpaid_interest=None, local_vars_configuration=None): # noqa: E501 # type: (str, int, int, str, str, str, int, str, str, str, Configuration) -> None """CrossMarginLoan - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: @@ -113,7 +100,7 @@ def __init__( def id(self): """Gets the id of this CrossMarginLoan. # noqa: E501 - Borrow loan ID # noqa: E501 + Loan record ID # noqa: E501 :return: The id of this CrossMarginLoan. # noqa: E501 :rtype: str @@ -124,7 +111,7 @@ def id(self): def id(self, id): """Sets the id of this CrossMarginLoan. - Borrow loan ID # noqa: E501 + Loan record ID # noqa: E501 :param id: The id of this CrossMarginLoan. # noqa: E501 :type: str @@ -255,7 +242,7 @@ def text(self, text): def status(self): """Gets the status of this CrossMarginLoan. # noqa: E501 - Borrow loan status, which includes: - 1: failed to borrow - 2: borrowed but not repaid - 3: repayment complete # noqa: E501 + Deprecated. Currently, all statuses have been set to 2. Borrow loan status, which includes: - 1: failed to borrow - 2: borrowed but not repaid - 3: repayment complete # noqa: E501 :return: The status of this CrossMarginLoan. # noqa: E501 :rtype: int @@ -266,7 +253,7 @@ def status(self): def status(self, status): """Sets the status of this CrossMarginLoan. - Borrow loan status, which includes: - 1: failed to borrow - 2: borrowed but not repaid - 3: repayment complete # noqa: E501 + Deprecated. Currently, all statuses have been set to 2. Borrow loan status, which includes: - 1: failed to borrow - 2: borrowed but not repaid - 3: repayment complete # noqa: E501 :param status: The status of this CrossMarginLoan. # noqa: E501 :type: int @@ -274,7 +261,8 @@ def status(self, status): allowed_values = [1, 2, 3] # 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}".format(status, allowed_values) # noqa: E501 + "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 + .format(status, allowed_values) ) self._status = status @@ -329,7 +317,7 @@ def repaid_interest(self, repaid_interest): def unpaid_interest(self): """Gets the unpaid_interest of this CrossMarginLoan. # noqa: E501 - Outstanding interest yet to be paid # noqa: E501 + Unpaid interest # noqa: E501 :return: The unpaid_interest of this CrossMarginLoan. # noqa: E501 :rtype: str @@ -340,7 +328,7 @@ def unpaid_interest(self): def unpaid_interest(self, unpaid_interest): """Sets the unpaid_interest of this CrossMarginLoan. - Outstanding interest yet to be paid # noqa: E501 + Unpaid interest # noqa: E501 :param unpaid_interest: The unpaid_interest of this CrossMarginLoan. # noqa: E501 :type: str @@ -355,16 +343,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/cross_margin_repayment.py b/gate_api/models/cross_margin_repayment.py index fa0d028..6e71d54 100644 --- a/gate_api/models/cross_margin_repayment.py +++ b/gate_api/models/cross_margin_repayment.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -39,6 +39,7 @@ class CrossMarginRepayment(object): 'currency': 'str', 'principal': 'str', 'interest': 'str', + 'repayment_type': 'str' } attribute_map = { @@ -48,19 +49,11 @@ class CrossMarginRepayment(object): 'currency': 'currency', 'principal': 'principal', 'interest': 'interest', + 'repayment_type': 'repayment_type' } - def __init__( - self, - id=None, - create_time=None, - loan_id=None, - currency=None, - principal=None, - interest=None, - local_vars_configuration=None, - ): # noqa: E501 - # type: (str, int, str, str, str, str, Configuration) -> None + def __init__(self, id=None, create_time=None, loan_id=None, currency=None, principal=None, interest=None, repayment_type=None, local_vars_configuration=None): # noqa: E501 + # type: (str, int, str, str, str, str, str, Configuration) -> None """CrossMarginRepayment - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -72,6 +65,7 @@ def __init__( self._currency = None self._principal = None self._interest = None + self._repayment_type = None self.discriminator = None if id is not None: @@ -86,6 +80,8 @@ def __init__( self.principal = principal if interest is not None: self.interest = interest + if repayment_type is not None: + self.repayment_type = repayment_type @property def id(self): @@ -137,7 +133,7 @@ def create_time(self, create_time): def loan_id(self): """Gets the loan_id of this CrossMarginRepayment. # noqa: E501 - Borrow loan ID # noqa: E501 + Loan record ID # noqa: E501 :return: The loan_id of this CrossMarginRepayment. # noqa: E501 :rtype: str @@ -148,7 +144,7 @@ def loan_id(self): def loan_id(self, loan_id): """Sets the loan_id of this CrossMarginRepayment. - Borrow loan ID # noqa: E501 + Loan record ID # noqa: E501 :param loan_id: The loan_id of this CrossMarginRepayment. # noqa: E501 :type: str @@ -225,6 +221,29 @@ def interest(self, interest): self._interest = interest + @property + def repayment_type(self): + """Gets the repayment_type of this CrossMarginRepayment. # noqa: E501 + + Repayment type: none - no repayment type, manual_repay - manual repayment, auto_repay - automatic repayment after cancellation # noqa: E501 + + :return: The repayment_type of this CrossMarginRepayment. # noqa: E501 + :rtype: str + """ + return self._repayment_type + + @repayment_type.setter + def repayment_type(self, repayment_type): + """Sets the repayment_type of this CrossMarginRepayment. + + Repayment type: none - no repayment type, manual_repay - manual repayment, auto_repay - automatic repayment after cancellation # noqa: E501 + + :param repayment_type: The repayment_type of this CrossMarginRepayment. # noqa: E501 + :type: str + """ + + self._repayment_type = repayment_type + def to_dict(self): """Returns the model properties as a dict""" result = {} @@ -232,16 +251,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/currency.py b/gate_api/models/currency.py index fc46b2b..14789cf 100644 --- a/gate_api/models/currency.py +++ b/gate_api/models/currency.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -34,48 +34,53 @@ class Currency(object): """ openapi_types = { 'currency': 'str', + 'name': 'str', 'delisted': 'bool', 'withdraw_disabled': 'bool', 'withdraw_delayed': 'bool', 'deposit_disabled': 'bool', 'trade_disabled': 'bool', + 'fixed_rate': 'str', + 'chain': 'str', + 'chains': 'list[SpotCurrencyChain]' } attribute_map = { 'currency': 'currency', + 'name': 'name', 'delisted': 'delisted', 'withdraw_disabled': 'withdraw_disabled', 'withdraw_delayed': 'withdraw_delayed', 'deposit_disabled': 'deposit_disabled', 'trade_disabled': 'trade_disabled', + 'fixed_rate': 'fixed_rate', + 'chain': 'chain', + 'chains': 'chains' } - def __init__( - self, - currency=None, - delisted=None, - withdraw_disabled=None, - withdraw_delayed=None, - deposit_disabled=None, - trade_disabled=None, - local_vars_configuration=None, - ): # noqa: E501 - # type: (str, bool, bool, bool, bool, bool, 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, local_vars_configuration=None): # noqa: E501 + # type: (str, str, bool, bool, bool, bool, bool, str, str, list[SpotCurrencyChain], Configuration) -> None """Currency - a 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._delisted = None self._withdraw_disabled = None self._withdraw_delayed = None self._deposit_disabled = None self._trade_disabled = None + self._fixed_rate = None + self._chain = None + self._chains = None self.discriminator = None if currency is not None: self.currency = currency + if name is not None: + self.name = name if delisted is not None: self.delisted = delisted if withdraw_disabled is not None: @@ -86,12 +91,18 @@ def __init__( self.deposit_disabled = deposit_disabled if trade_disabled is not None: self.trade_disabled = trade_disabled + if fixed_rate is not None: + self.fixed_rate = fixed_rate + if chain is not None: + self.chain = chain + if chains is not None: + self.chains = chains @property def currency(self): """Gets the currency of this Currency. # noqa: E501 - Currency name # noqa: E501 + Currency symbol # noqa: E501 :return: The currency of this Currency. # noqa: E501 :rtype: str @@ -102,7 +113,7 @@ def currency(self): def currency(self, currency): """Sets the currency of this Currency. - Currency name # noqa: E501 + Currency symbol # noqa: E501 :param currency: The currency of this Currency. # noqa: E501 :type: str @@ -110,6 +121,29 @@ def currency(self, currency): self._currency = currency + @property + def name(self): + """Gets the name of this Currency. # noqa: E501 + + Currency name # noqa: E501 + + :return: The name of this Currency. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this Currency. + + Currency name # noqa: E501 + + :param name: The name of this Currency. # noqa: E501 + :type: str + """ + + self._name = name + @property def delisted(self): """Gets the delisted of this Currency. # noqa: E501 @@ -137,7 +171,7 @@ def delisted(self, delisted): def withdraw_disabled(self): """Gets the withdraw_disabled of this Currency. # noqa: E501 - Whether currency's withdrawal is disabled # noqa: E501 + Whether currency's withdrawal is disabled (deprecated) # noqa: E501 :return: The withdraw_disabled of this Currency. # noqa: E501 :rtype: bool @@ -148,7 +182,7 @@ def withdraw_disabled(self): def withdraw_disabled(self, withdraw_disabled): """Sets the withdraw_disabled of this Currency. - Whether currency's withdrawal is disabled # noqa: E501 + Whether currency's withdrawal is disabled (deprecated) # noqa: E501 :param withdraw_disabled: The withdraw_disabled of this Currency. # noqa: E501 :type: bool @@ -160,7 +194,7 @@ def withdraw_disabled(self, withdraw_disabled): def withdraw_delayed(self): """Gets the withdraw_delayed of this Currency. # noqa: E501 - Whether currency's withdrawal is delayed # noqa: E501 + Whether currency's withdrawal is delayed (deprecated) # noqa: E501 :return: The withdraw_delayed of this Currency. # noqa: E501 :rtype: bool @@ -171,7 +205,7 @@ def withdraw_delayed(self): def withdraw_delayed(self, withdraw_delayed): """Sets the withdraw_delayed of this Currency. - Whether currency's withdrawal is delayed # noqa: E501 + Whether currency's withdrawal is delayed (deprecated) # noqa: E501 :param withdraw_delayed: The withdraw_delayed of this Currency. # noqa: E501 :type: bool @@ -183,7 +217,7 @@ def withdraw_delayed(self, withdraw_delayed): def deposit_disabled(self): """Gets the deposit_disabled of this Currency. # noqa: E501 - Whether currency's deposit is disabled # noqa: E501 + Whether currency's deposit is disabled (deprecated) # noqa: E501 :return: The deposit_disabled of this Currency. # noqa: E501 :rtype: bool @@ -194,7 +228,7 @@ def deposit_disabled(self): def deposit_disabled(self, deposit_disabled): """Sets the deposit_disabled of this Currency. - Whether currency's deposit is disabled # noqa: E501 + Whether currency's deposit is disabled (deprecated) # noqa: E501 :param deposit_disabled: The deposit_disabled of this Currency. # noqa: E501 :type: bool @@ -225,6 +259,75 @@ def trade_disabled(self, trade_disabled): self._trade_disabled = trade_disabled + @property + def fixed_rate(self): + """Gets the fixed_rate of this Currency. # noqa: E501 + + Fixed fee rate. Only for fixed rate currencies, not valid for normal currencies # noqa: E501 + + :return: The fixed_rate of this Currency. # noqa: E501 + :rtype: str + """ + return self._fixed_rate + + @fixed_rate.setter + def fixed_rate(self, fixed_rate): + """Sets the fixed_rate of this Currency. + + Fixed fee rate. Only for fixed rate currencies, not valid for normal currencies # noqa: E501 + + :param fixed_rate: The fixed_rate of this Currency. # noqa: E501 + :type: str + """ + + self._fixed_rate = fixed_rate + + @property + def chain(self): + """Gets the chain of this Currency. # noqa: E501 + + The main chain corresponding to the coin # noqa: E501 + + :return: The chain of this Currency. # noqa: E501 + :rtype: str + """ + return self._chain + + @chain.setter + def chain(self, chain): + """Sets the chain of this Currency. + + The main chain corresponding to the coin # noqa: E501 + + :param chain: The chain of this Currency. # noqa: E501 + :type: str + """ + + self._chain = chain + + @property + def chains(self): + """Gets the chains of this Currency. # noqa: E501 + + All links corresponding to coins # noqa: E501 + + :return: The chains of this Currency. # noqa: E501 + :rtype: list[SpotCurrencyChain] + """ + return self._chains + + @chains.setter + def chains(self, chains): + """Sets the chains of this Currency. + + All links corresponding to coins # noqa: E501 + + :param chains: The chains of this Currency. # noqa: E501 + :type: list[SpotCurrencyChain] + """ + + self._chains = chains + def to_dict(self): """Returns the model properties as a dict""" result = {} @@ -232,16 +335,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/currency_chain.py b/gate_api/models/currency_chain.py new file mode 100644 index 0000000..5feb14f --- /dev/null +++ b/gate_api/models/currency_chain.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 CurrencyChain(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'chain': 'str', + 'name_cn': 'str', + 'name_en': 'str', + 'contract_address': 'str', + 'is_disabled': 'int', + 'is_deposit_disabled': 'int', + 'is_withdraw_disabled': 'int', + 'decimal': 'str' + } + + attribute_map = { + 'chain': 'chain', + 'name_cn': 'name_cn', + 'name_en': 'name_en', + 'contract_address': 'contract_address', + 'is_disabled': 'is_disabled', + 'is_deposit_disabled': 'is_deposit_disabled', + 'is_withdraw_disabled': 'is_withdraw_disabled', + 'decimal': 'decimal' + } + + def __init__(self, chain=None, name_cn=None, name_en=None, contract_address=None, is_disabled=None, is_deposit_disabled=None, is_withdraw_disabled=None, decimal=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, int, int, int, str, Configuration) -> None + """CurrencyChain - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._chain = None + self._name_cn = None + self._name_en = None + self._contract_address = None + self._is_disabled = None + self._is_deposit_disabled = None + self._is_withdraw_disabled = None + self._decimal = None + self.discriminator = None + + if chain is not None: + self.chain = chain + if name_cn is not None: + self.name_cn = name_cn + if name_en is not None: + self.name_en = name_en + if contract_address is not None: + self.contract_address = contract_address + if is_disabled is not None: + self.is_disabled = is_disabled + if is_deposit_disabled is not None: + self.is_deposit_disabled = is_deposit_disabled + if is_withdraw_disabled is not None: + self.is_withdraw_disabled = is_withdraw_disabled + if decimal is not None: + self.decimal = decimal + + @property + def chain(self): + """Gets the chain of this CurrencyChain. # noqa: E501 + + Chain name # noqa: E501 + + :return: The chain of this CurrencyChain. # noqa: E501 + :rtype: str + """ + return self._chain + + @chain.setter + def chain(self, chain): + """Sets the chain of this CurrencyChain. + + Chain name # noqa: E501 + + :param chain: The chain of this CurrencyChain. # noqa: E501 + :type: str + """ + + self._chain = chain + + @property + def name_cn(self): + """Gets the name_cn of this CurrencyChain. # noqa: E501 + + Chain name in Chinese # noqa: E501 + + :return: The name_cn of this CurrencyChain. # noqa: E501 + :rtype: str + """ + return self._name_cn + + @name_cn.setter + def name_cn(self, name_cn): + """Sets the name_cn of this CurrencyChain. + + Chain name in Chinese # noqa: E501 + + :param name_cn: The name_cn of this CurrencyChain. # noqa: E501 + :type: str + """ + + self._name_cn = name_cn + + @property + def name_en(self): + """Gets the name_en of this CurrencyChain. # noqa: E501 + + Chain name in English # noqa: E501 + + :return: The name_en of this CurrencyChain. # noqa: E501 + :rtype: str + """ + return self._name_en + + @name_en.setter + def name_en(self, name_en): + """Sets the name_en of this CurrencyChain. + + Chain name in English # noqa: E501 + + :param name_en: The name_en of this CurrencyChain. # noqa: E501 + :type: str + """ + + self._name_en = name_en + + @property + def contract_address(self): + """Gets the contract_address of this CurrencyChain. # noqa: E501 + + Smart contract address for the currency; if no address is available, it will be an empty string # noqa: E501 + + :return: The contract_address of this CurrencyChain. # noqa: E501 + :rtype: str + """ + return self._contract_address + + @contract_address.setter + def contract_address(self, contract_address): + """Sets the contract_address of this CurrencyChain. + + Smart contract address for the currency; if no address is available, it will be an empty string # noqa: E501 + + :param contract_address: The contract_address of this CurrencyChain. # noqa: E501 + :type: str + """ + + self._contract_address = contract_address + + @property + def is_disabled(self): + """Gets the is_disabled of this CurrencyChain. # noqa: E501 + + If it is disabled. 0 means NOT being disabled # noqa: E501 + + :return: The is_disabled of this CurrencyChain. # noqa: E501 + :rtype: int + """ + return self._is_disabled + + @is_disabled.setter + def is_disabled(self, is_disabled): + """Sets the is_disabled of this CurrencyChain. + + If it is disabled. 0 means NOT being disabled # noqa: E501 + + :param is_disabled: The is_disabled of this CurrencyChain. # noqa: E501 + :type: int + """ + + self._is_disabled = is_disabled + + @property + def is_deposit_disabled(self): + """Gets the is_deposit_disabled of this CurrencyChain. # noqa: E501 + + Is deposit disabled. 0 means not disabled # noqa: E501 + + :return: The is_deposit_disabled of this CurrencyChain. # noqa: E501 + :rtype: int + """ + return self._is_deposit_disabled + + @is_deposit_disabled.setter + def is_deposit_disabled(self, is_deposit_disabled): + """Sets the is_deposit_disabled of this CurrencyChain. + + Is deposit disabled. 0 means not disabled # noqa: E501 + + :param is_deposit_disabled: The is_deposit_disabled of this CurrencyChain. # noqa: E501 + :type: int + """ + + self._is_deposit_disabled = is_deposit_disabled + + @property + def is_withdraw_disabled(self): + """Gets the is_withdraw_disabled of this CurrencyChain. # noqa: E501 + + Is withdrawal disabled. 0 means not disabled # noqa: E501 + + :return: The is_withdraw_disabled of this CurrencyChain. # noqa: E501 + :rtype: int + """ + return self._is_withdraw_disabled + + @is_withdraw_disabled.setter + def is_withdraw_disabled(self, is_withdraw_disabled): + """Sets the is_withdraw_disabled of this CurrencyChain. + + Is withdrawal disabled. 0 means not disabled # noqa: E501 + + :param is_withdraw_disabled: The is_withdraw_disabled of this CurrencyChain. # noqa: E501 + :type: int + """ + + self._is_withdraw_disabled = is_withdraw_disabled + + @property + def decimal(self): + """Gets the decimal of this CurrencyChain. # noqa: E501 + + Withdrawal precision # noqa: E501 + + :return: The decimal of this CurrencyChain. # noqa: E501 + :rtype: str + """ + return self._decimal + + @decimal.setter + def decimal(self, decimal): + """Sets the decimal of this CurrencyChain. + + Withdrawal precision # noqa: E501 + + :param decimal: The decimal of this CurrencyChain. # noqa: E501 + :type: str + """ + + self._decimal = decimal + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CurrencyChain): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CurrencyChain): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/currency_pair.py b/gate_api/models/currency_pair.py index 09c8aed..26e7959 100644 --- a/gate_api/models/currency_pair.py +++ b/gate_api/models/currency_pair.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -35,47 +35,49 @@ class CurrencyPair(object): openapi_types = { 'id': 'str', 'base': 'str', + 'base_name': 'str', 'quote': 'str', + 'quote_name': 'str', 'fee': 'str', 'min_base_amount': 'str', 'min_quote_amount': 'str', + 'max_base_amount': 'str', + 'max_quote_amount': 'str', 'amount_precision': 'int', 'precision': 'int', 'trade_status': 'str', 'sell_start': 'int', 'buy_start': 'int', + 'delisting_time': 'int', + 'type': 'str', + 'trade_url': 'str', + 'st_tag': 'bool' } attribute_map = { 'id': 'id', 'base': 'base', + 'base_name': 'base_name', 'quote': 'quote', + 'quote_name': 'quote_name', 'fee': 'fee', 'min_base_amount': 'min_base_amount', 'min_quote_amount': 'min_quote_amount', + 'max_base_amount': 'max_base_amount', + 'max_quote_amount': 'max_quote_amount', 'amount_precision': 'amount_precision', 'precision': 'precision', 'trade_status': 'trade_status', 'sell_start': 'sell_start', 'buy_start': 'buy_start', + 'delisting_time': 'delisting_time', + 'type': 'type', + 'trade_url': 'trade_url', + 'st_tag': 'st_tag' } - def __init__( - self, - id=None, - base=None, - quote=None, - fee=None, - min_base_amount=None, - min_quote_amount=None, - amount_precision=None, - precision=None, - trade_status=None, - sell_start=None, - buy_start=None, - local_vars_configuration=None, - ): # noqa: E501 - # type: (str, str, str, str, str, str, int, int, str, int, int, Configuration) -> None + def __init__(self, id=None, base=None, base_name=None, quote=None, quote_name=None, fee=None, min_base_amount=None, min_quote_amount=None, max_base_amount=None, max_quote_amount=None, amount_precision=None, precision=None, trade_status=None, sell_start=None, buy_start=None, delisting_time=None, type=None, trade_url=None, st_tag=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, str, str, str, int, int, str, int, int, int, str, str, bool, Configuration) -> None """CurrencyPair - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -83,29 +85,45 @@ def __init__( self._id = None self._base = None + self._base_name = None self._quote = None + self._quote_name = None self._fee = None self._min_base_amount = None self._min_quote_amount = None + self._max_base_amount = None + self._max_quote_amount = None self._amount_precision = None self._precision = None self._trade_status = None self._sell_start = None self._buy_start = None + self._delisting_time = None + self._type = None + self._trade_url = None + self._st_tag = None self.discriminator = None if id is not None: self.id = id if base is not None: self.base = base + if base_name is not None: + self.base_name = base_name if quote is not None: self.quote = quote + if quote_name is not None: + self.quote_name = quote_name if fee is not None: self.fee = fee if min_base_amount is not None: self.min_base_amount = min_base_amount if min_quote_amount is not None: self.min_quote_amount = min_quote_amount + if max_base_amount is not None: + self.max_base_amount = max_base_amount + if max_quote_amount is not None: + self.max_quote_amount = max_quote_amount if amount_precision is not None: self.amount_precision = amount_precision if precision is not None: @@ -116,6 +134,14 @@ def __init__( self.sell_start = sell_start if buy_start is not None: self.buy_start = buy_start + if delisting_time is not None: + self.delisting_time = delisting_time + if type is not None: + self.type = type + if trade_url is not None: + self.trade_url = trade_url + if st_tag is not None: + self.st_tag = st_tag @property def id(self): @@ -163,6 +189,29 @@ def base(self, base): self._base = base + @property + def base_name(self): + """Gets the base_name of this CurrencyPair. # noqa: E501 + + Base currency name # noqa: E501 + + :return: The base_name of this CurrencyPair. # noqa: E501 + :rtype: str + """ + return self._base_name + + @base_name.setter + def base_name(self, base_name): + """Sets the base_name of this CurrencyPair. + + Base currency name # noqa: E501 + + :param base_name: The base_name of this CurrencyPair. # noqa: E501 + :type: str + """ + + self._base_name = base_name + @property def quote(self): """Gets the quote of this CurrencyPair. # noqa: E501 @@ -186,11 +235,34 @@ def quote(self, quote): self._quote = quote + @property + def quote_name(self): + """Gets the quote_name of this CurrencyPair. # noqa: E501 + + Quote currency name # noqa: E501 + + :return: The quote_name of this CurrencyPair. # noqa: E501 + :rtype: str + """ + return self._quote_name + + @quote_name.setter + def quote_name(self, quote_name): + """Sets the quote_name of this CurrencyPair. + + Quote currency name # noqa: E501 + + :param quote_name: The quote_name of this CurrencyPair. # noqa: E501 + :type: str + """ + + self._quote_name = quote_name + @property def fee(self): """Gets the fee of this CurrencyPair. # noqa: E501 - Trading fee # noqa: E501 + Trading fee rate # noqa: E501 :return: The fee of this CurrencyPair. # noqa: E501 :rtype: str @@ -201,7 +273,7 @@ def fee(self): def fee(self, fee): """Sets the fee of this CurrencyPair. - Trading fee # noqa: E501 + Trading fee rate # noqa: E501 :param fee: The fee of this CurrencyPair. # noqa: E501 :type: str @@ -255,6 +327,52 @@ def min_quote_amount(self, min_quote_amount): self._min_quote_amount = min_quote_amount + @property + def max_base_amount(self): + """Gets the max_base_amount of this CurrencyPair. # noqa: E501 + + Maximum amount of base currency to trade, `null` means no limit # noqa: E501 + + :return: The max_base_amount of this CurrencyPair. # noqa: E501 + :rtype: str + """ + return self._max_base_amount + + @max_base_amount.setter + def max_base_amount(self, max_base_amount): + """Sets the max_base_amount of this CurrencyPair. + + Maximum amount of base currency to trade, `null` means no limit # noqa: E501 + + :param max_base_amount: The max_base_amount of this CurrencyPair. # noqa: E501 + :type: str + """ + + self._max_base_amount = max_base_amount + + @property + def max_quote_amount(self): + """Gets the max_quote_amount of this CurrencyPair. # noqa: E501 + + Maximum amount of quote currency to trade, `null` means no limit # noqa: E501 + + :return: The max_quote_amount of this CurrencyPair. # noqa: E501 + :rtype: str + """ + return self._max_quote_amount + + @max_quote_amount.setter + def max_quote_amount(self, max_quote_amount): + """Sets the max_quote_amount of this CurrencyPair. + + Maximum amount of quote currency to trade, `null` means no limit # noqa: E501 + + :param max_quote_amount: The max_quote_amount of this CurrencyPair. # noqa: E501 + :type: str + """ + + self._max_quote_amount = max_quote_amount + @property def amount_precision(self): """Gets the amount_precision of this CurrencyPair. # noqa: E501 @@ -305,7 +423,7 @@ def precision(self, precision): def trade_status(self): """Gets the trade_status of this CurrencyPair. # noqa: E501 - How currency pair can be traded - untradable: cannot be bought or sold - buyable: can be bought - sellable: can be sold - tradable: can be bought or sold # noqa: E501 + Trading status - untradable: cannot be traded - buyable: can be bought - sellable: can be sold - tradable: can be bought and sold # noqa: E501 :return: The trade_status of this CurrencyPair. # noqa: E501 :rtype: str @@ -316,7 +434,7 @@ def trade_status(self): def trade_status(self, trade_status): """Sets the trade_status of this CurrencyPair. - How currency pair can be traded - untradable: cannot be bought or sold - buyable: can be bought - sellable: can be sold - tradable: can be bought or sold # noqa: E501 + Trading status - untradable: cannot be traded - buyable: can be bought - sellable: can be sold - tradable: can be bought and sold # noqa: E501 :param trade_status: The trade_status of this CurrencyPair. # noqa: E501 :type: str @@ -324,9 +442,8 @@ def trade_status(self, trade_status): allowed_values = ["untradable", "buyable", "sellable", "tradable"] # 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}".format( # noqa: E501 - trade_status, allowed_values - ) + "Invalid value for `trade_status` ({0}), must be one of {1}" # noqa: E501 + .format(trade_status, allowed_values) ) self._trade_status = trade_status @@ -377,6 +494,98 @@ def buy_start(self, buy_start): self._buy_start = buy_start + @property + def delisting_time(self): + """Gets the delisting_time of this CurrencyPair. # noqa: E501 + + Expected time to remove the shelves, Unix timestamp in seconds # noqa: E501 + + :return: The delisting_time of this CurrencyPair. # noqa: E501 + :rtype: int + """ + return self._delisting_time + + @delisting_time.setter + def delisting_time(self, delisting_time): + """Sets the delisting_time of this CurrencyPair. + + Expected time to remove the shelves, Unix timestamp in seconds # noqa: E501 + + :param delisting_time: The delisting_time of this CurrencyPair. # noqa: E501 + :type: int + """ + + self._delisting_time = delisting_time + + @property + def type(self): + """Gets the type of this CurrencyPair. # noqa: E501 + + Trading pair type, normal: normal, premarket: pre-market # noqa: E501 + + :return: The type of this CurrencyPair. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this CurrencyPair. + + Trading pair type, normal: normal, premarket: pre-market # noqa: E501 + + :param type: The type of this CurrencyPair. # noqa: E501 + :type: str + """ + + self._type = type + + @property + def trade_url(self): + """Gets the trade_url of this CurrencyPair. # noqa: E501 + + Transaction link # noqa: E501 + + :return: The trade_url of this CurrencyPair. # noqa: E501 + :rtype: str + """ + return self._trade_url + + @trade_url.setter + def trade_url(self, trade_url): + """Sets the trade_url of this CurrencyPair. + + Transaction link # noqa: E501 + + :param trade_url: The trade_url of this CurrencyPair. # noqa: E501 + :type: str + """ + + self._trade_url = trade_url + + @property + def st_tag(self): + """Gets the st_tag of this CurrencyPair. # noqa: E501 + + Whether the trading pair is in ST risk assessment, false - No, true - Yes # noqa: E501 + + :return: The st_tag of this CurrencyPair. # noqa: E501 + :rtype: bool + """ + return self._st_tag + + @st_tag.setter + def st_tag(self, st_tag): + """Sets the st_tag of this CurrencyPair. + + Whether the trading pair is in ST risk assessment, false - No, true - Yes # noqa: E501 + + :param st_tag: The st_tag of this CurrencyPair. # noqa: E501 + :type: bool + """ + + self._st_tag = st_tag + def to_dict(self): """Returns the model properties as a dict""" result = {} @@ -384,16 +593,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/currency_quota.py b/gate_api/models/currency_quota.py new file mode 100644 index 0000000..3ebee02 --- /dev/null +++ b/gate_api/models/currency_quota.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 CurrencyQuota(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'index_price': 'str', + 'min_quota': 'str', + 'left_quota': 'str', + 'left_quote_usdt': 'str' + } + + attribute_map = { + 'currency': 'currency', + 'index_price': 'index_price', + 'min_quota': 'min_quota', + 'left_quota': 'left_quota', + 'left_quote_usdt': 'left_quote_usdt' + } + + 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 + """CurrencyQuota - a 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._index_price = None + self._min_quota = None + self._left_quota = None + self._left_quote_usdt = None + self.discriminator = None + + if currency is not None: + self.currency = currency + if index_price is not None: + self.index_price = index_price + if min_quota is not None: + self.min_quota = min_quota + if left_quota is not None: + self.left_quota = left_quota + if left_quote_usdt is not None: + self.left_quote_usdt = left_quote_usdt + + @property + def currency(self): + """Gets the currency of this CurrencyQuota. # noqa: E501 + + Currency # noqa: E501 + + :return: The currency of this CurrencyQuota. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this CurrencyQuota. + + Currency # noqa: E501 + + :param currency: The currency of this CurrencyQuota. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def index_price(self): + """Gets the index_price of this CurrencyQuota. # noqa: E501 + + Currency Index Price # noqa: E501 + + :return: The index_price of this CurrencyQuota. # noqa: E501 + :rtype: str + """ + return self._index_price + + @index_price.setter + def index_price(self, index_price): + """Sets the index_price of this CurrencyQuota. + + Currency Index Price # noqa: E501 + + :param index_price: The index_price of this CurrencyQuota. # noqa: E501 + :type: str + """ + + self._index_price = index_price + + @property + def min_quota(self): + """Gets the min_quota of this CurrencyQuota. # noqa: E501 + + Minimum borrowing/collateral limit for the currency # noqa: E501 + + :return: The min_quota of this CurrencyQuota. # noqa: E501 + :rtype: str + """ + return self._min_quota + + @min_quota.setter + def min_quota(self, min_quota): + """Sets the min_quota of this CurrencyQuota. + + Minimum borrowing/collateral limit for the currency # noqa: E501 + + :param min_quota: The min_quota of this CurrencyQuota. # noqa: E501 + :type: str + """ + + self._min_quota = min_quota + + @property + def left_quota(self): + """Gets the left_quota of this CurrencyQuota. # noqa: E501 + + Remaining borrowing/collateral quota for the currency # noqa: E501 + + :return: The left_quota of this CurrencyQuota. # noqa: E501 + :rtype: str + """ + return self._left_quota + + @left_quota.setter + def left_quota(self, left_quota): + """Sets the left_quota of this CurrencyQuota. + + Remaining borrowing/collateral quota for the currency # noqa: E501 + + :param left_quota: The left_quota of this CurrencyQuota. # noqa: E501 + :type: str + """ + + self._left_quota = left_quota + + @property + def left_quote_usdt(self): + """Gets the left_quote_usdt of this CurrencyQuota. # noqa: E501 + + Remaining currency limit converted to USDT # noqa: E501 + + :return: The left_quote_usdt of this CurrencyQuota. # noqa: E501 + :rtype: str + """ + return self._left_quote_usdt + + @left_quote_usdt.setter + def left_quote_usdt(self, left_quote_usdt): + """Sets the left_quote_usdt of this CurrencyQuota. + + Remaining currency limit converted to USDT # noqa: E501 + + :param left_quote_usdt: The left_quote_usdt of this CurrencyQuota. # noqa: E501 + :type: str + """ + + self._left_quote_usdt = left_quote_usdt + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CurrencyQuota): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CurrencyQuota): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/debit_fee.py b/gate_api/models/debit_fee.py new file mode 100644 index 0000000..d563fe2 --- /dev/null +++ b/gate_api/models/debit_fee.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 DebitFee(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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 + """DebitFee - a 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 DebitFee. # noqa: E501 + + Whether GT fee deduction is enabled # noqa: E501 + + :return: The enabled of this DebitFee. # noqa: E501 + :rtype: bool + """ + return self._enabled + + @enabled.setter + def enabled(self, enabled): + """Sets the enabled of this DebitFee. + + Whether GT fee deduction is enabled # noqa: E501 + + :param enabled: The enabled of this DebitFee. # 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, DebitFee): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, DebitFee): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/delivery_candlestick.py b/gate_api/models/delivery_candlestick.py new file mode 100644 index 0000000..83355ce --- /dev/null +++ b/gate_api/models/delivery_candlestick.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 DeliveryCandlestick(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 't': 'float', + 'v': 'int', + 'c': 'str', + 'h': 'str', + 'l': 'str', + 'o': 'str' + } + + attribute_map = { + 't': 't', + 'v': 'v', + 'c': 'c', + 'h': 'h', + 'l': 'l', + 'o': 'o' + } + + def __init__(self, t=None, v=None, c=None, h=None, l=None, o=None, local_vars_configuration=None): # noqa: E501 + # type: (float, int, str, str, str, str, Configuration) -> None + """DeliveryCandlestick - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._t = None + self._v = None + self._c = None + self._h = None + self._l = None + self._o = None + self.discriminator = None + + if t is not None: + self.t = t + if v is not None: + self.v = v + 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 o is not None: + self.o = o + + @property + def t(self): + """Gets the t of this DeliveryCandlestick. # noqa: E501 + + Unix timestamp in seconds # noqa: E501 + + :return: The t of this DeliveryCandlestick. # noqa: E501 + :rtype: float + """ + return self._t + + @t.setter + def t(self, t): + """Sets the t of this DeliveryCandlestick. + + Unix timestamp in seconds # noqa: E501 + + :param t: The t of this DeliveryCandlestick. # noqa: E501 + :type: float + """ + + self._t = t + + @property + def v(self): + """Gets the v of this DeliveryCandlestick. # noqa: E501 + + size volume (contract size). Only returned if `contract` is not prefixed # noqa: E501 + + :return: The v of this DeliveryCandlestick. # noqa: E501 + :rtype: int + """ + return self._v + + @v.setter + def v(self, v): + """Sets the v of this DeliveryCandlestick. + + size volume (contract size). Only returned if `contract` is not prefixed # noqa: E501 + + :param v: The v of this DeliveryCandlestick. # noqa: E501 + :type: int + """ + + self._v = v + + @property + def c(self): + """Gets the c of this DeliveryCandlestick. # noqa: E501 + + Close price (quote currency) # noqa: E501 + + :return: The c of this DeliveryCandlestick. # noqa: E501 + :rtype: str + """ + return self._c + + @c.setter + def c(self, c): + """Sets the c of this DeliveryCandlestick. + + Close price (quote currency) # noqa: E501 + + :param c: The c of this DeliveryCandlestick. # noqa: E501 + :type: str + """ + + self._c = c + + @property + def h(self): + """Gets the h of this DeliveryCandlestick. # noqa: E501 + + Highest price (quote currency) # noqa: E501 + + :return: The h of this DeliveryCandlestick. # noqa: E501 + :rtype: str + """ + return self._h + + @h.setter + def h(self, h): + """Sets the h of this DeliveryCandlestick. + + Highest price (quote currency) # noqa: E501 + + :param h: The h of this DeliveryCandlestick. # noqa: E501 + :type: str + """ + + self._h = h + + @property + def l(self): + """Gets the l of this DeliveryCandlestick. # noqa: E501 + + Lowest price (quote currency) # noqa: E501 + + :return: The l of this DeliveryCandlestick. # noqa: E501 + :rtype: str + """ + return self._l + + @l.setter + def l(self, l): + """Sets the l of this DeliveryCandlestick. + + Lowest price (quote currency) # noqa: E501 + + :param l: The l of this DeliveryCandlestick. # noqa: E501 + :type: str + """ + + self._l = l + + @property + def o(self): + """Gets the o of this DeliveryCandlestick. # noqa: E501 + + Open price (quote currency) # noqa: E501 + + :return: The o of this DeliveryCandlestick. # noqa: E501 + :rtype: str + """ + return self._o + + @o.setter + def o(self, o): + """Sets the o of this DeliveryCandlestick. + + Open price (quote currency) # noqa: E501 + + :param o: The o of this DeliveryCandlestick. # noqa: E501 + :type: str + """ + + self._o = o + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DeliveryCandlestick): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, DeliveryCandlestick): + 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 648e4d6..57b228c 100644 --- a/gate_api/models/delivery_contract.py +++ b/gate_api/models/delivery_contract.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -70,7 +70,7 @@ class DeliveryContract(object): 'position_size': 'int', 'config_change_time': 'float', 'in_delisting': 'bool', - 'orders_limit': 'int', + 'orders_limit': 'int' } attribute_map = { @@ -111,51 +111,10 @@ class DeliveryContract(object): 'position_size': 'position_size', 'config_change_time': 'config_change_time', 'in_delisting': 'in_delisting', - 'orders_limit': 'orders_limit', + 'orders_limit': 'orders_limit' } - def __init__( - self, - name=None, - underlying=None, - cycle=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, - basis_rate=None, - basis_value=None, - basis_impact_value=None, - settle_price=None, - settle_price_interval=None, - settle_price_duration=None, - expire_time=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, - local_vars_configuration=None, - ): # noqa: E501 + def __init__(self, name=None, underlying=None, cycle=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, basis_rate=None, basis_value=None, basis_impact_value=None, settle_price=None, settle_price_interval=None, settle_price_duration=None, expire_time=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, 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, int, int, int, str, str, str, int, int, str, str, str, int, int, int, int, float, bool, int, Configuration) -> None """DeliveryContract - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: @@ -348,7 +307,8 @@ def cycle(self, cycle): allowed_values = ["WEEKLY", "BI-WEEKLY", "QUARTERLY", "BI-QUARTERLY"] # noqa: E501 if self.local_vars_configuration.client_side_validation and cycle not in allowed_values: # noqa: E501 raise ValueError( - "Invalid value for `cycle` ({0}), must be one of {1}".format(cycle, allowed_values) # noqa: E501 + "Invalid value for `cycle` ({0}), must be one of {1}" # noqa: E501 + .format(cycle, allowed_values) ) self._cycle = cycle @@ -357,7 +317,7 @@ def cycle(self, cycle): def type(self): """Gets the type of this DeliveryContract. # noqa: E501 - Futures contract type # noqa: E501 + Contract type: inverse - inverse contract, direct - direct contract # noqa: E501 :return: The type of this DeliveryContract. # noqa: E501 :rtype: str @@ -368,7 +328,7 @@ def type(self): def type(self, type): """Sets the type of this DeliveryContract. - Futures contract type # noqa: E501 + Contract type: inverse - inverse contract, direct - direct contract # noqa: E501 :param type: The type of this DeliveryContract. # noqa: E501 :type: str @@ -376,7 +336,8 @@ def type(self, type): allowed_values = ["inverse", "direct"] # 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}".format(type, allowed_values) # noqa: E501 + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) ) self._type = type @@ -477,7 +438,7 @@ def maintenance_rate(self, maintenance_rate): def mark_type(self): """Gets the mark_type of this DeliveryContract. # noqa: E501 - Mark price type, internal - based on internal trading, index - based on external index price # noqa: E501 + Mark price type: internal - internal trading price, index - external index price # noqa: E501 :return: The mark_type of this DeliveryContract. # noqa: E501 :rtype: str @@ -488,7 +449,7 @@ def mark_type(self): def mark_type(self, mark_type): """Sets the mark_type of this DeliveryContract. - Mark price type, internal - based on internal trading, index - based on external index price # noqa: E501 + Mark price type: internal - internal trading price, index - external index price # noqa: E501 :param mark_type: The mark_type of this DeliveryContract. # noqa: E501 :type: str @@ -496,9 +457,8 @@ def mark_type(self, mark_type): allowed_values = ["internal", "index"] # noqa: E501 if self.local_vars_configuration.client_side_validation and mark_type not in allowed_values: # noqa: E501 raise ValueError( - "Invalid value for `mark_type` ({0}), must be one of {1}".format( # noqa: E501 - mark_type, allowed_values - ) + "Invalid value for `mark_type` ({0}), must be one of {1}" # noqa: E501 + .format(mark_type, allowed_values) ) self._mark_type = mark_type @@ -576,7 +536,7 @@ def last_price(self, last_price): def maker_fee_rate(self): """Gets the maker_fee_rate of this DeliveryContract. # noqa: E501 - Maker fee rate, where negative means rebate # noqa: E501 + Maker fee rate, negative values indicate rebates # noqa: E501 :return: The maker_fee_rate of this DeliveryContract. # noqa: E501 :rtype: str @@ -587,7 +547,7 @@ def maker_fee_rate(self): def maker_fee_rate(self, maker_fee_rate): """Sets the maker_fee_rate of this DeliveryContract. - Maker fee rate, where negative means rebate # noqa: E501 + Maker fee rate, negative values indicate rebates # noqa: E501 :param maker_fee_rate: The maker_fee_rate of this DeliveryContract. # noqa: E501 :type: str @@ -898,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 the contract allowed # noqa: E501 + Minimum order size allowed by the contract # noqa: E501 :return: The order_size_min of this DeliveryContract. # noqa: E501 :rtype: int @@ -909,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 the contract allowed # noqa: E501 + Minimum order size allowed by the contract # noqa: E501 :param order_size_min: The order_size_min of this DeliveryContract. # noqa: E501 :type: int @@ -921,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 the contract allowed # noqa: E501 + Maximum order size allowed by the contract # noqa: E501 :return: The order_size_max of this DeliveryContract. # noqa: E501 :rtype: int @@ -932,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 the contract allowed # noqa: E501 + Maximum order size allowed by the contract # noqa: E501 :param order_size_max: The order_size_max of this DeliveryContract. # noqa: E501 :type: int @@ -944,7 +904,7 @@ def order_size_max(self, order_size_max): def order_price_deviate(self): """Gets the order_price_deviate of this DeliveryContract. # noqa: E501 - deviation between order price and current index price. If price of an order is denoted as order_price, it must meet the following condition: abs(order_price - mark_price) <= mark_price * order_price_deviate # noqa: E501 + 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 # noqa: E501 :return: The order_price_deviate of this DeliveryContract. # noqa: E501 :rtype: str @@ -955,7 +915,7 @@ def order_price_deviate(self): def order_price_deviate(self, order_price_deviate): """Sets the order_price_deviate of this DeliveryContract. - deviation between order price and current index price. If price of an order is denoted as order_price, it must meet the following condition: abs(order_price - mark_price) <= mark_price * order_price_deviate # noqa: E501 + 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 # noqa: E501 :param order_price_deviate: The order_price_deviate of this DeliveryContract. # noqa: E501 :type: str @@ -967,7 +927,7 @@ def order_price_deviate(self, order_price_deviate): def ref_discount_rate(self): """Gets the ref_discount_rate of this DeliveryContract. # noqa: E501 - Referral fee rate discount # noqa: E501 + Trading fee discount for referred users # noqa: E501 :return: The ref_discount_rate of this DeliveryContract. # noqa: E501 :rtype: str @@ -978,7 +938,7 @@ def ref_discount_rate(self): def ref_discount_rate(self, ref_discount_rate): """Sets the ref_discount_rate of this DeliveryContract. - Referral fee rate discount # noqa: E501 + Trading fee discount for referred users # noqa: E501 :param ref_discount_rate: The ref_discount_rate of this DeliveryContract. # noqa: E501 :type: str @@ -990,7 +950,7 @@ def ref_discount_rate(self, ref_discount_rate): def ref_rebate_rate(self): """Gets the ref_rebate_rate of this DeliveryContract. # noqa: E501 - Referrer commission rate # noqa: E501 + Commission rate for referrers # noqa: E501 :return: The ref_rebate_rate of this DeliveryContract. # noqa: E501 :rtype: str @@ -1001,7 +961,7 @@ def ref_rebate_rate(self): def ref_rebate_rate(self, ref_rebate_rate): """Sets the ref_rebate_rate of this DeliveryContract. - Referrer commission rate # noqa: E501 + Commission rate for referrers # noqa: E501 :param ref_rebate_rate: The ref_rebate_rate of this DeliveryContract. # noqa: E501 :type: str @@ -1013,7 +973,7 @@ def ref_rebate_rate(self, ref_rebate_rate): def orderbook_id(self): """Gets the orderbook_id of this DeliveryContract. # noqa: E501 - Current orderbook ID # noqa: E501 + Orderbook update ID # noqa: E501 :return: The orderbook_id of this DeliveryContract. # noqa: E501 :rtype: int @@ -1024,7 +984,7 @@ def orderbook_id(self): def orderbook_id(self, orderbook_id): """Sets the orderbook_id of this DeliveryContract. - Current orderbook ID # noqa: E501 + Orderbook update ID # noqa: E501 :param orderbook_id: The orderbook_id of this DeliveryContract. # noqa: E501 :type: int @@ -1059,7 +1019,7 @@ def trade_id(self, trade_id): def trade_size(self): """Gets the trade_size of this DeliveryContract. # noqa: E501 - Historical accumulated trade size # noqa: E501 + Historical cumulative trading volume # noqa: E501 :return: The trade_size of this DeliveryContract. # noqa: E501 :rtype: int @@ -1070,7 +1030,7 @@ def trade_size(self): def trade_size(self, trade_size): """Sets the trade_size of this DeliveryContract. - Historical accumulated trade size # noqa: E501 + Historical cumulative trading volume # noqa: E501 :param trade_size: The trade_size of this DeliveryContract. # noqa: E501 :type: int @@ -1105,7 +1065,7 @@ def position_size(self, position_size): def config_change_time(self): """Gets the config_change_time of this DeliveryContract. # noqa: E501 - Last changed time of configuration # noqa: E501 + Last configuration update time # noqa: E501 :return: The config_change_time of this DeliveryContract. # noqa: E501 :rtype: float @@ -1116,7 +1076,7 @@ def config_change_time(self): def config_change_time(self, config_change_time): """Sets the config_change_time of this DeliveryContract. - Last changed time of configuration # noqa: E501 + Last configuration update time # noqa: E501 :param config_change_time: The config_change_time of this DeliveryContract. # noqa: E501 :type: float @@ -1151,7 +1111,7 @@ def in_delisting(self, in_delisting): def orders_limit(self): """Gets the orders_limit of this DeliveryContract. # noqa: E501 - Maximum number of open orders # noqa: E501 + Maximum number of pending orders # noqa: E501 :return: The orders_limit of this DeliveryContract. # noqa: E501 :rtype: int @@ -1162,7 +1122,7 @@ def orders_limit(self): def orders_limit(self, orders_limit): """Sets the orders_limit of this DeliveryContract. - Maximum number of open orders # noqa: E501 + Maximum number of pending orders # noqa: E501 :param orders_limit: The orders_limit of this DeliveryContract. # noqa: E501 :type: int @@ -1177,16 +1137,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/delivery_settlement.py b/gate_api/models/delivery_settlement.py index 78b09d1..1985a9b 100644 --- a/gate_api/models/delivery_settlement.py +++ b/gate_api/models/delivery_settlement.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -41,7 +41,7 @@ class DeliverySettlement(object): 'entry_price': 'str', 'settle_price': 'str', 'profit': 'str', - 'fee': 'str', + 'fee': 'str' } attribute_map = { @@ -53,22 +53,10 @@ class DeliverySettlement(object): 'entry_price': 'entry_price', 'settle_price': 'settle_price', 'profit': 'profit', - 'fee': 'fee', + 'fee': 'fee' } - def __init__( - self, - time=None, - contract=None, - leverage=None, - size=None, - margin=None, - entry_price=None, - settle_price=None, - profit=None, - fee=None, - local_vars_configuration=None, - ): # noqa: E501 + def __init__(self, time=None, contract=None, leverage=None, size=None, margin=None, entry_price=None, settle_price=None, profit=None, fee=None, local_vars_configuration=None): # noqa: E501 # type: (int, str, str, int, str, str, str, str, str, Configuration) -> None """DeliverySettlement - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: @@ -319,16 +307,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/delivery_ticker.py b/gate_api/models/delivery_ticker.py new file mode 100644 index 0000000..9cf1203 --- /dev/null +++ b/gate_api/models/delivery_ticker.py @@ -0,0 +1,739 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class DeliveryTicker(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'last': 'str', + 'change_percentage': 'str', + 'total_size': 'str', + 'low_24h': 'str', + 'high_24h': 'str', + 'volume_24h': 'str', + 'volume_24h_btc': 'str', + 'volume_24h_usd': 'str', + 'volume_24h_base': 'str', + 'volume_24h_quote': 'str', + 'volume_24h_settle': 'str', + 'mark_price': 'str', + 'funding_rate': 'str', + 'funding_rate_indicative': 'str', + 'index_price': 'str', + 'quanto_base_rate': 'str', + 'basis_rate': 'str', + 'basis_value': 'str', + 'lowest_ask': 'str', + 'lowest_size': 'str', + 'highest_bid': 'str', + 'highest_size': 'str' + } + + attribute_map = { + 'contract': 'contract', + 'last': 'last', + 'change_percentage': 'change_percentage', + 'total_size': 'total_size', + 'low_24h': 'low_24h', + 'high_24h': 'high_24h', + 'volume_24h': 'volume_24h', + 'volume_24h_btc': 'volume_24h_btc', + 'volume_24h_usd': 'volume_24h_usd', + 'volume_24h_base': 'volume_24h_base', + 'volume_24h_quote': 'volume_24h_quote', + 'volume_24h_settle': 'volume_24h_settle', + 'mark_price': 'mark_price', + 'funding_rate': 'funding_rate', + 'funding_rate_indicative': 'funding_rate_indicative', + 'index_price': 'index_price', + 'quanto_base_rate': 'quanto_base_rate', + 'basis_rate': 'basis_rate', + 'basis_value': 'basis_value', + 'lowest_ask': 'lowest_ask', + 'lowest_size': 'lowest_size', + 'highest_bid': 'highest_bid', + 'highest_size': 'highest_size' + } + + def __init__(self, contract=None, last=None, change_percentage=None, total_size=None, low_24h=None, high_24h=None, volume_24h=None, volume_24h_btc=None, volume_24h_usd=None, volume_24h_base=None, volume_24h_quote=None, volume_24h_settle=None, mark_price=None, funding_rate=None, funding_rate_indicative=None, index_price=None, quanto_base_rate=None, basis_rate=None, basis_value=None, lowest_ask=None, lowest_size=None, highest_bid=None, highest_size=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, Configuration) -> None + """DeliveryTicker - a 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._last = None + self._change_percentage = None + self._total_size = None + self._low_24h = None + self._high_24h = None + self._volume_24h = None + self._volume_24h_btc = None + self._volume_24h_usd = None + self._volume_24h_base = None + self._volume_24h_quote = None + self._volume_24h_settle = None + self._mark_price = None + self._funding_rate = None + self._funding_rate_indicative = None + self._index_price = None + self._quanto_base_rate = None + self._basis_rate = None + self._basis_value = None + self._lowest_ask = None + self._lowest_size = None + self._highest_bid = None + self._highest_size = None + self.discriminator = None + + if contract is not None: + self.contract = contract + if last is not None: + self.last = last + if change_percentage is not None: + self.change_percentage = change_percentage + if total_size is not None: + self.total_size = total_size + 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 is not None: + self.volume_24h = volume_24h + if volume_24h_btc is not None: + self.volume_24h_btc = volume_24h_btc + if volume_24h_usd is not None: + self.volume_24h_usd = volume_24h_usd + 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 volume_24h_settle is not None: + self.volume_24h_settle = volume_24h_settle + if mark_price is not None: + self.mark_price = mark_price + if funding_rate is not None: + self.funding_rate = funding_rate + if funding_rate_indicative is not None: + self.funding_rate_indicative = funding_rate_indicative + if index_price is not None: + self.index_price = index_price + if quanto_base_rate is not None: + self.quanto_base_rate = quanto_base_rate + if basis_rate is not None: + self.basis_rate = basis_rate + if basis_value is not None: + self.basis_value = basis_value + if lowest_ask is not None: + self.lowest_ask = lowest_ask + if lowest_size is not None: + self.lowest_size = lowest_size + if highest_bid is not None: + self.highest_bid = highest_bid + if highest_size is not None: + self.highest_size = highest_size + + @property + def contract(self): + """Gets the contract of this DeliveryTicker. # noqa: E501 + + Futures contract # noqa: E501 + + :return: The contract of this DeliveryTicker. # noqa: E501 + :rtype: str + """ + return self._contract + + @contract.setter + def contract(self, contract): + """Sets the contract of this DeliveryTicker. + + Futures contract # noqa: E501 + + :param contract: The contract of this DeliveryTicker. # noqa: E501 + :type: str + """ + + self._contract = contract + + @property + def last(self): + """Gets the last of this DeliveryTicker. # noqa: E501 + + Last trading price # noqa: E501 + + :return: The last of this DeliveryTicker. # noqa: E501 + :rtype: str + """ + return self._last + + @last.setter + def last(self, last): + """Sets the last of this DeliveryTicker. + + Last trading price # noqa: E501 + + :param last: The last of this DeliveryTicker. # noqa: E501 + :type: str + """ + + self._last = last + + @property + def change_percentage(self): + """Gets the change_percentage of this DeliveryTicker. # noqa: E501 + + Price change percentage. Negative values indicate price decrease, e.g. -7.45 # noqa: E501 + + :return: The change_percentage of this DeliveryTicker. # noqa: E501 + :rtype: str + """ + return self._change_percentage + + @change_percentage.setter + def change_percentage(self, change_percentage): + """Sets the change_percentage of this DeliveryTicker. + + Price change percentage. Negative values indicate price decrease, e.g. -7.45 # noqa: E501 + + :param change_percentage: The change_percentage of this DeliveryTicker. # noqa: E501 + :type: str + """ + + self._change_percentage = change_percentage + + @property + def total_size(self): + """Gets the total_size of this DeliveryTicker. # noqa: E501 + + Contract total size # noqa: E501 + + :return: The total_size of this DeliveryTicker. # noqa: E501 + :rtype: str + """ + return self._total_size + + @total_size.setter + def total_size(self, total_size): + """Sets the total_size of this DeliveryTicker. + + Contract total size # noqa: E501 + + :param total_size: The total_size of this DeliveryTicker. # noqa: E501 + :type: str + """ + + self._total_size = total_size + + @property + def low_24h(self): + """Gets the low_24h of this DeliveryTicker. # noqa: E501 + + 24-hour lowest price # noqa: E501 + + :return: The low_24h of this DeliveryTicker. # noqa: E501 + :rtype: str + """ + return self._low_24h + + @low_24h.setter + def low_24h(self, low_24h): + """Sets the low_24h of this DeliveryTicker. + + 24-hour lowest price # noqa: E501 + + :param low_24h: The low_24h of this DeliveryTicker. # noqa: E501 + :type: str + """ + + self._low_24h = low_24h + + @property + def high_24h(self): + """Gets the high_24h of this DeliveryTicker. # noqa: E501 + + 24-hour highest price # noqa: E501 + + :return: The high_24h of this DeliveryTicker. # noqa: E501 + :rtype: str + """ + return self._high_24h + + @high_24h.setter + def high_24h(self, high_24h): + """Sets the high_24h of this DeliveryTicker. + + 24-hour highest price # noqa: E501 + + :param high_24h: The high_24h of this DeliveryTicker. # noqa: E501 + :type: str + """ + + self._high_24h = high_24h + + @property + def volume_24h(self): + """Gets the volume_24h of this DeliveryTicker. # noqa: E501 + + 24-hour trading volume # noqa: E501 + + :return: The volume_24h of this DeliveryTicker. # noqa: E501 + :rtype: str + """ + return self._volume_24h + + @volume_24h.setter + def volume_24h(self, volume_24h): + """Sets the volume_24h of this DeliveryTicker. + + 24-hour trading volume # noqa: E501 + + :param volume_24h: The volume_24h of this DeliveryTicker. # noqa: E501 + :type: str + """ + + self._volume_24h = volume_24h + + @property + def volume_24h_btc(self): + """Gets the volume_24h_btc of this DeliveryTicker. # noqa: E501 + + 24-hour trading volume in BTC (deprecated, use `volume_24h_base`, `volume_24h_quote`, `volume_24h_settle` instead) # noqa: E501 + + :return: The volume_24h_btc of this DeliveryTicker. # noqa: E501 + :rtype: str + """ + return self._volume_24h_btc + + @volume_24h_btc.setter + def volume_24h_btc(self, volume_24h_btc): + """Sets the volume_24h_btc of this DeliveryTicker. + + 24-hour trading volume in BTC (deprecated, use `volume_24h_base`, `volume_24h_quote`, `volume_24h_settle` instead) # noqa: E501 + + :param volume_24h_btc: The volume_24h_btc of this DeliveryTicker. # noqa: E501 + :type: str + """ + + self._volume_24h_btc = volume_24h_btc + + @property + def volume_24h_usd(self): + """Gets the volume_24h_usd of this DeliveryTicker. # noqa: E501 + + 24-hour trading volume in USD (deprecated, use `volume_24h_base`, `volume_24h_quote`, `volume_24h_settle` instead) # noqa: E501 + + :return: The volume_24h_usd of this DeliveryTicker. # noqa: E501 + :rtype: str + """ + return self._volume_24h_usd + + @volume_24h_usd.setter + def volume_24h_usd(self, volume_24h_usd): + """Sets the volume_24h_usd of this DeliveryTicker. + + 24-hour trading volume in USD (deprecated, use `volume_24h_base`, `volume_24h_quote`, `volume_24h_settle` instead) # noqa: E501 + + :param volume_24h_usd: The volume_24h_usd of this DeliveryTicker. # noqa: E501 + :type: str + """ + + self._volume_24h_usd = volume_24h_usd + + @property + def volume_24h_base(self): + """Gets the volume_24h_base of this DeliveryTicker. # noqa: E501 + + 24-hour trading volume in base currency # noqa: E501 + + :return: The volume_24h_base of this DeliveryTicker. # 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 DeliveryTicker. + + 24-hour trading volume in base currency # noqa: E501 + + :param volume_24h_base: The volume_24h_base of this DeliveryTicker. # noqa: E501 + :type: str + """ + + self._volume_24h_base = volume_24h_base + + @property + def volume_24h_quote(self): + """Gets the volume_24h_quote of this DeliveryTicker. # noqa: E501 + + 24-hour trading volume in quote currency # noqa: E501 + + :return: The volume_24h_quote of this DeliveryTicker. # 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 DeliveryTicker. + + 24-hour trading volume in quote currency # noqa: E501 + + :param volume_24h_quote: The volume_24h_quote of this DeliveryTicker. # noqa: E501 + :type: str + """ + + self._volume_24h_quote = volume_24h_quote + + @property + def volume_24h_settle(self): + """Gets the volume_24h_settle of this DeliveryTicker. # noqa: E501 + + 24-hour trading volume in settle currency # noqa: E501 + + :return: The volume_24h_settle of this DeliveryTicker. # noqa: E501 + :rtype: str + """ + return self._volume_24h_settle + + @volume_24h_settle.setter + def volume_24h_settle(self, volume_24h_settle): + """Sets the volume_24h_settle of this DeliveryTicker. + + 24-hour trading volume in settle currency # noqa: E501 + + :param volume_24h_settle: The volume_24h_settle of this DeliveryTicker. # noqa: E501 + :type: str + """ + + self._volume_24h_settle = volume_24h_settle + + @property + def mark_price(self): + """Gets the mark_price of this DeliveryTicker. # noqa: E501 + + Recent mark price # noqa: E501 + + :return: The mark_price of this DeliveryTicker. # noqa: E501 + :rtype: str + """ + return self._mark_price + + @mark_price.setter + def mark_price(self, mark_price): + """Sets the mark_price of this DeliveryTicker. + + Recent mark price # noqa: E501 + + :param mark_price: The mark_price of this DeliveryTicker. # noqa: E501 + :type: str + """ + + self._mark_price = mark_price + + @property + def funding_rate(self): + """Gets the funding_rate of this DeliveryTicker. # noqa: E501 + + Funding rate # noqa: E501 + + :return: The funding_rate of this DeliveryTicker. # noqa: E501 + :rtype: str + """ + return self._funding_rate + + @funding_rate.setter + def funding_rate(self, funding_rate): + """Sets the funding_rate of this DeliveryTicker. + + Funding rate # noqa: E501 + + :param funding_rate: The funding_rate of this DeliveryTicker. # noqa: E501 + :type: str + """ + + self._funding_rate = funding_rate + + @property + def funding_rate_indicative(self): + """Gets the funding_rate_indicative of this DeliveryTicker. # noqa: E501 + + Indicative Funding rate in next period. (deprecated. use `funding_rate`) # noqa: E501 + + :return: The funding_rate_indicative of this DeliveryTicker. # noqa: E501 + :rtype: str + """ + return self._funding_rate_indicative + + @funding_rate_indicative.setter + def funding_rate_indicative(self, funding_rate_indicative): + """Sets the funding_rate_indicative of this DeliveryTicker. + + Indicative Funding rate in next period. (deprecated. use `funding_rate`) # noqa: E501 + + :param funding_rate_indicative: The funding_rate_indicative of this DeliveryTicker. # noqa: E501 + :type: str + """ + + self._funding_rate_indicative = funding_rate_indicative + + @property + def index_price(self): + """Gets the index_price of this DeliveryTicker. # noqa: E501 + + Index price # noqa: E501 + + :return: The index_price of this DeliveryTicker. # noqa: E501 + :rtype: str + """ + return self._index_price + + @index_price.setter + def index_price(self, index_price): + """Sets the index_price of this DeliveryTicker. + + Index price # noqa: E501 + + :param index_price: The index_price of this DeliveryTicker. # noqa: E501 + :type: str + """ + + self._index_price = index_price + + @property + def quanto_base_rate(self): + """Gets the quanto_base_rate of this DeliveryTicker. # noqa: E501 + + Exchange rate of base currency and settlement currency in Quanto contract. Does not exists in contracts of other types # noqa: E501 + + :return: The quanto_base_rate of this DeliveryTicker. # noqa: E501 + :rtype: str + """ + return self._quanto_base_rate + + @quanto_base_rate.setter + def quanto_base_rate(self, quanto_base_rate): + """Sets the quanto_base_rate of this DeliveryTicker. + + Exchange rate of base currency and settlement currency in Quanto contract. Does not exists in contracts of other types # noqa: E501 + + :param quanto_base_rate: The quanto_base_rate of this DeliveryTicker. # noqa: E501 + :type: str + """ + + self._quanto_base_rate = quanto_base_rate + + @property + def basis_rate(self): + """Gets the basis_rate of this DeliveryTicker. # noqa: E501 + + Basis rate # noqa: E501 + + :return: The basis_rate of this DeliveryTicker. # noqa: E501 + :rtype: str + """ + return self._basis_rate + + @basis_rate.setter + def basis_rate(self, basis_rate): + """Sets the basis_rate of this DeliveryTicker. + + Basis rate # noqa: E501 + + :param basis_rate: The basis_rate of this DeliveryTicker. # noqa: E501 + :type: str + """ + + self._basis_rate = basis_rate + + @property + def basis_value(self): + """Gets the basis_value of this DeliveryTicker. # noqa: E501 + + Basis value # noqa: E501 + + :return: The basis_value of this DeliveryTicker. # noqa: E501 + :rtype: str + """ + return self._basis_value + + @basis_value.setter + def basis_value(self, basis_value): + """Sets the basis_value of this DeliveryTicker. + + Basis value # noqa: E501 + + :param basis_value: The basis_value of this DeliveryTicker. # noqa: E501 + :type: str + """ + + self._basis_value = basis_value + + @property + def lowest_ask(self): + """Gets the lowest_ask of this DeliveryTicker. # noqa: E501 + + Recent lowest ask # noqa: E501 + + :return: The lowest_ask of this DeliveryTicker. # noqa: E501 + :rtype: str + """ + return self._lowest_ask + + @lowest_ask.setter + def lowest_ask(self, lowest_ask): + """Sets the lowest_ask of this DeliveryTicker. + + Recent lowest ask # noqa: E501 + + :param lowest_ask: The lowest_ask of this DeliveryTicker. # noqa: E501 + :type: str + """ + + self._lowest_ask = lowest_ask + + @property + def lowest_size(self): + """Gets the lowest_size of this DeliveryTicker. # noqa: E501 + + The latest seller's lowest price order quantity # noqa: E501 + + :return: The lowest_size of this DeliveryTicker. # noqa: E501 + :rtype: str + """ + return self._lowest_size + + @lowest_size.setter + def lowest_size(self, lowest_size): + """Sets the lowest_size of this DeliveryTicker. + + The latest seller's lowest price order quantity # noqa: E501 + + :param lowest_size: The lowest_size of this DeliveryTicker. # noqa: E501 + :type: str + """ + + self._lowest_size = lowest_size + + @property + def highest_bid(self): + """Gets the highest_bid of this DeliveryTicker. # noqa: E501 + + Recent highest bid # noqa: E501 + + :return: The highest_bid of this DeliveryTicker. # noqa: E501 + :rtype: str + """ + return self._highest_bid + + @highest_bid.setter + def highest_bid(self, highest_bid): + """Sets the highest_bid of this DeliveryTicker. + + Recent highest bid # noqa: E501 + + :param highest_bid: The highest_bid of this DeliveryTicker. # noqa: E501 + :type: str + """ + + self._highest_bid = highest_bid + + @property + def highest_size(self): + """Gets the highest_size of this DeliveryTicker. # noqa: E501 + + The latest buyer's highest price order volume # noqa: E501 + + :return: The highest_size of this DeliveryTicker. # noqa: E501 + :rtype: str + """ + return self._highest_size + + @highest_size.setter + def highest_size(self, highest_size): + """Sets the highest_size of this DeliveryTicker. + + The latest buyer's highest price order volume # noqa: E501 + + :param highest_size: The highest_size of this DeliveryTicker. # noqa: E501 + :type: str + """ + + self._highest_size = highest_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, DeliveryTicker): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, DeliveryTicker): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/deposit_address.py b/gate_api/models/deposit_address.py index 4768b75..01a55df 100644 --- a/gate_api/models/deposit_address.py +++ b/gate_api/models/deposit_address.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -32,13 +32,19 @@ class DepositAddress(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {'currency': 'str', 'address': 'str', 'multichain_addresses': 'list[MultiChainAddressItem]'} - - attribute_map = {'currency': 'currency', 'address': 'address', 'multichain_addresses': 'multichain_addresses'} - - def __init__( - self, currency=None, address=None, multichain_addresses=None, local_vars_configuration=None - ): # noqa: E501 + openapi_types = { + 'currency': 'str', + 'address': 'str', + 'multichain_addresses': 'list[MultiChainAddressItem]' + } + + attribute_map = { + 'currency': 'currency', + 'address': 'address', + 'multichain_addresses': 'multichain_addresses' + } + + def __init__(self, currency=None, address=None, multichain_addresses=None, local_vars_configuration=None): # noqa: E501 # type: (str, str, list[MultiChainAddressItem], Configuration) -> None """DepositAddress - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: @@ -133,16 +139,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/deposit_record.py b/gate_api/models/deposit_record.py new file mode 100644 index 0000000..509aa32 --- /dev/null +++ b/gate_api/models/deposit_record.py @@ -0,0 +1,378 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class DepositRecord(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'txid': 'str', + 'withdraw_order_id': 'str', + 'timestamp': 'str', + 'amount': 'str', + 'currency': 'str', + 'address': 'str', + 'memo': 'str', + 'status': 'str', + 'chain': 'str' + } + + attribute_map = { + 'id': 'id', + 'txid': 'txid', + 'withdraw_order_id': 'withdraw_order_id', + 'timestamp': 'timestamp', + 'amount': 'amount', + 'currency': 'currency', + 'address': 'address', + 'memo': 'memo', + 'status': 'status', + 'chain': 'chain' + } + + def __init__(self, id=None, txid=None, withdraw_order_id=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, str, Configuration) -> None + """DepositRecord - a 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._txid = None + self._withdraw_order_id = None + self._timestamp = None + self._amount = None + self._currency = None + self._address = None + self._memo = None + self._status = None + self._chain = None + self.discriminator = None + + if id is not None: + self.id = id + if txid is not None: + self.txid = txid + if withdraw_order_id is not None: + self.withdraw_order_id = withdraw_order_id + if timestamp is not None: + self.timestamp = timestamp + self.amount = amount + self.currency = currency + if address is not None: + self.address = address + if memo is not None: + self.memo = memo + if status is not None: + self.status = status + self.chain = chain + + @property + def id(self): + """Gets the id of this DepositRecord. # noqa: E501 + + Record ID # noqa: E501 + + :return: The id of this DepositRecord. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this DepositRecord. + + Record ID # noqa: E501 + + :param id: The id of this DepositRecord. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def txid(self): + """Gets the txid of this DepositRecord. # noqa: E501 + + Hash record of the withdrawal # noqa: E501 + + :return: The txid of this DepositRecord. # noqa: E501 + :rtype: str + """ + return self._txid + + @txid.setter + def txid(self, txid): + """Sets the txid of this DepositRecord. + + Hash record of the withdrawal # noqa: E501 + + :param txid: The txid of this DepositRecord. # noqa: E501 + :type: str + """ + + self._txid = txid + + @property + def withdraw_order_id(self): + """Gets the withdraw_order_id of this DepositRecord. # noqa: E501 + + Client order id, up to 32 length and can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) # noqa: E501 + + :return: The withdraw_order_id of this DepositRecord. # noqa: E501 + :rtype: str + """ + return self._withdraw_order_id + + @withdraw_order_id.setter + def withdraw_order_id(self, withdraw_order_id): + """Sets the withdraw_order_id of this DepositRecord. + + Client order id, up to 32 length and can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) # noqa: E501 + + :param withdraw_order_id: The withdraw_order_id of this DepositRecord. # noqa: E501 + :type: str + """ + + self._withdraw_order_id = withdraw_order_id + + @property + def timestamp(self): + """Gets the timestamp of this DepositRecord. # noqa: E501 + + Operation time # noqa: E501 + + :return: The timestamp of this DepositRecord. # noqa: E501 + :rtype: str + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this DepositRecord. + + Operation time # noqa: E501 + + :param timestamp: The timestamp of this DepositRecord. # noqa: E501 + :type: str + """ + + self._timestamp = timestamp + + @property + def amount(self): + """Gets the amount of this DepositRecord. # noqa: E501 + + Token amount # noqa: E501 + + :return: The amount of this DepositRecord. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this DepositRecord. + + Token amount # noqa: E501 + + :param amount: The amount of this DepositRecord. # 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 currency(self): + """Gets the currency of this DepositRecord. # noqa: E501 + + Currency name # noqa: E501 + + :return: The currency of this DepositRecord. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this DepositRecord. + + Currency name # noqa: E501 + + :param currency: The currency of this DepositRecord. # 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 address(self): + """Gets the address of this DepositRecord. # noqa: E501 + + Withdrawal address. Required for withdrawals # noqa: E501 + + :return: The address of this DepositRecord. # noqa: E501 + :rtype: str + """ + return self._address + + @address.setter + def address(self, address): + """Sets the address of this DepositRecord. + + Withdrawal address. Required for withdrawals # noqa: E501 + + :param address: The address of this DepositRecord. # noqa: E501 + :type: str + """ + + self._address = address + + @property + def memo(self): + """Gets the memo of this DepositRecord. # noqa: E501 + + Additional remarks with regards to the withdrawal # noqa: E501 + + :return: The memo of this DepositRecord. # noqa: E501 + :rtype: str + """ + return self._memo + + @memo.setter + def memo(self, memo): + """Sets the memo of this DepositRecord. + + Additional remarks with regards to the withdrawal # noqa: E501 + + :param memo: The memo of this DepositRecord. # noqa: E501 + :type: str + """ + + self._memo = memo + + @property + def status(self): + """Gets the status of this DepositRecord. # noqa: E501 + + Trading Status - REVIEW: Recharge review (compliance review) - PEND: Processing - DONE: Waiting for funds to be unlocked - INVALID: Invalid data - TRACK: Track the number of confirmations, waiting to add funds to the user (spot) - BLOCKED: Rejected Recharge - DEP_CREDITED: Recharge to account, withdrawal is not unlocked # noqa: E501 + + :return: The status of this DepositRecord. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this DepositRecord. + + Trading Status - REVIEW: Recharge review (compliance review) - PEND: Processing - DONE: Waiting for funds to be unlocked - INVALID: Invalid data - TRACK: Track the number of confirmations, waiting to add funds to the user (spot) - BLOCKED: Rejected Recharge - DEP_CREDITED: Recharge to account, withdrawal is not unlocked # noqa: E501 + + :param status: The status of this DepositRecord. # noqa: E501 + :type: str + """ + + self._status = status + + @property + def chain(self): + """Gets the chain of this DepositRecord. # noqa: E501 + + Name of the chain used in withdrawals # noqa: E501 + + :return: The chain of this DepositRecord. # noqa: E501 + :rtype: str + """ + return self._chain + + @chain.setter + def chain(self, chain): + """Sets the chain of this DepositRecord. + + Name of the chain used in withdrawals # noqa: E501 + + :param chain: The chain of this DepositRecord. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and chain is None: # noqa: E501 + raise ValueError("Invalid value for `chain`, must not be `None`") # noqa: E501 + + 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, DepositRecord): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, DepositRecord): + 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 new file mode 100644 index 0000000..3734353 --- /dev/null +++ b/gate_api/models/dual_get_orders.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 DualGetOrders(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'plan_id': 'int', + 'copies': 'str', + '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', + 'copies': 'copies', + '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, 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 + """DualGetOrders - a 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._copies = 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 + + if id is not None: + 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: + 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 DualGetOrders. # noqa: E501 + + Order ID # noqa: E501 + + :return: The id of this DualGetOrders. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this DualGetOrders. + + Order ID # noqa: E501 + + :param id: The id of this DualGetOrders. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def plan_id(self): + """Gets the plan_id of this DualGetOrders. # noqa: E501 + + Product ID # noqa: E501 + + :return: The plan_id of this DualGetOrders. # noqa: E501 + :rtype: int + """ + return self._plan_id + + @plan_id.setter + def plan_id(self, plan_id): + """Sets the plan_id of this DualGetOrders. + + Product ID # noqa: E501 + + :param plan_id: The plan_id of this DualGetOrders. # noqa: E501 + :type: int + """ + + 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 + + Investment Quantity # noqa: E501 + + :return: The invest_amount of this DualGetOrders. # noqa: E501 + :rtype: str + """ + return self._invest_amount + + @invest_amount.setter + def invest_amount(self, invest_amount): + """Sets the invest_amount of this DualGetOrders. + + Investment Quantity # noqa: E501 + + :param invest_amount: The invest_amount of this DualGetOrders. # noqa: E501 + :type: str + """ + + self._invest_amount = invest_amount + + @property + def settlement_amount(self): + """Gets the settlement_amount of this DualGetOrders. # noqa: E501 + + Settlement Quantity # noqa: E501 + + :return: The settlement_amount of this DualGetOrders. # noqa: E501 + :rtype: str + """ + return self._settlement_amount + + @settlement_amount.setter + def settlement_amount(self, settlement_amount): + """Sets the settlement_amount of this DualGetOrders. + + Settlement Quantity # noqa: E501 + + :param settlement_amount: The settlement_amount of this DualGetOrders. # noqa: E501 + :type: str + """ + + self._settlement_amount = settlement_amount + + @property + def create_time(self): + """Gets the create_time of this DualGetOrders. # noqa: E501 + + Created time # noqa: E501 + + :return: The create_time of this DualGetOrders. # noqa: E501 + :rtype: int + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this DualGetOrders. + + Created time # noqa: E501 + + :param create_time: The create_time of this DualGetOrders. # noqa: E501 + :type: int + """ + + self._create_time = create_time + + @property + def complete_time(self): + """Gets the complete_time of this DualGetOrders. # noqa: E501 + + Completed Time # noqa: E501 + + :return: The complete_time of this DualGetOrders. # noqa: E501 + :rtype: int + """ + return self._complete_time + + @complete_time.setter + def complete_time(self, complete_time): + """Sets the complete_time of this DualGetOrders. + + Completed Time # noqa: E501 + + :param complete_time: The complete_time of this DualGetOrders. # noqa: E501 + :type: int + """ + + self._complete_time = complete_time + + @property + def status(self): + """Gets the status of this DualGetOrders. # noqa: E501 + + Status: `INIT`-Created `SETTLEMENT_SUCCESS`-Settlement Success `SETTLEMENT_PROCESSING`-Settlement Processing `CANCELED`-Canceled `FAILED`-Failed # noqa: E501 + + :return: The status of this DualGetOrders. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this DualGetOrders. + + Status: `INIT`-Created `SETTLEMENT_SUCCESS`-Settlement Success `SETTLEMENT_PROCESSING`-Settlement Processing `CANCELED`-Canceled `FAILED`-Failed # noqa: E501 + + :param status: The status of this DualGetOrders. # noqa: E501 + :type: str + """ + + self._status = status + + @property + def invest_currency(self): + """Gets the invest_currency of this DualGetOrders. # noqa: E501 + + Investment Token # noqa: E501 + + :return: The invest_currency of this DualGetOrders. # noqa: E501 + :rtype: str + """ + return self._invest_currency + + @invest_currency.setter + def invest_currency(self, invest_currency): + """Sets the invest_currency of this DualGetOrders. + + Investment Token # noqa: E501 + + :param invest_currency: The invest_currency of this DualGetOrders. # noqa: E501 + :type: str + """ + + self._invest_currency = invest_currency + + @property + def exercise_currency(self): + """Gets the exercise_currency of this DualGetOrders. # noqa: E501 + + Strike Token # noqa: E501 + + :return: The exercise_currency of this DualGetOrders. # noqa: E501 + :rtype: str + """ + return self._exercise_currency + + @exercise_currency.setter + def exercise_currency(self, exercise_currency): + """Sets the exercise_currency of this DualGetOrders. + + Strike Token # noqa: E501 + + :param exercise_currency: The exercise_currency of this DualGetOrders. # noqa: E501 + :type: str + """ + + self._exercise_currency = exercise_currency + + @property + def exercise_price(self): + """Gets the exercise_price of this DualGetOrders. # noqa: E501 + + Strike price # noqa: E501 + + :return: The exercise_price of this DualGetOrders. # noqa: E501 + :rtype: str + """ + return self._exercise_price + + @exercise_price.setter + def exercise_price(self, exercise_price): + """Sets the exercise_price of this DualGetOrders. + + Strike price # noqa: E501 + + :param exercise_price: The exercise_price of this DualGetOrders. # noqa: E501 + :type: str + """ + + self._exercise_price = exercise_price + + @property + def settlement_price(self): + """Gets the settlement_price of this DualGetOrders. # noqa: E501 + + Settlement price # noqa: E501 + + :return: The settlement_price of this DualGetOrders. # noqa: E501 + :rtype: str + """ + return self._settlement_price + + @settlement_price.setter + def settlement_price(self, settlement_price): + """Sets the settlement_price of this DualGetOrders. + + Settlement price # noqa: E501 + + :param settlement_price: The settlement_price of this DualGetOrders. # noqa: E501 + :type: str + """ + + self._settlement_price = settlement_price + + @property + def settlement_currency(self): + """Gets the settlement_currency of this DualGetOrders. # noqa: E501 + + Settlement currency # noqa: E501 + + :return: The settlement_currency of this DualGetOrders. # noqa: E501 + :rtype: str + """ + return self._settlement_currency + + @settlement_currency.setter + def settlement_currency(self, settlement_currency): + """Sets the settlement_currency of this DualGetOrders. + + Settlement currency # noqa: E501 + + :param settlement_currency: The settlement_currency of this DualGetOrders. # noqa: E501 + :type: str + """ + + self._settlement_currency = settlement_currency + + @property + def apy_display(self): + """Gets the apy_display of this DualGetOrders. # noqa: E501 + + Annual Yield # noqa: E501 + + :return: The apy_display of this DualGetOrders. # noqa: E501 + :rtype: str + """ + return self._apy_display + + @apy_display.setter + def apy_display(self, apy_display): + """Sets the apy_display of this DualGetOrders. + + Annual Yield # noqa: E501 + + :param apy_display: The apy_display of this DualGetOrders. # noqa: E501 + :type: str + """ + + self._apy_display = apy_display + + @property + def apy_settlement(self): + """Gets the apy_settlement of this DualGetOrders. # noqa: E501 + + Settlement Annual Yield # noqa: E501 + + :return: The apy_settlement of this DualGetOrders. # noqa: E501 + :rtype: str + """ + return self._apy_settlement + + @apy_settlement.setter + def apy_settlement(self, apy_settlement): + """Sets the apy_settlement of this DualGetOrders. + + Settlement Annual Yield # noqa: E501 + + :param apy_settlement: The apy_settlement of this DualGetOrders. # noqa: E501 + :type: str + """ + + self._apy_settlement = apy_settlement + + @property + def delivery_time(self): + """Gets the delivery_time of this DualGetOrders. # noqa: E501 + + Settlement time # noqa: E501 + + :return: The delivery_time of this DualGetOrders. # noqa: E501 + :rtype: int + """ + return self._delivery_time + + @delivery_time.setter + def delivery_time(self, delivery_time): + """Sets the delivery_time of this DualGetOrders. + + Settlement time # noqa: E501 + + :param delivery_time: The delivery_time of this DualGetOrders. # noqa: E501 + :type: int + """ + + self._delivery_time = delivery_time + + @property + def text(self): + """Gets the text of this DualGetOrders. # noqa: E501 + + Custom order information # noqa: E501 + + :return: The text of this DualGetOrders. # noqa: E501 + :rtype: str + """ + return self._text + + @text.setter + def text(self, text): + """Sets the text of this DualGetOrders. + + Custom order information # noqa: E501 + + :param text: The text of this DualGetOrders. # 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, DualGetOrders): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, DualGetOrders): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/dual_get_plans.py b/gate_api/models/dual_get_plans.py new file mode 100644 index 0000000..90808a3 --- /dev/null +++ b/gate_api/models/dual_get_plans.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 DualGetPlans(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'instrument_name': 'str', + 'invest_currency': 'str', + 'exercise_currency': 'str', + 'exercise_price': 'float', + 'delivery_time': 'int', + 'min_copies': 'int', + 'max_copies': 'int', + 'per_value': 'str', + 'apy_display': 'str', + 'start_time': 'int', + 'end_time': 'int', + 'status': 'str' + } + + attribute_map = { + 'id': 'id', + 'instrument_name': 'instrument_name', + 'invest_currency': 'invest_currency', + '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', + '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 + """DualGetPlans - a 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._instrument_name = None + self._invest_currency = None + 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._start_time = None + self._end_time = None + self._status = None + self.discriminator = None + + if id is not None: + self.id = id + if instrument_name is not None: + self.instrument_name = instrument_name + 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 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 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 DualGetPlans. # noqa: E501 + + Product ID # noqa: E501 + + :return: The id of this DualGetPlans. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this DualGetPlans. + + Product ID # noqa: E501 + + :param id: The id of this DualGetPlans. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def instrument_name(self): + """Gets the instrument_name of this DualGetPlans. # noqa: E501 + + Product Name # noqa: E501 + + :return: The instrument_name of this DualGetPlans. # noqa: E501 + :rtype: str + """ + return self._instrument_name + + @instrument_name.setter + def instrument_name(self, instrument_name): + """Sets the instrument_name of this DualGetPlans. + + Product Name # noqa: E501 + + :param instrument_name: The instrument_name of this DualGetPlans. # noqa: E501 + :type: str + """ + + self._instrument_name = instrument_name + + @property + def invest_currency(self): + """Gets the invest_currency of this DualGetPlans. # noqa: E501 + + Investment Token # noqa: E501 + + :return: The invest_currency of this DualGetPlans. # noqa: E501 + :rtype: str + """ + return self._invest_currency + + @invest_currency.setter + def invest_currency(self, invest_currency): + """Sets the invest_currency of this DualGetPlans. + + Investment Token # noqa: E501 + + :param invest_currency: The invest_currency of this DualGetPlans. # noqa: E501 + :type: str + """ + + self._invest_currency = invest_currency + + @property + def exercise_currency(self): + """Gets the exercise_currency of this DualGetPlans. # noqa: E501 + + Strike Token # noqa: E501 + + :return: The exercise_currency of this DualGetPlans. # noqa: E501 + :rtype: str + """ + return self._exercise_currency + + @exercise_currency.setter + def exercise_currency(self, exercise_currency): + """Sets the exercise_currency of this DualGetPlans. + + Strike Token # noqa: E501 + + :param exercise_currency: The exercise_currency of this DualGetPlans. # noqa: E501 + :type: str + """ + + self._exercise_currency = exercise_currency + + @property + def exercise_price(self): + """Gets the exercise_price of this DualGetPlans. # noqa: E501 + + Strike price # noqa: E501 + + :return: The exercise_price of this DualGetPlans. # noqa: E501 + :rtype: float + """ + return self._exercise_price + + @exercise_price.setter + def exercise_price(self, exercise_price): + """Sets the exercise_price of this DualGetPlans. + + Strike price # noqa: E501 + + :param exercise_price: The exercise_price of this DualGetPlans. # noqa: E501 + :type: float + """ + + self._exercise_price = exercise_price + + @property + def delivery_time(self): + """Gets the delivery_time of this DualGetPlans. # noqa: E501 + + Settlement time # noqa: E501 + + :return: The delivery_time of this DualGetPlans. # noqa: E501 + :rtype: int + """ + return self._delivery_time + + @delivery_time.setter + def delivery_time(self, delivery_time): + """Sets the delivery_time of this DualGetPlans. + + Settlement time # noqa: E501 + + :param delivery_time: The delivery_time of this DualGetPlans. # noqa: E501 + :type: int + """ + + 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 + + Value Per Unit # noqa: E501 + + :return: The per_value of this DualGetPlans. # noqa: E501 + :rtype: str + """ + return self._per_value + + @per_value.setter + def per_value(self, per_value): + """Sets the per_value of this DualGetPlans. + + Value Per Unit # noqa: E501 + + :param per_value: The per_value of this DualGetPlans. # noqa: E501 + :type: str + """ + + self._per_value = per_value + + @property + def apy_display(self): + """Gets the apy_display of this DualGetPlans. # noqa: E501 + + Annual Yield # noqa: E501 + + :return: The apy_display of this DualGetPlans. # noqa: E501 + :rtype: str + """ + return self._apy_display + + @apy_display.setter + def apy_display(self, apy_display): + """Sets the apy_display of this DualGetPlans. + + Annual Yield # noqa: E501 + + :param apy_display: The apy_display of this DualGetPlans. # noqa: E501 + :type: str + """ + + self._apy_display = apy_display + + @property + def start_time(self): + """Gets the start_time of this DualGetPlans. # noqa: E501 + + Start Time # noqa: E501 + + :return: The start_time of this DualGetPlans. # noqa: E501 + :rtype: int + """ + return self._start_time + + @start_time.setter + def start_time(self, start_time): + """Sets the start_time of this DualGetPlans. + + Start Time # noqa: E501 + + :param start_time: The start_time of this DualGetPlans. # noqa: E501 + :type: int + """ + + self._start_time = start_time + + @property + def end_time(self): + """Gets the end_time of this DualGetPlans. # noqa: E501 + + End time # noqa: E501 + + :return: The end_time of this DualGetPlans. # noqa: E501 + :rtype: int + """ + return self._end_time + + @end_time.setter + def end_time(self, end_time): + """Sets the end_time of this DualGetPlans. + + End time # noqa: E501 + + :param end_time: The end_time of this DualGetPlans. # noqa: E501 + :type: int + """ + + self._end_time = end_time + + @property + def status(self): + """Gets the status of this DualGetPlans. # noqa: E501 + + Status: `NOTSTARTED`-Not Started `ONGOING`-In Progress `ENDED`-Ended # noqa: E501 + + :return: The status of this DualGetPlans. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this DualGetPlans. + + Status: `NOTSTARTED`-Not Started `ONGOING`-In Progress `ENDED`-Ended # noqa: E501 + + :param status: The status of this DualGetPlans. # 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, DualGetPlans): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, DualGetPlans): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/eth2_rate_list.py b/gate_api/models/eth2_rate_list.py new file mode 100644 index 0000000..c714e00 --- /dev/null +++ b/gate_api/models/eth2_rate_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 Eth2RateList(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'date_time': 'int', + 'date': 'str', + 'rate': 'str' + } + + attribute_map = { + 'date_time': 'date_time', + 'date': 'date', + 'rate': 'rate' + } + + 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 + 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.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 + + @property + def date_time(self): + """Gets the date_time of this Eth2RateList. # noqa: E501 + + Date Timestamp # noqa: E501 + + :return: The date_time of this Eth2RateList. # noqa: E501 + :rtype: int + """ + return self._date_time + + @date_time.setter + def date_time(self, date_time): + """Sets the date_time of this Eth2RateList. + + Date Timestamp # noqa: E501 + + :param date_time: The date_time of this Eth2RateList. # noqa: E501 + :type: int + """ + + self._date_time = date_time + + @property + def date(self): + """Gets the date of this Eth2RateList. # noqa: E501 + + Date # noqa: E501 + + :return: The date of this Eth2RateList. # noqa: E501 + :rtype: str + """ + return self._date + + @date.setter + def date(self, date): + """Sets the date of this Eth2RateList. + + Date # noqa: E501 + + :param date: The date of this Eth2RateList. # noqa: E501 + :type: str + """ + + self._date = date + + @property + def rate(self): + """Gets the rate of this Eth2RateList. # noqa: E501 + + Percentage Rate # noqa: E501 + + :return: The rate of this Eth2RateList. # noqa: E501 + :rtype: str + """ + return self._rate + + @rate.setter + def rate(self, rate): + """Sets the rate of this Eth2RateList. + + Percentage Rate # noqa: E501 + + :param rate: The rate of this Eth2RateList. # noqa: E501 + :type: str + """ + + self._rate = 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, Eth2RateList): + return 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): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/eth2_swap.py b/gate_api/models/eth2_swap.py new file mode 100644 index 0000000..ac51063 --- /dev/null +++ b/gate_api/models/eth2_swap.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 Eth2Swap(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'amount': 'str' + } + + attribute_map = { + 'side': 'side', + 'amount': 'amount' + } + + def __init__(self, side=None, amount=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """Eth2Swap - a 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._amount = None + self.discriminator = None + + self.side = side + self.amount = amount + + @property + def side(self): + """Gets the side of this Eth2Swap. # noqa: E501 + + 1-Forward Swap (ETH -> ETH2), 2-Reverse Swap (ETH2 -> ETH) # noqa: E501 + + :return: The side of this Eth2Swap. # noqa: E501 + :rtype: str + """ + return self._side + + @side.setter + def side(self, side): + """Sets the side of this Eth2Swap. + + 1-Forward Swap (ETH -> ETH2), 2-Reverse Swap (ETH2 -> ETH) # noqa: E501 + + :param side: The side of this Eth2Swap. # 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 Eth2Swap. # noqa: E501 + + Swap Amount # noqa: E501 + + :return: The amount of this Eth2Swap. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this Eth2Swap. + + Swap Amount # noqa: E501 + + :param amount: The amount of this Eth2Swap. # 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, Eth2Swap): + return 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): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/find_coin.py b/gate_api/models/find_coin.py new file mode 100644 index 0000000..a73037a --- /dev/null +++ b/gate_api/models/find_coin.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 FindCoin(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'cointype': 'str' + } + + attribute_map = { + 'cointype': 'cointype' + } + + def __init__(self, cointype=None, local_vars_configuration=None): # noqa: E501 + # type: (str, Configuration) -> None + """FindCoin - a 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.discriminator = None + + if cointype is not None: + self.cointype = cointype + + @property + def cointype(self): + """Gets the cointype of this FindCoin. # noqa: E501 + + Currency type: swap - voucher; lock - locked position; debt - US Treasury bond. # noqa: E501 + + :return: The cointype of this FindCoin. # noqa: E501 + :rtype: str + """ + return self._cointype + + @cointype.setter + def cointype(self, cointype): + """Sets the cointype of this FindCoin. + + Currency type: swap - voucher; lock - locked position; debt - US Treasury bond. # noqa: E501 + + :param cointype: The cointype of this FindCoin. # noqa: E501 + :type: str + """ + + self._cointype = cointype + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FindCoin): + return 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): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/flash_swap_currency_pair.py b/gate_api/models/flash_swap_currency_pair.py new file mode 100644 index 0000000..5a9ed86 --- /dev/null +++ b/gate_api/models/flash_swap_currency_pair.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 FlashSwapCurrencyPair(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'sell_currency': 'str', + 'buy_currency': 'str', + 'sell_min_amount': 'str', + 'sell_max_amount': 'str', + 'buy_min_amount': 'str', + 'buy_max_amount': 'str' + } + + attribute_map = { + 'currency_pair': 'currency_pair', + 'sell_currency': 'sell_currency', + 'buy_currency': 'buy_currency', + 'sell_min_amount': 'sell_min_amount', + 'sell_max_amount': 'sell_max_amount', + 'buy_min_amount': 'buy_min_amount', + 'buy_max_amount': 'buy_max_amount' + } + + def __init__(self, currency_pair=None, sell_currency=None, buy_currency=None, sell_min_amount=None, sell_max_amount=None, buy_min_amount=None, buy_max_amount=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, Configuration) -> None + """FlashSwapCurrencyPair - a 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._sell_currency = None + self._buy_currency = None + self._sell_min_amount = None + self._sell_max_amount = None + self._buy_min_amount = None + self._buy_max_amount = None + self.discriminator = None + + if currency_pair is not None: + self.currency_pair = currency_pair + if sell_currency is not None: + self.sell_currency = sell_currency + if buy_currency is not None: + self.buy_currency = buy_currency + if sell_min_amount is not None: + self.sell_min_amount = sell_min_amount + if sell_max_amount is not None: + self.sell_max_amount = sell_max_amount + if buy_min_amount is not None: + self.buy_min_amount = buy_min_amount + if buy_max_amount is not None: + self.buy_max_amount = buy_max_amount + + @property + def currency_pair(self): + """Gets the currency_pair of this FlashSwapCurrencyPair. # noqa: E501 + + Currency pair, `BTC_USDT` represents selling `BTC` and buying `USDT` # noqa: E501 + + :return: The currency_pair of this FlashSwapCurrencyPair. # noqa: E501 + :rtype: str + """ + return self._currency_pair + + @currency_pair.setter + def currency_pair(self, currency_pair): + """Sets the currency_pair of this FlashSwapCurrencyPair. + + Currency pair, `BTC_USDT` represents selling `BTC` and buying `USDT` # noqa: E501 + + :param currency_pair: The currency_pair of this FlashSwapCurrencyPair. # noqa: E501 + :type: str + """ + + self._currency_pair = currency_pair + + @property + def sell_currency(self): + """Gets the sell_currency of this FlashSwapCurrencyPair. # noqa: E501 + + Currency to sell # noqa: E501 + + :return: The sell_currency of this FlashSwapCurrencyPair. # noqa: E501 + :rtype: str + """ + return self._sell_currency + + @sell_currency.setter + def sell_currency(self, sell_currency): + """Sets the sell_currency of this FlashSwapCurrencyPair. + + Currency to sell # noqa: E501 + + :param sell_currency: The sell_currency of this FlashSwapCurrencyPair. # noqa: E501 + :type: str + """ + + self._sell_currency = sell_currency + + @property + def buy_currency(self): + """Gets the buy_currency of this FlashSwapCurrencyPair. # noqa: E501 + + Currency to buy # noqa: E501 + + :return: The buy_currency of this FlashSwapCurrencyPair. # noqa: E501 + :rtype: str + """ + return self._buy_currency + + @buy_currency.setter + def buy_currency(self, buy_currency): + """Sets the buy_currency of this FlashSwapCurrencyPair. + + Currency to buy # noqa: E501 + + :param buy_currency: The buy_currency of this FlashSwapCurrencyPair. # noqa: E501 + :type: str + """ + + self._buy_currency = buy_currency + + @property + def sell_min_amount(self): + """Gets the sell_min_amount of this FlashSwapCurrencyPair. # noqa: E501 + + Minimum sell quantity # noqa: E501 + + :return: The sell_min_amount of this FlashSwapCurrencyPair. # noqa: E501 + :rtype: str + """ + return self._sell_min_amount + + @sell_min_amount.setter + def sell_min_amount(self, sell_min_amount): + """Sets the sell_min_amount of this FlashSwapCurrencyPair. + + Minimum sell quantity # noqa: E501 + + :param sell_min_amount: The sell_min_amount of this FlashSwapCurrencyPair. # noqa: E501 + :type: str + """ + + self._sell_min_amount = sell_min_amount + + @property + def sell_max_amount(self): + """Gets the sell_max_amount of this FlashSwapCurrencyPair. # noqa: E501 + + Maximum sell quantity # noqa: E501 + + :return: The sell_max_amount of this FlashSwapCurrencyPair. # noqa: E501 + :rtype: str + """ + return self._sell_max_amount + + @sell_max_amount.setter + def sell_max_amount(self, sell_max_amount): + """Sets the sell_max_amount of this FlashSwapCurrencyPair. + + Maximum sell quantity # noqa: E501 + + :param sell_max_amount: The sell_max_amount of this FlashSwapCurrencyPair. # noqa: E501 + :type: str + """ + + self._sell_max_amount = sell_max_amount + + @property + def buy_min_amount(self): + """Gets the buy_min_amount of this FlashSwapCurrencyPair. # noqa: E501 + + Minimum buy quantity # noqa: E501 + + :return: The buy_min_amount of this FlashSwapCurrencyPair. # noqa: E501 + :rtype: str + """ + return self._buy_min_amount + + @buy_min_amount.setter + def buy_min_amount(self, buy_min_amount): + """Sets the buy_min_amount of this FlashSwapCurrencyPair. + + Minimum buy quantity # noqa: E501 + + :param buy_min_amount: The buy_min_amount of this FlashSwapCurrencyPair. # noqa: E501 + :type: str + """ + + self._buy_min_amount = buy_min_amount + + @property + def buy_max_amount(self): + """Gets the buy_max_amount of this FlashSwapCurrencyPair. # noqa: E501 + + Maximum buy quantity # noqa: E501 + + :return: The buy_max_amount of this FlashSwapCurrencyPair. # noqa: E501 + :rtype: str + """ + return self._buy_max_amount + + @buy_max_amount.setter + def buy_max_amount(self, buy_max_amount): + """Sets the buy_max_amount of this FlashSwapCurrencyPair. + + Maximum buy quantity # noqa: E501 + + :param buy_max_amount: The buy_max_amount of this FlashSwapCurrencyPair. # noqa: E501 + :type: str + """ + + self._buy_max_amount = buy_max_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, FlashSwapCurrencyPair): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FlashSwapCurrencyPair): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/flash_swap_order.py b/gate_api/models/flash_swap_order.py new file mode 100644 index 0000000..2be7592 --- /dev/null +++ b/gate_api/models/flash_swap_order.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 FlashSwapOrder(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'create_time': 'int', + 'user_id': 'int', + 'sell_currency': 'str', + 'sell_amount': 'str', + 'buy_currency': 'str', + 'buy_amount': 'str', + 'price': 'str', + 'status': 'int' + } + + attribute_map = { + 'id': 'id', + 'create_time': 'create_time', + 'user_id': 'user_id', + 'sell_currency': 'sell_currency', + 'sell_amount': 'sell_amount', + 'buy_currency': 'buy_currency', + 'buy_amount': 'buy_amount', + 'price': 'price', + 'status': 'status' + } + + def __init__(self, id=None, create_time=None, user_id=None, sell_currency=None, sell_amount=None, buy_currency=None, buy_amount=None, price=None, status=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, int, str, str, str, str, str, int, Configuration) -> None + """FlashSwapOrder - a 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._create_time = None + self._user_id = None + self._sell_currency = None + self._sell_amount = None + self._buy_currency = None + self._buy_amount = None + self._price = None + self._status = None + self.discriminator = None + + if id is not None: + self.id = id + if create_time is not None: + self.create_time = create_time + if user_id is not None: + self.user_id = user_id + if sell_currency is not None: + self.sell_currency = sell_currency + if sell_amount is not None: + self.sell_amount = sell_amount + if buy_currency is not None: + self.buy_currency = buy_currency + if buy_amount is not None: + self.buy_amount = buy_amount + if price is not None: + self.price = price + if status is not None: + self.status = status + + @property + def id(self): + """Gets the id of this FlashSwapOrder. # noqa: E501 + + Flash swap order ID # noqa: E501 + + :return: The id of this FlashSwapOrder. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this FlashSwapOrder. + + Flash swap order ID # noqa: E501 + + :param id: The id of this FlashSwapOrder. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def create_time(self): + """Gets the create_time of this FlashSwapOrder. # noqa: E501 + + Creation time of order (in milliseconds) # noqa: E501 + + :return: The create_time of this FlashSwapOrder. # noqa: E501 + :rtype: int + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this FlashSwapOrder. + + Creation time of order (in milliseconds) # noqa: E501 + + :param create_time: The create_time of this FlashSwapOrder. # noqa: E501 + :type: int + """ + + self._create_time = create_time + + @property + def user_id(self): + """Gets the user_id of this FlashSwapOrder. # noqa: E501 + + User ID # noqa: E501 + + :return: The user_id of this FlashSwapOrder. # noqa: E501 + :rtype: int + """ + return self._user_id + + @user_id.setter + def user_id(self, user_id): + """Sets the user_id of this FlashSwapOrder. + + User ID # noqa: E501 + + :param user_id: The user_id of this FlashSwapOrder. # noqa: E501 + :type: int + """ + + self._user_id = user_id + + @property + def sell_currency(self): + """Gets the sell_currency of this FlashSwapOrder. # noqa: E501 + + Currency to sell # noqa: E501 + + :return: The sell_currency of this FlashSwapOrder. # noqa: E501 + :rtype: str + """ + return self._sell_currency + + @sell_currency.setter + def sell_currency(self, sell_currency): + """Sets the sell_currency of this FlashSwapOrder. + + Currency to sell # noqa: E501 + + :param sell_currency: The sell_currency of this FlashSwapOrder. # noqa: E501 + :type: str + """ + + self._sell_currency = sell_currency + + @property + def sell_amount(self): + """Gets the sell_amount of this FlashSwapOrder. # noqa: E501 + + Amount to sell # noqa: E501 + + :return: The sell_amount of this FlashSwapOrder. # noqa: E501 + :rtype: str + """ + return self._sell_amount + + @sell_amount.setter + def sell_amount(self, sell_amount): + """Sets the sell_amount of this FlashSwapOrder. + + Amount to sell # noqa: E501 + + :param sell_amount: The sell_amount of this FlashSwapOrder. # noqa: E501 + :type: str + """ + + self._sell_amount = sell_amount + + @property + def buy_currency(self): + """Gets the buy_currency of this FlashSwapOrder. # noqa: E501 + + Currency to buy # noqa: E501 + + :return: The buy_currency of this FlashSwapOrder. # noqa: E501 + :rtype: str + """ + return self._buy_currency + + @buy_currency.setter + def buy_currency(self, buy_currency): + """Sets the buy_currency of this FlashSwapOrder. + + Currency to buy # noqa: E501 + + :param buy_currency: The buy_currency of this FlashSwapOrder. # noqa: E501 + :type: str + """ + + self._buy_currency = buy_currency + + @property + def buy_amount(self): + """Gets the buy_amount of this FlashSwapOrder. # noqa: E501 + + Amount to buy # noqa: E501 + + :return: The buy_amount of this FlashSwapOrder. # noqa: E501 + :rtype: str + """ + return self._buy_amount + + @buy_amount.setter + def buy_amount(self, buy_amount): + """Sets the buy_amount of this FlashSwapOrder. + + Amount to buy # noqa: E501 + + :param buy_amount: The buy_amount of this FlashSwapOrder. # noqa: E501 + :type: str + """ + + self._buy_amount = buy_amount + + @property + def price(self): + """Gets the price of this FlashSwapOrder. # noqa: E501 + + Price # noqa: E501 + + :return: The price of this FlashSwapOrder. # noqa: E501 + :rtype: str + """ + return self._price + + @price.setter + def price(self, price): + """Sets the price of this FlashSwapOrder. + + Price # noqa: E501 + + :param price: The price of this FlashSwapOrder. # noqa: E501 + :type: str + """ + + self._price = price + + @property + def status(self): + """Gets the status of this FlashSwapOrder. # noqa: E501 + + Flash swap order status `1` - success `2` - failure # noqa: E501 + + :return: The status of this FlashSwapOrder. # noqa: E501 + :rtype: int + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this FlashSwapOrder. + + Flash swap order status `1` - success `2` - failure # noqa: E501 + + :param status: The status of this FlashSwapOrder. # 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, FlashSwapOrder): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FlashSwapOrder): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/flash_swap_order_preview.py b/gate_api/models/flash_swap_order_preview.py new file mode 100644 index 0000000..d137d5a --- /dev/null +++ b/gate_api/models/flash_swap_order_preview.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 FlashSwapOrderPreview(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'preview_id': 'str', + 'sell_currency': 'str', + 'sell_amount': 'str', + 'buy_currency': 'str', + 'buy_amount': 'str', + 'price': 'str' + } + + attribute_map = { + 'preview_id': 'preview_id', + 'sell_currency': 'sell_currency', + 'sell_amount': 'sell_amount', + 'buy_currency': 'buy_currency', + 'buy_amount': 'buy_amount', + 'price': 'price' + } + + def __init__(self, preview_id=None, sell_currency=None, sell_amount=None, buy_currency=None, buy_amount=None, price=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, Configuration) -> None + """FlashSwapOrderPreview - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._preview_id = None + self._sell_currency = None + self._sell_amount = None + self._buy_currency = None + self._buy_amount = None + self._price = None + self.discriminator = None + + if preview_id is not None: + self.preview_id = preview_id + if sell_currency is not None: + self.sell_currency = sell_currency + if sell_amount is not None: + self.sell_amount = sell_amount + if buy_currency is not None: + self.buy_currency = buy_currency + if buy_amount is not None: + self.buy_amount = buy_amount + if price is not None: + self.price = price + + @property + def preview_id(self): + """Gets the preview_id of this FlashSwapOrderPreview. # noqa: E501 + + Preview result ID # noqa: E501 + + :return: The preview_id of this FlashSwapOrderPreview. # noqa: E501 + :rtype: str + """ + return self._preview_id + + @preview_id.setter + def preview_id(self, preview_id): + """Sets the preview_id of this FlashSwapOrderPreview. + + Preview result ID # noqa: E501 + + :param preview_id: The preview_id of this FlashSwapOrderPreview. # noqa: E501 + :type: str + """ + + self._preview_id = preview_id + + @property + def sell_currency(self): + """Gets the sell_currency of this FlashSwapOrderPreview. # noqa: E501 + + Name of the sold asset, Refer to the interface Query the list of currencies supported for flash swap GET /flash_swap/currenciesto obtain # noqa: E501 + + :return: The sell_currency of this FlashSwapOrderPreview. # noqa: E501 + :rtype: str + """ + return self._sell_currency + + @sell_currency.setter + def sell_currency(self, sell_currency): + """Sets the sell_currency of this FlashSwapOrderPreview. + + Name of the sold asset, Refer to the interface Query the list of currencies supported for flash swap GET /flash_swap/currenciesto obtain # noqa: E501 + + :param sell_currency: The sell_currency of this FlashSwapOrderPreview. # noqa: E501 + :type: str + """ + + self._sell_currency = sell_currency + + @property + def sell_amount(self): + """Gets the sell_amount of this FlashSwapOrderPreview. # noqa: E501 + + Amount to sell # noqa: E501 + + :return: The sell_amount of this FlashSwapOrderPreview. # noqa: E501 + :rtype: str + """ + return self._sell_amount + + @sell_amount.setter + def sell_amount(self, sell_amount): + """Sets the sell_amount of this FlashSwapOrderPreview. + + Amount to sell # noqa: E501 + + :param sell_amount: The sell_amount of this FlashSwapOrderPreview. # noqa: E501 + :type: str + """ + + self._sell_amount = sell_amount + + @property + def buy_currency(self): + """Gets the buy_currency of this FlashSwapOrderPreview. # noqa: E501 + + Name of the purchased asset, Refer to the interface Query the list of currencies supported for flash swap GET /flash_swap/currenciesto obtain # noqa: E501 + + :return: The buy_currency of this FlashSwapOrderPreview. # noqa: E501 + :rtype: str + """ + return self._buy_currency + + @buy_currency.setter + def buy_currency(self, buy_currency): + """Sets the buy_currency of this FlashSwapOrderPreview. + + Name of the purchased asset, Refer to the interface Query the list of currencies supported for flash swap GET /flash_swap/currenciesto obtain # noqa: E501 + + :param buy_currency: The buy_currency of this FlashSwapOrderPreview. # noqa: E501 + :type: str + """ + + self._buy_currency = buy_currency + + @property + def buy_amount(self): + """Gets the buy_amount of this FlashSwapOrderPreview. # noqa: E501 + + Amount to buy # noqa: E501 + + :return: The buy_amount of this FlashSwapOrderPreview. # noqa: E501 + :rtype: str + """ + return self._buy_amount + + @buy_amount.setter + def buy_amount(self, buy_amount): + """Sets the buy_amount of this FlashSwapOrderPreview. + + Amount to buy # noqa: E501 + + :param buy_amount: The buy_amount of this FlashSwapOrderPreview. # noqa: E501 + :type: str + """ + + self._buy_amount = buy_amount + + @property + def price(self): + """Gets the price of this FlashSwapOrderPreview. # noqa: E501 + + Price # noqa: E501 + + :return: The price of this FlashSwapOrderPreview. # noqa: E501 + :rtype: str + """ + return self._price + + @price.setter + def price(self, price): + """Sets the price of this FlashSwapOrderPreview. + + Price # noqa: E501 + + :param price: The price of this FlashSwapOrderPreview. # 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, FlashSwapOrderPreview): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FlashSwapOrderPreview): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/flash_swap_order_request.py b/gate_api/models/flash_swap_order_request.py new file mode 100644 index 0000000..d89b46b --- /dev/null +++ b/gate_api/models/flash_swap_order_request.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 FlashSwapOrderRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'preview_id': 'str', + 'sell_currency': 'str', + 'sell_amount': 'str', + 'buy_currency': 'str', + 'buy_amount': 'str' + } + + attribute_map = { + 'preview_id': 'preview_id', + 'sell_currency': 'sell_currency', + 'sell_amount': 'sell_amount', + 'buy_currency': 'buy_currency', + 'buy_amount': 'buy_amount' + } + + def __init__(self, preview_id=None, sell_currency=None, sell_amount=None, buy_currency=None, buy_amount=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, Configuration) -> None + """FlashSwapOrderRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._preview_id = None + self._sell_currency = None + self._sell_amount = None + self._buy_currency = None + self._buy_amount = None + self.discriminator = None + + self.preview_id = preview_id + self.sell_currency = sell_currency + self.sell_amount = sell_amount + self.buy_currency = buy_currency + self.buy_amount = buy_amount + + @property + def preview_id(self): + """Gets the preview_id of this FlashSwapOrderRequest. # noqa: E501 + + Preview result ID # noqa: E501 + + :return: The preview_id of this FlashSwapOrderRequest. # noqa: E501 + :rtype: str + """ + return self._preview_id + + @preview_id.setter + def preview_id(self, preview_id): + """Sets the preview_id of this FlashSwapOrderRequest. + + Preview result ID # noqa: E501 + + :param preview_id: The preview_id of this FlashSwapOrderRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and preview_id is None: # noqa: E501 + raise ValueError("Invalid value for `preview_id`, must not be `None`") # noqa: E501 + + self._preview_id = preview_id + + @property + def sell_currency(self): + """Gets the sell_currency of this FlashSwapOrderRequest. # noqa: E501 + + Name of the asset to be sold, obtained from the interface GET /flash_swap/currency_pairs: Query the list of all trading pairs supporting flash swap # noqa: E501 + + :return: The sell_currency of this FlashSwapOrderRequest. # noqa: E501 + :rtype: str + """ + return self._sell_currency + + @sell_currency.setter + def sell_currency(self, sell_currency): + """Sets the sell_currency of this FlashSwapOrderRequest. + + Name of the asset to be sold, obtained from the interface GET /flash_swap/currency_pairs: Query the list of all trading pairs supporting flash swap # noqa: E501 + + :param sell_currency: The sell_currency of this FlashSwapOrderRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and sell_currency is None: # noqa: E501 + raise ValueError("Invalid value for `sell_currency`, must not be `None`") # noqa: E501 + + self._sell_currency = sell_currency + + @property + def sell_amount(self): + """Gets the sell_amount of this FlashSwapOrderRequest. # noqa: E501 + + Amount to sell (based on the preview result) # noqa: E501 + + :return: The sell_amount of this FlashSwapOrderRequest. # noqa: E501 + :rtype: str + """ + return self._sell_amount + + @sell_amount.setter + def sell_amount(self, sell_amount): + """Sets the sell_amount of this FlashSwapOrderRequest. + + Amount to sell (based on the preview result) # noqa: E501 + + :param sell_amount: The sell_amount of this FlashSwapOrderRequest. # 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_currency(self): + """Gets the buy_currency of this FlashSwapOrderRequest. # noqa: E501 + + Name of the asset to be bought, obtained from the interface GET /flash_swap/currency_pairs: Query the list of all trading pairs supporting flash swap # noqa: E501 + + :return: The buy_currency of this FlashSwapOrderRequest. # noqa: E501 + :rtype: str + """ + return self._buy_currency + + @buy_currency.setter + def buy_currency(self, buy_currency): + """Sets the buy_currency of this FlashSwapOrderRequest. + + Name of the asset to be bought, obtained from the interface GET /flash_swap/currency_pairs: Query the list of all trading pairs supporting flash swap # noqa: E501 + + :param buy_currency: The buy_currency of this FlashSwapOrderRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and buy_currency is None: # noqa: E501 + raise ValueError("Invalid value for `buy_currency`, must not be `None`") # noqa: E501 + + self._buy_currency = buy_currency + + @property + def buy_amount(self): + """Gets the buy_amount of this FlashSwapOrderRequest. # noqa: E501 + + Amount to buy (based on the preview result) # noqa: E501 + + :return: The buy_amount of this FlashSwapOrderRequest. # noqa: E501 + :rtype: str + """ + return self._buy_amount + + @buy_amount.setter + def buy_amount(self, buy_amount): + """Sets the buy_amount of this FlashSwapOrderRequest. + + Amount to buy (based on the preview result) # noqa: E501 + + :param buy_amount: The buy_amount of this FlashSwapOrderRequest. # 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, FlashSwapOrderRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FlashSwapOrderRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/flash_swap_preview_request.py b/gate_api/models/flash_swap_preview_request.py new file mode 100644 index 0000000..3cfe1d1 --- /dev/null +++ b/gate_api/models/flash_swap_preview_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 FlashSwapPreviewRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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_currency': 'str', + 'sell_amount': 'str', + 'buy_currency': 'str', + 'buy_amount': 'str' + } + + attribute_map = { + 'sell_currency': 'sell_currency', + 'sell_amount': 'sell_amount', + 'buy_currency': 'buy_currency', + 'buy_amount': 'buy_amount' + } + + def __init__(self, sell_currency=None, sell_amount=None, buy_currency=None, buy_amount=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, Configuration) -> None + """FlashSwapPreviewRequest - a 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_currency = None + self._sell_amount = None + self._buy_currency = None + self._buy_amount = None + self.discriminator = None + + self.sell_currency = sell_currency + if sell_amount is not None: + self.sell_amount = sell_amount + self.buy_currency = buy_currency + if buy_amount is not None: + self.buy_amount = buy_amount + + @property + def sell_currency(self): + """Gets the sell_currency of this FlashSwapPreviewRequest. # noqa: E501 + + The name of the asset being sold, as obtained from the \"GET /flash_swap/currency_pairs\" API, which retrieves a list of supported flash swap currency pairs # noqa: E501 + + :return: The sell_currency of this FlashSwapPreviewRequest. # noqa: E501 + :rtype: str + """ + return self._sell_currency + + @sell_currency.setter + def sell_currency(self, sell_currency): + """Sets the sell_currency of this FlashSwapPreviewRequest. + + The name of the asset being sold, as obtained from the \"GET /flash_swap/currency_pairs\" API, which retrieves a list of supported flash swap currency pairs # noqa: E501 + + :param sell_currency: The sell_currency of this FlashSwapPreviewRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and sell_currency is None: # noqa: E501 + raise ValueError("Invalid value for `sell_currency`, must not be `None`") # noqa: E501 + + self._sell_currency = sell_currency + + @property + def sell_amount(self): + """Gets the sell_amount of this FlashSwapPreviewRequest. # noqa: E501 + + Amount to sell. It is required to choose one parameter between `sell_amount` and `buy_amount` # noqa: E501 + + :return: The sell_amount of this FlashSwapPreviewRequest. # noqa: E501 + :rtype: str + """ + return self._sell_amount + + @sell_amount.setter + def sell_amount(self, sell_amount): + """Sets the sell_amount of this FlashSwapPreviewRequest. + + Amount to sell. It is required to choose one parameter between `sell_amount` and `buy_amount` # noqa: E501 + + :param sell_amount: The sell_amount of this FlashSwapPreviewRequest. # noqa: E501 + :type: str + """ + + self._sell_amount = sell_amount + + @property + def buy_currency(self): + """Gets the buy_currency of this FlashSwapPreviewRequest. # noqa: E501 + + The name of the asset being purchased, as obtained from the \"GET /flash_swap/currency_pairs\" API, which provides a list of supported flash swap currency pairs # noqa: E501 + + :return: The buy_currency of this FlashSwapPreviewRequest. # noqa: E501 + :rtype: str + """ + return self._buy_currency + + @buy_currency.setter + def buy_currency(self, buy_currency): + """Sets the buy_currency of this FlashSwapPreviewRequest. + + The name of the asset being purchased, as obtained from the \"GET /flash_swap/currency_pairs\" API, which provides a list of supported flash swap currency pairs # noqa: E501 + + :param buy_currency: The buy_currency of this FlashSwapPreviewRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and buy_currency is None: # noqa: E501 + raise ValueError("Invalid value for `buy_currency`, must not be `None`") # noqa: E501 + + self._buy_currency = buy_currency + + @property + def buy_amount(self): + """Gets the buy_amount of this FlashSwapPreviewRequest. # noqa: E501 + + Amount to buy. It is required to choose one parameter between `sell_amount` and `buy_amount` # noqa: E501 + + :return: The buy_amount of this FlashSwapPreviewRequest. # noqa: E501 + :rtype: str + """ + return self._buy_amount + + @buy_amount.setter + def buy_amount(self, buy_amount): + """Sets the buy_amount of this FlashSwapPreviewRequest. + + Amount to buy. It is required to choose one parameter between `sell_amount` and `buy_amount` # noqa: E501 + + :param buy_amount: The buy_amount of this FlashSwapPreviewRequest. # 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, FlashSwapPreviewRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FlashSwapPreviewRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/funding_account.py b/gate_api/models/funding_account.py index bd4fa7b..9ba5a0f 100644 --- a/gate_api/models/funding_account.py +++ b/gate_api/models/funding_account.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -32,19 +32,23 @@ class FundingAccount(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {'currency': 'str', 'available': 'str', 'locked': 'str', 'lent': 'str', 'total_lent': 'str'} + openapi_types = { + 'currency': 'str', + 'available': 'str', + 'locked': 'str', + 'lent': 'str', + 'total_lent': 'str' + } attribute_map = { 'currency': 'currency', 'available': 'available', 'locked': 'locked', 'lent': 'lent', - 'total_lent': 'total_lent', + 'total_lent': 'total_lent' } - def __init__( - self, currency=None, available=None, locked=None, lent=None, total_lent=None, local_vars_configuration=None - ): # noqa: E501 + def __init__(self, currency=None, available=None, locked=None, lent=None, total_lent=None, local_vars_configuration=None): # noqa: E501 # type: (str, str, str, str, str, Configuration) -> None """FundingAccount - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: @@ -191,16 +195,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/funding_book_item.py b/gate_api/models/funding_book_item.py deleted file mode 100644 index 20a00c3..0000000 --- a/gate_api/models/funding_book_item.py +++ /dev/null @@ -1,169 +0,0 @@ -# coding: utf-8 - -""" - Gate API v4 - - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 - - Contact: support@mail.gate.io - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from gate_api.configuration import Configuration - - -class FundingBookItem(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - 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', 'amount': 'str', 'days': 'int'} - - attribute_map = {'rate': 'rate', 'amount': 'amount', 'days': 'days'} - - def __init__(self, rate=None, amount=None, days=None, local_vars_configuration=None): # noqa: E501 - # type: (str, str, int, Configuration) -> None - """FundingBookItem - a 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._amount = None - self._days = None - self.discriminator = None - - if rate is not None: - self.rate = rate - if amount is not None: - self.amount = amount - if days is not None: - self.days = days - - @property - def rate(self): - """Gets the rate of this FundingBookItem. # noqa: E501 - - Loan rate # noqa: E501 - - :return: The rate of this FundingBookItem. # noqa: E501 - :rtype: str - """ - return self._rate - - @rate.setter - def rate(self, rate): - """Sets the rate of this FundingBookItem. - - Loan rate # noqa: E501 - - :param rate: The rate of this FundingBookItem. # noqa: E501 - :type: str - """ - - self._rate = rate - - @property - def amount(self): - """Gets the amount of this FundingBookItem. # noqa: E501 - - Borrowable amount # noqa: E501 - - :return: The amount of this FundingBookItem. # noqa: E501 - :rtype: str - """ - return self._amount - - @amount.setter - def amount(self, amount): - """Sets the amount of this FundingBookItem. - - Borrowable amount # noqa: E501 - - :param amount: The amount of this FundingBookItem. # noqa: E501 - :type: str - """ - - self._amount = amount - - @property - def days(self): - """Gets the days of this FundingBookItem. # noqa: E501 - - The number of days till the loan repayment's dateline # noqa: E501 - - :return: The days of this FundingBookItem. # noqa: E501 - :rtype: int - """ - return self._days - - @days.setter - def days(self, days): - """Sets the days of this FundingBookItem. - - The number of days till the loan repayment's dateline # noqa: E501 - - :param days: The days of this FundingBookItem. # noqa: E501 - :type: int - """ - - self._days = days - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, FundingBookItem): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, FundingBookItem): - return True - - return self.to_dict() != other.to_dict() diff --git a/gate_api/models/funding_rate_record.py b/gate_api/models/funding_rate_record.py index 3658aaa..cf06b1c 100644 --- a/gate_api/models/funding_rate_record.py +++ b/gate_api/models/funding_rate_record.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -32,9 +32,15 @@ class FundingRateRecord(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {'t': 'int', 'r': 'str'} + openapi_types = { + 't': 'int', + 'r': 'str' + } - attribute_map = {'t': 't', 'r': 'r'} + attribute_map = { + 't': 't', + 'r': 'r' + } def __init__(self, t=None, r=None, local_vars_configuration=None): # noqa: E501 # type: (int, str, Configuration) -> None @@ -105,16 +111,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/future_cancel_order_result.py b/gate_api/models/future_cancel_order_result.py new file mode 100644 index 0000000..7f7ccd4 --- /dev/null +++ b/gate_api/models/future_cancel_order_result.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 FutureCancelOrderResult(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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': 'int', + 'succeeded': 'bool', + 'message': 'str' + } + + attribute_map = { + 'id': 'id', + 'user_id': 'user_id', + 'succeeded': 'succeeded', + 'message': 'message' + } + + def __init__(self, id=None, user_id=None, succeeded=None, message=None, local_vars_configuration=None): # noqa: E501 + # type: (str, int, bool, str, Configuration) -> None + """FutureCancelOrderResult - a 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._succeeded = None + self._message = None + self.discriminator = None + + if id is not None: + self.id = id + if user_id is not None: + self.user_id = user_id + if succeeded is not None: + self.succeeded = succeeded + if message is not None: + self.message = message + + @property + def id(self): + """Gets the id of this FutureCancelOrderResult. # noqa: E501 + + Order ID # noqa: E501 + + :return: The id of this FutureCancelOrderResult. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this FutureCancelOrderResult. + + Order ID # noqa: E501 + + :param id: The id of this FutureCancelOrderResult. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def user_id(self): + """Gets the user_id of this FutureCancelOrderResult. # noqa: E501 + + User ID # noqa: E501 + + :return: The user_id of this FutureCancelOrderResult. # noqa: E501 + :rtype: int + """ + return self._user_id + + @user_id.setter + def user_id(self, user_id): + """Sets the user_id of this FutureCancelOrderResult. + + User ID # noqa: E501 + + :param user_id: The user_id of this FutureCancelOrderResult. # noqa: E501 + :type: int + """ + + self._user_id = user_id + + @property + def succeeded(self): + """Gets the succeeded of this FutureCancelOrderResult. # noqa: E501 + + Whether cancellation succeeded # noqa: E501 + + :return: The succeeded of this FutureCancelOrderResult. # noqa: E501 + :rtype: bool + """ + return self._succeeded + + @succeeded.setter + def succeeded(self, succeeded): + """Sets the succeeded of this FutureCancelOrderResult. + + Whether cancellation succeeded # noqa: E501 + + :param succeeded: The succeeded of this FutureCancelOrderResult. # noqa: E501 + :type: bool + """ + + self._succeeded = succeeded + + @property + def message(self): + """Gets the message of this FutureCancelOrderResult. # noqa: E501 + + Error description when cancellation fails, empty if successful # noqa: E501 + + :return: The message of this FutureCancelOrderResult. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this FutureCancelOrderResult. + + Error description when cancellation fails, empty if successful # noqa: E501 + + :param message: The message of this FutureCancelOrderResult. # 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, FutureCancelOrderResult): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FutureCancelOrderResult): + 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 2a06006..6855e9f 100644 --- a/gate_api/models/futures_account.py +++ b/gate_api/models/futures_account.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -41,6 +41,25 @@ class FuturesAccount(object): 'point': 'str', 'currency': 'str', 'in_dual_mode': 'bool', + 'position_mode': 'str', + 'enable_credit': 'bool', + 'position_initial_margin': 'str', + 'maintenance_margin': 'str', + 'bonus': 'str', + 'enable_evolved_classic': 'bool', + 'cross_order_margin': 'str', + 'cross_initial_margin': 'str', + 'cross_maintenance_margin': 'str', + 'cross_unrealised_pnl': 'str', + 'cross_available': 'str', + 'cross_margin_balance': 'str', + 'cross_mmr': 'str', + 'cross_imr': 'str', + 'isolated_position_margin': 'str', + 'enable_new_dual_mode': 'bool', + 'margin_mode': 'int', + 'enable_tiered_mm': 'bool', + 'history': 'FuturesAccountHistory' } attribute_map = { @@ -52,21 +71,29 @@ 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', + 'bonus': 'bonus', + 'enable_evolved_classic': 'enable_evolved_classic', + 'cross_order_margin': 'cross_order_margin', + 'cross_initial_margin': 'cross_initial_margin', + 'cross_maintenance_margin': 'cross_maintenance_margin', + 'cross_unrealised_pnl': 'cross_unrealised_pnl', + 'cross_available': 'cross_available', + 'cross_margin_balance': 'cross_margin_balance', + 'cross_mmr': 'cross_mmr', + 'cross_imr': 'cross_imr', + 'isolated_position_margin': 'isolated_position_margin', + 'enable_new_dual_mode': 'enable_new_dual_mode', + 'margin_mode': 'margin_mode', + 'enable_tiered_mm': 'enable_tiered_mm', + '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, - local_vars_configuration=None, - ): # noqa: E501 - # type: (str, str, str, str, str, str, str, bool, 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, 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 """FuturesAccount - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -80,6 +107,25 @@ def __init__( 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 + self._bonus = None + self._enable_evolved_classic = None + self._cross_order_margin = None + self._cross_initial_margin = None + self._cross_maintenance_margin = None + self._cross_unrealised_pnl = None + self._cross_available = None + self._cross_margin_balance = None + self._cross_mmr = None + self._cross_imr = None + self._isolated_position_margin = None + self._enable_new_dual_mode = None + self._margin_mode = None + self._enable_tiered_mm = None + self._history = None self.discriminator = None if total is not None: @@ -98,12 +144,50 @@ def __init__( 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: + self.position_initial_margin = position_initial_margin + if maintenance_margin is not None: + self.maintenance_margin = maintenance_margin + if bonus is not None: + self.bonus = bonus + if enable_evolved_classic is not None: + self.enable_evolved_classic = enable_evolved_classic + if cross_order_margin is not None: + self.cross_order_margin = cross_order_margin + if cross_initial_margin is not None: + self.cross_initial_margin = cross_initial_margin + if cross_maintenance_margin is not None: + self.cross_maintenance_margin = cross_maintenance_margin + if cross_unrealised_pnl is not None: + self.cross_unrealised_pnl = cross_unrealised_pnl + if cross_available is not None: + self.cross_available = cross_available + if cross_margin_balance is not None: + self.cross_margin_balance = cross_margin_balance + if cross_mmr is not None: + self.cross_mmr = cross_mmr + if cross_imr is not None: + self.cross_imr = cross_imr + if isolated_position_margin is not None: + self.isolated_position_margin = isolated_position_margin + if enable_new_dual_mode is not None: + self.enable_new_dual_mode = enable_new_dual_mode + if margin_mode is not None: + self.margin_mode = margin_mode + if enable_tiered_mm is not None: + self.enable_tiered_mm = enable_tiered_mm + if history is not None: + self.history = history @property def total(self): """Gets the total of this FuturesAccount. # noqa: E501 - Total assets, total = position_margin + order_margin + available # noqa: E501 + total is the balance after the user's accumulated deposit, withdraw, profit and loss (including realized profit and loss, fund, fee and referral rebate), excluding unrealized profit and loss. total = SUM(history_dnw, history_pnl, history_fee, history_refr, history_fund) # noqa: E501 :return: The total of this FuturesAccount. # noqa: E501 :rtype: str @@ -114,7 +198,7 @@ def total(self): def total(self, total): """Sets the total of this FuturesAccount. - Total assets, total = position_margin + order_margin + available # noqa: E501 + total is the balance after the user's accumulated deposit, withdraw, profit and loss (including realized profit and loss, fund, fee and referral rebate), excluding unrealized profit and loss. total = SUM(history_dnw, history_pnl, history_fee, history_refr, history_fund) # noqa: E501 :param total: The total of this FuturesAccount. # noqa: E501 :type: str @@ -195,7 +279,7 @@ def order_margin(self, order_margin): def available(self): """Gets the available of this FuturesAccount. # noqa: E501 - Available balance to transfer out or trade # noqa: E501 + Available balance for transferring or trading (including bonus. Bonus cannot be withdrawn, so transfer amount needs to deduct bonus) # noqa: E501 :return: The available of this FuturesAccount. # noqa: E501 :rtype: str @@ -206,7 +290,7 @@ def available(self): def available(self, available): """Sets the available of this FuturesAccount. - Available balance to transfer out or trade # noqa: E501 + Available balance for transferring or trading (including bonus. Bonus cannot be withdrawn, so transfer amount needs to deduct bonus) # noqa: E501 :param available: The available of this FuturesAccount. # noqa: E501 :type: str @@ -218,7 +302,7 @@ def available(self, available): def point(self): """Gets the point of this FuturesAccount. # noqa: E501 - POINT amount # noqa: E501 + Point card amount # noqa: E501 :return: The point of this FuturesAccount. # noqa: E501 :rtype: str @@ -229,7 +313,7 @@ def point(self): def point(self, point): """Sets the point of this FuturesAccount. - POINT amount # noqa: E501 + Point card amount # noqa: E501 :param point: The point of this FuturesAccount. # noqa: E501 :type: str @@ -241,7 +325,7 @@ def point(self, point): def currency(self): """Gets the currency of this FuturesAccount. # noqa: E501 - Settle currency # noqa: E501 + Settlement currency # noqa: E501 :return: The currency of this FuturesAccount. # noqa: E501 :rtype: str @@ -252,7 +336,7 @@ def currency(self): def currency(self, currency): """Sets the currency of this FuturesAccount. - Settle currency # noqa: E501 + Settlement currency # noqa: E501 :param currency: The currency of this FuturesAccount. # noqa: E501 :type: str @@ -283,6 +367,441 @@ 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 + + Whether portfolio margin account mode is enabled # noqa: E501 + + :return: The enable_credit of this FuturesAccount. # noqa: E501 + :rtype: bool + """ + return self._enable_credit + + @enable_credit.setter + def enable_credit(self, enable_credit): + """Sets the enable_credit of this FuturesAccount. + + Whether portfolio margin account mode is enabled # noqa: E501 + + :param enable_credit: The enable_credit of this FuturesAccount. # noqa: E501 + :type: bool + """ + + self._enable_credit = enable_credit + + @property + def position_initial_margin(self): + """Gets the position_initial_margin of this FuturesAccount. # noqa: E501 + + Initial margin occupied by positions, applicable to unified account mode # noqa: E501 + + :return: The position_initial_margin of this FuturesAccount. # noqa: E501 + :rtype: str + """ + return self._position_initial_margin + + @position_initial_margin.setter + def position_initial_margin(self, position_initial_margin): + """Sets the position_initial_margin of this FuturesAccount. + + Initial margin occupied by positions, applicable to unified account mode # noqa: E501 + + :param position_initial_margin: The position_initial_margin of this FuturesAccount. # noqa: E501 + :type: str + """ + + self._position_initial_margin = position_initial_margin + + @property + def maintenance_margin(self): + """Gets the maintenance_margin of this FuturesAccount. # noqa: E501 + + Maintenance margin occupied by positions, applicable to new classic account margin mode and unified account mode # noqa: E501 + + :return: The maintenance_margin of this FuturesAccount. # noqa: E501 + :rtype: str + """ + return self._maintenance_margin + + @maintenance_margin.setter + def maintenance_margin(self, maintenance_margin): + """Sets the maintenance_margin of this FuturesAccount. + + Maintenance margin occupied by positions, applicable to new classic account margin mode and unified account mode # noqa: E501 + + :param maintenance_margin: The maintenance_margin of this FuturesAccount. # noqa: E501 + :type: str + """ + + self._maintenance_margin = maintenance_margin + + @property + def bonus(self): + """Gets the bonus of this FuturesAccount. # noqa: E501 + + Bonus # noqa: E501 + + :return: The bonus of this FuturesAccount. # noqa: E501 + :rtype: str + """ + return self._bonus + + @bonus.setter + def bonus(self, bonus): + """Sets the bonus of this FuturesAccount. + + Bonus # noqa: E501 + + :param bonus: The bonus of this FuturesAccount. # noqa: E501 + :type: str + """ + + self._bonus = bonus + + @property + def enable_evolved_classic(self): + """Gets the enable_evolved_classic of this FuturesAccount. # noqa: E501 + + Classic account margin mode, true-new mode, false-old mode # noqa: E501 + + :return: The enable_evolved_classic of this FuturesAccount. # noqa: E501 + :rtype: bool + """ + return self._enable_evolved_classic + + @enable_evolved_classic.setter + def enable_evolved_classic(self, enable_evolved_classic): + """Sets the enable_evolved_classic of this FuturesAccount. + + Classic account margin mode, true-new mode, false-old mode # noqa: E501 + + :param enable_evolved_classic: The enable_evolved_classic of this FuturesAccount. # noqa: E501 + :type: bool + """ + + self._enable_evolved_classic = enable_evolved_classic + + @property + def cross_order_margin(self): + """Gets the cross_order_margin of this FuturesAccount. # noqa: E501 + + Cross margin order margin, applicable to new classic account margin mode # noqa: E501 + + :return: The cross_order_margin of this FuturesAccount. # noqa: E501 + :rtype: str + """ + return self._cross_order_margin + + @cross_order_margin.setter + def cross_order_margin(self, cross_order_margin): + """Sets the cross_order_margin of this FuturesAccount. + + Cross margin order margin, applicable to new classic account margin mode # noqa: E501 + + :param cross_order_margin: The cross_order_margin of this FuturesAccount. # noqa: E501 + :type: str + """ + + self._cross_order_margin = cross_order_margin + + @property + def cross_initial_margin(self): + """Gets the cross_initial_margin of this FuturesAccount. # noqa: E501 + + Cross margin initial margin, applicable to new classic account margin mode # noqa: E501 + + :return: The cross_initial_margin of this FuturesAccount. # noqa: E501 + :rtype: str + """ + return self._cross_initial_margin + + @cross_initial_margin.setter + def cross_initial_margin(self, cross_initial_margin): + """Sets the cross_initial_margin of this FuturesAccount. + + Cross margin initial margin, applicable to new classic account margin mode # noqa: E501 + + :param cross_initial_margin: The cross_initial_margin of this FuturesAccount. # noqa: E501 + :type: str + """ + + self._cross_initial_margin = cross_initial_margin + + @property + def cross_maintenance_margin(self): + """Gets the cross_maintenance_margin of this FuturesAccount. # noqa: E501 + + Cross margin maintenance margin, applicable to new classic account margin mode # noqa: E501 + + :return: The cross_maintenance_margin of this FuturesAccount. # noqa: E501 + :rtype: str + """ + return self._cross_maintenance_margin + + @cross_maintenance_margin.setter + def cross_maintenance_margin(self, cross_maintenance_margin): + """Sets the cross_maintenance_margin of this FuturesAccount. + + Cross margin maintenance margin, applicable to new classic account margin mode # noqa: E501 + + :param cross_maintenance_margin: The cross_maintenance_margin of this FuturesAccount. # noqa: E501 + :type: str + """ + + self._cross_maintenance_margin = cross_maintenance_margin + + @property + def cross_unrealised_pnl(self): + """Gets the cross_unrealised_pnl of this FuturesAccount. # noqa: E501 + + Cross margin unrealized P&L, applicable to new classic account margin mode # noqa: E501 + + :return: The cross_unrealised_pnl of this FuturesAccount. # noqa: E501 + :rtype: str + """ + return self._cross_unrealised_pnl + + @cross_unrealised_pnl.setter + def cross_unrealised_pnl(self, cross_unrealised_pnl): + """Sets the cross_unrealised_pnl of this FuturesAccount. + + Cross margin unrealized P&L, applicable to new classic account margin mode # noqa: E501 + + :param cross_unrealised_pnl: The cross_unrealised_pnl of this FuturesAccount. # noqa: E501 + :type: str + """ + + self._cross_unrealised_pnl = cross_unrealised_pnl + + @property + def cross_available(self): + """Gets the cross_available of this FuturesAccount. # noqa: E501 + + Cross margin available balance, applicable to new classic account margin mode # noqa: E501 + + :return: The cross_available of this FuturesAccount. # noqa: E501 + :rtype: str + """ + return self._cross_available + + @cross_available.setter + def cross_available(self, cross_available): + """Sets the cross_available of this FuturesAccount. + + Cross margin available balance, applicable to new classic account margin mode # noqa: E501 + + :param cross_available: The cross_available of this FuturesAccount. # noqa: E501 + :type: str + """ + + self._cross_available = cross_available + + @property + def cross_margin_balance(self): + """Gets the cross_margin_balance of this FuturesAccount. # noqa: E501 + + Cross margin balance, applicable to new classic account margin mode # noqa: E501 + + :return: The cross_margin_balance of this FuturesAccount. # noqa: E501 + :rtype: str + """ + return self._cross_margin_balance + + @cross_margin_balance.setter + def cross_margin_balance(self, cross_margin_balance): + """Sets the cross_margin_balance of this FuturesAccount. + + Cross margin balance, applicable to new classic account margin mode # noqa: E501 + + :param cross_margin_balance: The cross_margin_balance of this FuturesAccount. # noqa: E501 + :type: str + """ + + self._cross_margin_balance = cross_margin_balance + + @property + def cross_mmr(self): + """Gets the cross_mmr of this FuturesAccount. # noqa: E501 + + Cross margin maintenance margin rate, applicable to new classic account margin mode # noqa: E501 + + :return: The cross_mmr of this FuturesAccount. # noqa: E501 + :rtype: str + """ + return self._cross_mmr + + @cross_mmr.setter + def cross_mmr(self, cross_mmr): + """Sets the cross_mmr of this FuturesAccount. + + Cross margin maintenance margin rate, applicable to new classic account margin mode # noqa: E501 + + :param cross_mmr: The cross_mmr of this FuturesAccount. # noqa: E501 + :type: str + """ + + self._cross_mmr = cross_mmr + + @property + def cross_imr(self): + """Gets the cross_imr of this FuturesAccount. # noqa: E501 + + Cross margin initial margin rate, applicable to new classic account margin mode # noqa: E501 + + :return: The cross_imr of this FuturesAccount. # noqa: E501 + :rtype: str + """ + return self._cross_imr + + @cross_imr.setter + def cross_imr(self, cross_imr): + """Sets the cross_imr of this FuturesAccount. + + Cross margin initial margin rate, applicable to new classic account margin mode # noqa: E501 + + :param cross_imr: The cross_imr of this FuturesAccount. # noqa: E501 + :type: str + """ + + self._cross_imr = cross_imr + + @property + def isolated_position_margin(self): + """Gets the isolated_position_margin of this FuturesAccount. # noqa: E501 + + Isolated position margin, applicable to new classic account margin mode # noqa: E501 + + :return: The isolated_position_margin of this FuturesAccount. # noqa: E501 + :rtype: str + """ + return self._isolated_position_margin + + @isolated_position_margin.setter + def isolated_position_margin(self, isolated_position_margin): + """Sets the isolated_position_margin of this FuturesAccount. + + Isolated position margin, applicable to new classic account margin mode # noqa: E501 + + :param isolated_position_margin: The isolated_position_margin of this FuturesAccount. # noqa: E501 + :type: str + """ + + self._isolated_position_margin = isolated_position_margin + + @property + def enable_new_dual_mode(self): + """Gets the enable_new_dual_mode of this FuturesAccount. # noqa: E501 + + Whether to open a new two-way position mode # noqa: E501 + + :return: The enable_new_dual_mode of this FuturesAccount. # noqa: E501 + :rtype: bool + """ + return self._enable_new_dual_mode + + @enable_new_dual_mode.setter + def enable_new_dual_mode(self, enable_new_dual_mode): + """Sets the enable_new_dual_mode of this FuturesAccount. + + Whether to open a new two-way position mode # noqa: E501 + + :param enable_new_dual_mode: The enable_new_dual_mode of this FuturesAccount. # noqa: E501 + :type: bool + """ + + self._enable_new_dual_mode = enable_new_dual_mode + + @property + def margin_mode(self): + """Gets the margin_mode of this FuturesAccount. # noqa: E501 + + Margin mode, 0-classic margin mode, 1-cross-currency margin mode, 2-combined margin mode # noqa: E501 + + :return: The margin_mode of this FuturesAccount. # noqa: E501 + :rtype: int + """ + return self._margin_mode + + @margin_mode.setter + def margin_mode(self, margin_mode): + """Sets the margin_mode of this FuturesAccount. + + Margin mode, 0-classic margin mode, 1-cross-currency margin mode, 2-combined margin mode # noqa: E501 + + :param margin_mode: The margin_mode of this FuturesAccount. # noqa: E501 + :type: int + """ + + self._margin_mode = margin_mode + + @property + def enable_tiered_mm(self): + """Gets the enable_tiered_mm of this FuturesAccount. # noqa: E501 + + Whether to enable tiered maintenance margin calculation # noqa: E501 + + :return: The enable_tiered_mm of this FuturesAccount. # noqa: E501 + :rtype: bool + """ + return self._enable_tiered_mm + + @enable_tiered_mm.setter + def enable_tiered_mm(self, enable_tiered_mm): + """Sets the enable_tiered_mm of this FuturesAccount. + + Whether to enable tiered maintenance margin calculation # noqa: E501 + + :param enable_tiered_mm: The enable_tiered_mm of this FuturesAccount. # noqa: E501 + :type: bool + """ + + self._enable_tiered_mm = enable_tiered_mm + + @property + def history(self): + """Gets the history of this FuturesAccount. # noqa: E501 + + + :return: The history of this FuturesAccount. # noqa: E501 + :rtype: FuturesAccountHistory + """ + return self._history + + @history.setter + def history(self, history): + """Sets the history of this FuturesAccount. + + + :param history: The history of this FuturesAccount. # noqa: E501 + :type: FuturesAccountHistory + """ + + self._history = history + def to_dict(self): """Returns the model properties as a dict""" result = {} @@ -290,16 +809,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/futures_account_book.py b/gate_api/models/futures_account_book.py index ef4b595..ff4e125 100644 --- a/gate_api/models/futures_account_book.py +++ b/gate_api/models/futures_account_book.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -32,14 +32,30 @@ class FuturesAccountBook(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {'time': 'float', 'change': 'str', 'balance': 'str', 'type': 'str', 'text': 'str'} - - attribute_map = {'time': 'time', 'change': 'change', 'balance': 'balance', 'type': 'type', 'text': 'text'} - - def __init__( - self, time=None, change=None, balance=None, type=None, text=None, local_vars_configuration=None - ): # noqa: E501 - # type: (float, str, str, str, str, Configuration) -> None + openapi_types = { + 'time': 'float', + 'change': 'str', + 'balance': 'str', + 'type': 'str', + 'text': 'str', + 'contract': 'str', + 'trade_id': 'str', + 'id': 'str' + } + + attribute_map = { + 'time': 'time', + 'change': 'change', + 'balance': 'balance', + 'type': 'type', + 'text': 'text', + 'contract': 'contract', + 'trade_id': 'trade_id', + 'id': 'id' + } + + def __init__(self, time=None, change=None, balance=None, type=None, text=None, contract=None, trade_id=None, id=None, local_vars_configuration=None): # noqa: E501 + # type: (float, str, str, str, str, str, str, str, Configuration) -> None """FuturesAccountBook - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -50,6 +66,9 @@ def __init__( self._balance = None self._type = None self._text = None + self._contract = None + self._trade_id = None + self._id = None self.discriminator = None if time is not None: @@ -62,6 +81,12 @@ def __init__( self.type = type if text is not None: self.text = text + if contract is not None: + self.contract = contract + if trade_id is not None: + self.trade_id = trade_id + if id is not None: + self.id = id @property def time(self): @@ -136,7 +161,7 @@ def balance(self, balance): def type(self): """Gets the type of this FuturesAccountBook. # noqa: E501 - Changing Type: - dnw: Deposit & Withdraw - pnl: Profit & Loss by reducing position - fee: Trading fee - refr: Referrer rebate - fund: Funding - point_dnw: POINT Deposit & Withdraw - point_fee: POINT Trading fee - point_refr: POINT Referrer rebate # noqa: E501 + Change types: - dnw: Deposit and withdrawal - pnl: Profit and loss from position reduction - fee: Trading fees - refr: Referrer rebates - fund: Funding fees - point_dnw: Point card deposit and withdrawal - point_fee: Point card trading fees - point_refr: Point card referrer rebates - bonus_offset: Trial fund deduction # noqa: E501 :return: The type of this FuturesAccountBook. # noqa: E501 :rtype: str @@ -147,15 +172,16 @@ def type(self): def type(self, type): """Sets the type of this FuturesAccountBook. - Changing Type: - dnw: Deposit & Withdraw - pnl: Profit & Loss by reducing position - fee: Trading fee - refr: Referrer rebate - fund: Funding - point_dnw: POINT Deposit & Withdraw - point_fee: POINT Trading fee - point_refr: POINT Referrer rebate # noqa: E501 + Change types: - dnw: Deposit and withdrawal - pnl: Profit and loss from position reduction - fee: Trading fees - refr: Referrer rebates - fund: Funding fees - point_dnw: Point card deposit and withdrawal - point_fee: Point card trading fees - point_refr: Point card referrer rebates - bonus_offset: Trial fund deduction # noqa: E501 :param type: The type of this FuturesAccountBook. # noqa: E501 :type: str """ - allowed_values = ["dnw", "pnl", "fee", "refr", "fund", "point_dnw", "point_fee", "point_refr"] # noqa: E501 + allowed_values = ["dnw", "pnl", "fee", "refr", "fund", "point_dnw", "point_fee", "point_refr", "bonus_offset"] # 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}".format(type, allowed_values) # noqa: E501 + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) ) self._type = type @@ -183,6 +209,75 @@ def text(self, text): self._text = text + @property + def contract(self): + """Gets the contract of this FuturesAccountBook. # noqa: E501 + + Futures contract, the field is only available for data after 2023-10-30 # noqa: E501 + + :return: The contract of this FuturesAccountBook. # noqa: E501 + :rtype: str + """ + return self._contract + + @contract.setter + def contract(self, contract): + """Sets the contract of this FuturesAccountBook. + + Futures contract, the field is only available for data after 2023-10-30 # noqa: E501 + + :param contract: The contract of this FuturesAccountBook. # noqa: E501 + :type: str + """ + + self._contract = contract + + @property + def trade_id(self): + """Gets the trade_id of this FuturesAccountBook. # noqa: E501 + + trade id # noqa: E501 + + :return: The trade_id of this FuturesAccountBook. # noqa: E501 + :rtype: str + """ + return self._trade_id + + @trade_id.setter + def trade_id(self, trade_id): + """Sets the trade_id of this FuturesAccountBook. + + trade id # noqa: E501 + + :param trade_id: The trade_id of this FuturesAccountBook. # noqa: E501 + :type: str + """ + + self._trade_id = trade_id + + @property + def id(self): + """Gets the id of this FuturesAccountBook. # noqa: E501 + + Account change record ID # noqa: E501 + + :return: The id of this FuturesAccountBook. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this FuturesAccountBook. + + Account change record ID # noqa: E501 + + :param id: The id of this FuturesAccountBook. # noqa: E501 + :type: str + """ + + self._id = id + def to_dict(self): """Returns the model properties as a dict""" result = {} @@ -190,16 +285,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/futures_account_history.py b/gate_api/models/futures_account_history.py new file mode 100644 index 0000000..6960744 --- /dev/null +++ b/gate_api/models/futures_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 FuturesAccountHistory(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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 + """FuturesAccountHistory - a 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 FuturesAccountHistory. # noqa: E501 + + total amount of deposit and withdraw # noqa: E501 + + :return: The dnw of this FuturesAccountHistory. # noqa: E501 + :rtype: str + """ + return self._dnw + + @dnw.setter + def dnw(self, dnw): + """Sets the dnw of this FuturesAccountHistory. + + total amount of deposit and withdraw # noqa: E501 + + :param dnw: The dnw of this FuturesAccountHistory. # noqa: E501 + :type: str + """ + + self._dnw = dnw + + @property + def pnl(self): + """Gets the pnl of this FuturesAccountHistory. # noqa: E501 + + total amount of trading profit and loss # noqa: E501 + + :return: The pnl of this FuturesAccountHistory. # noqa: E501 + :rtype: str + """ + return self._pnl + + @pnl.setter + def pnl(self, pnl): + """Sets the pnl of this FuturesAccountHistory. + + total amount of trading profit and loss # noqa: E501 + + :param pnl: The pnl of this FuturesAccountHistory. # noqa: E501 + :type: str + """ + + self._pnl = pnl + + @property + def fee(self): + """Gets the fee of this FuturesAccountHistory. # noqa: E501 + + total amount of fee # noqa: E501 + + :return: The fee of this FuturesAccountHistory. # noqa: E501 + :rtype: str + """ + return self._fee + + @fee.setter + def fee(self, fee): + """Sets the fee of this FuturesAccountHistory. + + total amount of fee # noqa: E501 + + :param fee: The fee of this FuturesAccountHistory. # noqa: E501 + :type: str + """ + + self._fee = fee + + @property + def refr(self): + """Gets the refr of this FuturesAccountHistory. # noqa: E501 + + total amount of referrer rebates # noqa: E501 + + :return: The refr of this FuturesAccountHistory. # noqa: E501 + :rtype: str + """ + return self._refr + + @refr.setter + def refr(self, refr): + """Sets the refr of this FuturesAccountHistory. + + total amount of referrer rebates # noqa: E501 + + :param refr: The refr of this FuturesAccountHistory. # noqa: E501 + :type: str + """ + + self._refr = refr + + @property + def fund(self): + """Gets the fund of this FuturesAccountHistory. # noqa: E501 + + total amount of funding costs # noqa: E501 + + :return: The fund of this FuturesAccountHistory. # noqa: E501 + :rtype: str + """ + return self._fund + + @fund.setter + def fund(self, fund): + """Sets the fund of this FuturesAccountHistory. + + total amount of funding costs # noqa: E501 + + :param fund: The fund of this FuturesAccountHistory. # noqa: E501 + :type: str + """ + + self._fund = fund + + @property + def point_dnw(self): + """Gets the point_dnw of this FuturesAccountHistory. # noqa: E501 + + total amount of point deposit and withdraw # noqa: E501 + + :return: The point_dnw of this FuturesAccountHistory. # noqa: E501 + :rtype: str + """ + return self._point_dnw + + @point_dnw.setter + def point_dnw(self, point_dnw): + """Sets the point_dnw of this FuturesAccountHistory. + + total amount of point deposit and withdraw # noqa: E501 + + :param point_dnw: The point_dnw of this FuturesAccountHistory. # noqa: E501 + :type: str + """ + + self._point_dnw = point_dnw + + @property + def point_fee(self): + """Gets the point_fee of this FuturesAccountHistory. # noqa: E501 + + total amount of point fee # noqa: E501 + + :return: The point_fee of this FuturesAccountHistory. # noqa: E501 + :rtype: str + """ + return self._point_fee + + @point_fee.setter + def point_fee(self, point_fee): + """Sets the point_fee of this FuturesAccountHistory. + + total amount of point fee # noqa: E501 + + :param point_fee: The point_fee of this FuturesAccountHistory. # noqa: E501 + :type: str + """ + + self._point_fee = point_fee + + @property + def point_refr(self): + """Gets the point_refr of this FuturesAccountHistory. # noqa: E501 + + total amount of referrer rebates of point fee # noqa: E501 + + :return: The point_refr of this FuturesAccountHistory. # noqa: E501 + :rtype: str + """ + return self._point_refr + + @point_refr.setter + def point_refr(self, point_refr): + """Sets the point_refr of this FuturesAccountHistory. + + total amount of referrer rebates of point fee # noqa: E501 + + :param point_refr: The point_refr of this FuturesAccountHistory. # noqa: E501 + :type: str + """ + + self._point_refr = point_refr + + @property + def bonus_dnw(self): + """Gets the bonus_dnw of this FuturesAccountHistory. # noqa: E501 + + total amount of perpetual contract bonus transfer # noqa: E501 + + :return: The bonus_dnw of this FuturesAccountHistory. # noqa: E501 + :rtype: str + """ + return self._bonus_dnw + + @bonus_dnw.setter + def bonus_dnw(self, bonus_dnw): + """Sets the bonus_dnw of this FuturesAccountHistory. + + total amount of perpetual contract bonus transfer # noqa: E501 + + :param bonus_dnw: The bonus_dnw of this FuturesAccountHistory. # noqa: E501 + :type: str + """ + + self._bonus_dnw = bonus_dnw + + @property + def bonus_offset(self): + """Gets the bonus_offset of this FuturesAccountHistory. # noqa: E501 + + total amount of perpetual contract bonus deduction # noqa: E501 + + :return: The bonus_offset of this FuturesAccountHistory. # noqa: E501 + :rtype: str + """ + return self._bonus_offset + + @bonus_offset.setter + def bonus_offset(self, bonus_offset): + """Sets the bonus_offset of this FuturesAccountHistory. + + total amount of perpetual contract bonus deduction # noqa: E501 + + :param bonus_offset: The bonus_offset of this FuturesAccountHistory. # 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, FuturesAccountHistory): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FuturesAccountHistory): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/futures_auto_deleverage.py b/gate_api/models/futures_auto_deleverage.py new file mode 100644 index 0000000..f6064c7 --- /dev/null +++ b/gate_api/models/futures_auto_deleverage.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 FuturesAutoDeleverage(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'user': 'int', + 'order_id': 'int', + 'contract': 'str', + 'leverage': 'str', + 'cross_leverage_limit': 'str', + 'entry_price': 'str', + 'fill_price': 'str', + 'trade_size': 'int', + 'position_size': 'int' + } + + attribute_map = { + 'time': 'time', + 'user': 'user', + 'order_id': 'order_id', + 'contract': 'contract', + 'leverage': 'leverage', + 'cross_leverage_limit': 'cross_leverage_limit', + 'entry_price': 'entry_price', + 'fill_price': 'fill_price', + 'trade_size': 'trade_size', + 'position_size': 'position_size' + } + + def __init__(self, time=None, user=None, order_id=None, contract=None, leverage=None, cross_leverage_limit=None, entry_price=None, fill_price=None, trade_size=None, position_size=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, int, str, str, str, str, str, int, int, Configuration) -> None + """FuturesAutoDeleverage - a 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._user = None + self._order_id = None + self._contract = None + self._leverage = None + self._cross_leverage_limit = None + self._entry_price = None + self._fill_price = None + self._trade_size = None + self._position_size = None + self.discriminator = None + + if time is not None: + self.time = time + if user is not None: + self.user = user + if order_id is not None: + self.order_id = order_id + if contract is not None: + self.contract = contract + if leverage is not None: + self.leverage = leverage + 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 fill_price is not None: + self.fill_price = fill_price + if trade_size is not None: + self.trade_size = trade_size + if position_size is not None: + self.position_size = position_size + + @property + def time(self): + """Gets the time of this FuturesAutoDeleverage. # noqa: E501 + + Automatic deleveraging time # noqa: E501 + + :return: The time of this FuturesAutoDeleverage. # noqa: E501 + :rtype: int + """ + return self._time + + @time.setter + def time(self, time): + """Sets the time of this FuturesAutoDeleverage. + + Automatic deleveraging time # noqa: E501 + + :param time: The time of this FuturesAutoDeleverage. # noqa: E501 + :type: int + """ + + self._time = time + + @property + def user(self): + """Gets the user of this FuturesAutoDeleverage. # noqa: E501 + + User ID # noqa: E501 + + :return: The user of this FuturesAutoDeleverage. # noqa: E501 + :rtype: int + """ + return self._user + + @user.setter + def user(self, user): + """Sets the user of this FuturesAutoDeleverage. + + User ID # noqa: E501 + + :param user: The user of this FuturesAutoDeleverage. # noqa: E501 + :type: int + """ + + self._user = user + + @property + def order_id(self): + """Gets the order_id of this FuturesAutoDeleverage. # noqa: E501 + + Order ID. Order IDs before 2023-02-20 are null # noqa: E501 + + :return: The order_id of this FuturesAutoDeleverage. # noqa: E501 + :rtype: int + """ + return self._order_id + + @order_id.setter + def order_id(self, order_id): + """Sets the order_id of this FuturesAutoDeleverage. + + Order ID. Order IDs before 2023-02-20 are null # noqa: E501 + + :param order_id: The order_id of this FuturesAutoDeleverage. # noqa: E501 + :type: int + """ + + self._order_id = order_id + + @property + def contract(self): + """Gets the contract of this FuturesAutoDeleverage. # noqa: E501 + + Futures contract # noqa: E501 + + :return: The contract of this FuturesAutoDeleverage. # noqa: E501 + :rtype: str + """ + return self._contract + + @contract.setter + def contract(self, contract): + """Sets the contract of this FuturesAutoDeleverage. + + Futures contract # noqa: E501 + + :param contract: The contract of this FuturesAutoDeleverage. # noqa: E501 + :type: str + """ + + self._contract = contract + + @property + def leverage(self): + """Gets the leverage of this FuturesAutoDeleverage. # noqa: E501 + + Position leverage # noqa: E501 + + :return: The leverage of this FuturesAutoDeleverage. # noqa: E501 + :rtype: str + """ + return self._leverage + + @leverage.setter + def leverage(self, leverage): + """Sets the leverage of this FuturesAutoDeleverage. + + Position leverage # noqa: E501 + + :param leverage: The leverage of this FuturesAutoDeleverage. # noqa: E501 + :type: str + """ + + self._leverage = leverage + + @property + def cross_leverage_limit(self): + """Gets the cross_leverage_limit of this FuturesAutoDeleverage. # noqa: E501 + + Cross margin leverage (valid only when `leverage` is 0) # noqa: E501 + + :return: The cross_leverage_limit of this FuturesAutoDeleverage. # 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 FuturesAutoDeleverage. + + Cross margin leverage (valid only when `leverage` is 0) # noqa: E501 + + :param cross_leverage_limit: The cross_leverage_limit of this FuturesAutoDeleverage. # noqa: E501 + :type: str + """ + + self._cross_leverage_limit = cross_leverage_limit + + @property + def entry_price(self): + """Gets the entry_price of this FuturesAutoDeleverage. # noqa: E501 + + Average entry price # noqa: E501 + + :return: The entry_price of this FuturesAutoDeleverage. # noqa: E501 + :rtype: str + """ + return self._entry_price + + @entry_price.setter + def entry_price(self, entry_price): + """Sets the entry_price of this FuturesAutoDeleverage. + + Average entry price # noqa: E501 + + :param entry_price: The entry_price of this FuturesAutoDeleverage. # noqa: E501 + :type: str + """ + + self._entry_price = entry_price + + @property + def fill_price(self): + """Gets the fill_price of this FuturesAutoDeleverage. # noqa: E501 + + Average fill price # noqa: E501 + + :return: The fill_price of this FuturesAutoDeleverage. # noqa: E501 + :rtype: str + """ + return self._fill_price + + @fill_price.setter + def fill_price(self, fill_price): + """Sets the fill_price of this FuturesAutoDeleverage. + + Average fill price # noqa: E501 + + :param fill_price: The fill_price of this FuturesAutoDeleverage. # noqa: E501 + :type: str + """ + + self._fill_price = fill_price + + @property + def trade_size(self): + """Gets the trade_size of this FuturesAutoDeleverage. # noqa: E501 + + Trading size # noqa: E501 + + :return: The trade_size of this FuturesAutoDeleverage. # noqa: E501 + :rtype: int + """ + return self._trade_size + + @trade_size.setter + def trade_size(self, trade_size): + """Sets the trade_size of this FuturesAutoDeleverage. + + Trading size # noqa: E501 + + :param trade_size: The trade_size of this FuturesAutoDeleverage. # noqa: E501 + :type: int + """ + + self._trade_size = trade_size + + @property + def position_size(self): + """Gets the position_size of this FuturesAutoDeleverage. # noqa: E501 + + Positions after auto-deleveraging # noqa: E501 + + :return: The position_size of this FuturesAutoDeleverage. # noqa: E501 + :rtype: int + """ + return self._position_size + + @position_size.setter + def position_size(self, position_size): + """Sets the position_size of this FuturesAutoDeleverage. + + Positions after auto-deleveraging # noqa: E501 + + :param position_size: The position_size of this FuturesAutoDeleverage. # noqa: E501 + :type: int + """ + + self._position_size = position_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, FuturesAutoDeleverage): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FuturesAutoDeleverage): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/futures_batch_amend_order_request.py b/gate_api/models/futures_batch_amend_order_request.py new file mode 100644 index 0000000..c12d869 --- /dev/null +++ b/gate_api/models/futures_batch_amend_order_request.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 FuturesBatchAmendOrderRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'text': 'str', + 'size': 'int', + 'price': 'str', + 'amend_text': 'str' + } + + attribute_map = { + 'order_id': 'order_id', + 'text': 'text', + 'size': 'size', + 'price': 'price', + 'amend_text': 'amend_text' + } + + def __init__(self, order_id=None, text=None, size=None, price=None, amend_text=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, int, str, str, Configuration) -> None + """FuturesBatchAmendOrderRequest - a 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._size = None + self._price = None + self._amend_text = None + self.discriminator = None + + if order_id is not None: + self.order_id = order_id + if text is not None: + self.text = text + if size is not None: + self.size = size + if price is not None: + self.price = price + if amend_text is not None: + self.amend_text = amend_text + + @property + def order_id(self): + """Gets the order_id of this FuturesBatchAmendOrderRequest. # noqa: E501 + + Order id, order_id and text must contain at least one # noqa: E501 + + :return: The order_id of this FuturesBatchAmendOrderRequest. # noqa: E501 + :rtype: int + """ + return self._order_id + + @order_id.setter + def order_id(self, order_id): + """Sets the order_id of this FuturesBatchAmendOrderRequest. + + Order id, order_id and text must contain at least one # noqa: E501 + + :param order_id: The order_id of this FuturesBatchAmendOrderRequest. # noqa: E501 + :type: int + """ + + self._order_id = order_id + + @property + def text(self): + """Gets the text of this FuturesBatchAmendOrderRequest. # noqa: E501 + + User-defined order text, at least one of order_id and text must be passed # noqa: E501 + + :return: The text of this FuturesBatchAmendOrderRequest. # noqa: E501 + :rtype: str + """ + return self._text + + @text.setter + def text(self, text): + """Sets the text of this FuturesBatchAmendOrderRequest. + + User-defined order text, at least one of order_id and text must be passed # noqa: E501 + + :param text: The text of this FuturesBatchAmendOrderRequest. # noqa: E501 + :type: str + """ + + self._text = text + + @property + def size(self): + """Gets the size of this FuturesBatchAmendOrderRequest. # noqa: E501 + + 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. # noqa: E501 + + :return: The size of this FuturesBatchAmendOrderRequest. # noqa: E501 + :rtype: int + """ + return self._size + + @size.setter + def size(self, size): + """Sets the size of this FuturesBatchAmendOrderRequest. + + 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. # noqa: E501 + + :param size: The size of this FuturesBatchAmendOrderRequest. # noqa: E501 + :type: int + """ + + self._size = size + + @property + def price(self): + """Gets the price of this FuturesBatchAmendOrderRequest. # noqa: E501 + + New order price # noqa: E501 + + :return: The price of this FuturesBatchAmendOrderRequest. # noqa: E501 + :rtype: str + """ + return self._price + + @price.setter + def price(self, price): + """Sets the price of this FuturesBatchAmendOrderRequest. + + New order price # noqa: E501 + + :param price: The price of this FuturesBatchAmendOrderRequest. # noqa: E501 + :type: str + """ + + self._price = price + + @property + def amend_text(self): + """Gets the amend_text of this FuturesBatchAmendOrderRequest. # noqa: E501 + + Custom info during order amendment # noqa: E501 + + :return: The amend_text of this FuturesBatchAmendOrderRequest. # noqa: E501 + :rtype: str + """ + return self._amend_text + + @amend_text.setter + def amend_text(self, amend_text): + """Sets the amend_text of this FuturesBatchAmendOrderRequest. + + Custom info during order amendment # noqa: E501 + + :param amend_text: The amend_text of this FuturesBatchAmendOrderRequest. # noqa: E501 + :type: str + """ + + self._amend_text = amend_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, FuturesBatchAmendOrderRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FuturesBatchAmendOrderRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/futures_candlestick.py b/gate_api/models/futures_candlestick.py index 5d4353b..246d19d 100644 --- a/gate_api/models/futures_candlestick.py +++ b/gate_api/models/futures_candlestick.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -32,12 +32,28 @@ class FuturesCandlestick(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {'t': 'float', 'v': 'int', 'c': 'str', 'h': 'str', 'l': 'str', 'o': 'str'} - - attribute_map = {'t': 't', 'v': 'v', 'c': 'c', 'h': 'h', 'l': 'l', 'o': 'o'} - - def __init__(self, t=None, v=None, c=None, h=None, l=None, o=None, local_vars_configuration=None): # noqa: E501 - # type: (float, int, str, str, str, str, Configuration) -> None + openapi_types = { + 't': 'float', + 'v': 'int', + 'c': 'str', + 'h': 'str', + 'l': 'str', + 'o': 'str', + 'sum': 'str' + } + + attribute_map = { + 't': 't', + 'v': 'v', + 'c': 'c', + 'h': 'h', + 'l': 'l', + 'o': 'o', + 'sum': 'sum' + } + + def __init__(self, t=None, v=None, c=None, h=None, l=None, o=None, sum=None, local_vars_configuration=None): # noqa: E501 + # type: (float, int, str, str, str, str, str, Configuration) -> None """FuturesCandlestick - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -49,6 +65,7 @@ def __init__(self, t=None, v=None, c=None, h=None, l=None, o=None, local_vars_co self._h = None self._l = None self._o = None + self._sum = None self.discriminator = None if t is not None: @@ -63,6 +80,8 @@ def __init__(self, t=None, v=None, c=None, h=None, l=None, o=None, local_vars_co self.l = l if o is not None: self.o = o + if sum is not None: + self.sum = sum @property def t(self): @@ -91,7 +110,7 @@ def t(self, t): def v(self): """Gets the v of this FuturesCandlestick. # noqa: E501 - size volume. Only returned if `contract` is not prefixed # noqa: E501 + size volume (contract size). Only returned if `contract` is not prefixed # noqa: E501 :return: The v of this FuturesCandlestick. # noqa: E501 :rtype: int @@ -102,7 +121,7 @@ def v(self): def v(self, v): """Sets the v of this FuturesCandlestick. - size volume. Only returned if `contract` is not prefixed # noqa: E501 + size volume (contract size). Only returned if `contract` is not prefixed # noqa: E501 :param v: The v of this FuturesCandlestick. # noqa: E501 :type: int @@ -114,7 +133,7 @@ def v(self, v): def c(self): """Gets the c of this FuturesCandlestick. # noqa: E501 - Close price # noqa: E501 + Close price (quote currency) # noqa: E501 :return: The c of this FuturesCandlestick. # noqa: E501 :rtype: str @@ -125,7 +144,7 @@ def c(self): def c(self, c): """Sets the c of this FuturesCandlestick. - Close price # noqa: E501 + Close price (quote currency) # noqa: E501 :param c: The c of this FuturesCandlestick. # noqa: E501 :type: str @@ -137,7 +156,7 @@ def c(self, c): def h(self): """Gets the h of this FuturesCandlestick. # noqa: E501 - Highest price # noqa: E501 + Highest price (quote currency) # noqa: E501 :return: The h of this FuturesCandlestick. # noqa: E501 :rtype: str @@ -148,7 +167,7 @@ def h(self): def h(self, h): """Sets the h of this FuturesCandlestick. - Highest price # noqa: E501 + Highest price (quote currency) # noqa: E501 :param h: The h of this FuturesCandlestick. # noqa: E501 :type: str @@ -160,7 +179,7 @@ def h(self, h): def l(self): """Gets the l of this FuturesCandlestick. # noqa: E501 - Lowest price # noqa: E501 + Lowest price (quote currency) # noqa: E501 :return: The l of this FuturesCandlestick. # noqa: E501 :rtype: str @@ -171,7 +190,7 @@ def l(self): def l(self, l): """Sets the l of this FuturesCandlestick. - Lowest price # noqa: E501 + Lowest price (quote currency) # noqa: E501 :param l: The l of this FuturesCandlestick. # noqa: E501 :type: str @@ -183,7 +202,7 @@ def l(self, l): def o(self): """Gets the o of this FuturesCandlestick. # noqa: E501 - Open price # noqa: E501 + Open price (quote currency) # noqa: E501 :return: The o of this FuturesCandlestick. # noqa: E501 :rtype: str @@ -194,7 +213,7 @@ def o(self): def o(self, o): """Sets the o of this FuturesCandlestick. - Open price # noqa: E501 + Open price (quote currency) # noqa: E501 :param o: The o of this FuturesCandlestick. # noqa: E501 :type: str @@ -202,6 +221,29 @@ def o(self, o): self._o = o + @property + def sum(self): + """Gets the sum of this FuturesCandlestick. # noqa: E501 + + Trading volume (unit: Quote currency) # noqa: E501 + + :return: The sum of this FuturesCandlestick. # noqa: E501 + :rtype: str + """ + return self._sum + + @sum.setter + def sum(self, sum): + """Sets the sum of this FuturesCandlestick. + + Trading volume (unit: Quote currency) # noqa: E501 + + :param sum: The sum of this FuturesCandlestick. # noqa: E501 + :type: str + """ + + self._sum = sum + def to_dict(self): """Returns the model properties as a dict""" result = {} @@ -209,16 +251,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/futures_fee.py b/gate_api/models/futures_fee.py new file mode 100644 index 0000000..07aa347 --- /dev/null +++ b/gate_api/models/futures_fee.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 FuturesFee(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'taker_fee': 'str', + 'maker_fee': 'str' + } + + attribute_map = { + 'taker_fee': 'taker_fee', + 'maker_fee': 'maker_fee' + } + + def __init__(self, taker_fee=None, maker_fee=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """FuturesFee - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._taker_fee = None + self._maker_fee = None + self.discriminator = None + + if taker_fee is not None: + self.taker_fee = taker_fee + if maker_fee is not None: + self.maker_fee = maker_fee + + @property + def taker_fee(self): + """Gets the taker_fee of this FuturesFee. # noqa: E501 + + Taker fee # noqa: E501 + + :return: The taker_fee of this FuturesFee. # noqa: E501 + :rtype: str + """ + return self._taker_fee + + @taker_fee.setter + def taker_fee(self, taker_fee): + """Sets the taker_fee of this FuturesFee. + + Taker fee # noqa: E501 + + :param taker_fee: The taker_fee of this FuturesFee. # noqa: E501 + :type: str + """ + + self._taker_fee = taker_fee + + @property + def maker_fee(self): + """Gets the maker_fee of this FuturesFee. # noqa: E501 + + maker fee # noqa: E501 + + :return: The maker_fee of this FuturesFee. # noqa: E501 + :rtype: str + """ + return self._maker_fee + + @maker_fee.setter + def maker_fee(self, maker_fee): + """Sets the maker_fee of this FuturesFee. + + maker fee # noqa: E501 + + :param maker_fee: The maker_fee of this FuturesFee. # noqa: E501 + :type: str + """ + + self._maker_fee = maker_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, FuturesFee): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FuturesFee): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/futures_index_constituents.py b/gate_api/models/futures_index_constituents.py new file mode 100644 index 0000000..12232a7 --- /dev/null +++ b/gate_api/models/futures_index_constituents.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 FuturesIndexConstituents(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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': 'str', + 'constituents': 'list[IndexConstituent]' + } + + attribute_map = { + 'index': 'index', + 'constituents': 'constituents' + } + + def __init__(self, index=None, constituents=None, local_vars_configuration=None): # noqa: E501 + # type: (str, list[IndexConstituent], Configuration) -> None + """FuturesIndexConstituents - a 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._constituents = None + self.discriminator = None + + if index is not None: + self.index = index + if constituents is not None: + self.constituents = constituents + + @property + def index(self): + """Gets the index of this FuturesIndexConstituents. # noqa: E501 + + Index name # noqa: E501 + + :return: The index of this FuturesIndexConstituents. # noqa: E501 + :rtype: str + """ + return self._index + + @index.setter + def index(self, index): + """Sets the index of this FuturesIndexConstituents. + + Index name # noqa: E501 + + :param index: The index of this FuturesIndexConstituents. # noqa: E501 + :type: str + """ + + self._index = index + + @property + def constituents(self): + """Gets the constituents of this FuturesIndexConstituents. # noqa: E501 + + Constituents # noqa: E501 + + :return: The constituents of this FuturesIndexConstituents. # noqa: E501 + :rtype: list[IndexConstituent] + """ + return self._constituents + + @constituents.setter + def constituents(self, constituents): + """Sets the constituents of this FuturesIndexConstituents. + + Constituents # noqa: E501 + + :param constituents: The constituents of this FuturesIndexConstituents. # noqa: E501 + :type: list[IndexConstituent] + """ + + self._constituents = constituents + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FuturesIndexConstituents): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FuturesIndexConstituents): + 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 33a980a..7f3999c 100644 --- a/gate_api/models/futures_initial_order.py +++ b/gate_api/models/futures_initial_order.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -40,8 +40,9 @@ class FuturesInitialOrder(object): 'tif': 'str', 'text': 'str', 'reduce_only': 'bool', + 'auto_size': 'str', 'is_reduce_only': 'bool', - 'is_close': 'bool', + 'is_close': 'bool' } attribute_map = { @@ -52,24 +53,13 @@ class FuturesInitialOrder(object): 'tif': 'tif', 'text': 'text', 'reduce_only': 'reduce_only', + 'auto_size': 'auto_size', 'is_reduce_only': 'is_reduce_only', - 'is_close': 'is_close', + 'is_close': 'is_close' } - def __init__( - self, - contract=None, - size=None, - price=None, - close=False, - tif='gtc', - text=None, - reduce_only=False, - is_reduce_only=None, - is_close=None, - local_vars_configuration=None, - ): # noqa: E501 - # type: (str, int, str, bool, str, str, bool, bool, bool, Configuration) -> None + 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 """FuturesInitialOrder - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -82,6 +72,7 @@ def __init__( self._tif = None self._text = None self._reduce_only = None + self._auto_size = None self._is_reduce_only = None self._is_close = None self.discriminator = None @@ -98,6 +89,8 @@ def __init__( self.text = text if reduce_only is not None: self.reduce_only = reduce_only + if auto_size is not None: + self.auto_size = auto_size if is_reduce_only is not None: self.is_reduce_only = is_reduce_only if is_close is not None: @@ -132,7 +125,7 @@ def contract(self, contract): def size(self): """Gets the size of this FuturesInitialOrder. # noqa: E501 - Order size. Positive size means to buy, while negative one means to sell. Set to 0 to close the position # noqa: E501 + 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 # noqa: E501 :return: The size of this FuturesInitialOrder. # noqa: E501 :rtype: int @@ -143,7 +136,7 @@ def size(self): def size(self, size): """Sets the size of this FuturesInitialOrder. - Order size. Positive size means to buy, while negative one means to sell. Set to 0 to close the position # noqa: E501 + 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 # noqa: E501 :param size: The size of this FuturesInitialOrder. # noqa: E501 :type: int @@ -180,7 +173,7 @@ def price(self, price): def close(self): """Gets the close of this FuturesInitialOrder. # noqa: E501 - Set to true if trying to close the position # noqa: E501 + When all positions are closed in a single position mode, it must be set to true to perform the closing operation When partially closed positions in single-store mode/double-store mode, you can not set close, or close=false # noqa: E501 :return: The close of this FuturesInitialOrder. # noqa: E501 :rtype: bool @@ -191,7 +184,7 @@ def close(self): def close(self, close): """Sets the close of this FuturesInitialOrder. - Set to true if trying to close the position # noqa: E501 + When all positions are closed in a single position mode, it must be set to true to perform the closing operation When partially closed positions in single-store mode/double-store mode, you can not set close, or close=false # noqa: E501 :param close: The close of this FuturesInitialOrder. # noqa: E501 :type: bool @@ -203,7 +196,7 @@ def close(self, close): def tif(self): """Gets the tif of this FuturesInitialOrder. # noqa: E501 - Time in force. If using market price, only `ioc` is supported. - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled # noqa: E501 + Time in force strategy, default is gtc, market orders currently only support ioc mode - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled # noqa: E501 :return: The tif of this FuturesInitialOrder. # noqa: E501 :rtype: str @@ -214,7 +207,7 @@ def tif(self): def tif(self, tif): """Sets the tif of this FuturesInitialOrder. - Time in force. If using market price, only `ioc` is supported. - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled # noqa: E501 + Time in force strategy, default is gtc, market orders currently only support ioc mode - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled # noqa: E501 :param tif: The tif of this FuturesInitialOrder. # noqa: E501 :type: str @@ -222,7 +215,8 @@ def tif(self, tif): allowed_values = ["gtc", "ioc"] # 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}".format(tif, allowed_values) # noqa: E501 + "Invalid value for `tif` ({0}), must be one of {1}" # noqa: E501 + .format(tif, allowed_values) ) self._tif = tif @@ -231,7 +225,7 @@ def tif(self, tif): def text(self): """Gets the text of this FuturesInitialOrder. # noqa: E501 - How the order is created. Possible values are: web, api and app # noqa: E501 + The source of the order, including: - web: Web - api: API call - app: Mobile app # noqa: E501 :return: The text of this FuturesInitialOrder. # noqa: E501 :rtype: str @@ -242,7 +236,7 @@ def text(self): def text(self, text): """Sets the text of this FuturesInitialOrder. - How the order is created. Possible values are: web, api and app # noqa: E501 + The source of the order, including: - web: Web - api: API call - app: Mobile app # noqa: E501 :param text: The text of this FuturesInitialOrder. # noqa: E501 :type: str @@ -254,7 +248,7 @@ def text(self, text): def reduce_only(self): """Gets the reduce_only of this FuturesInitialOrder. # noqa: E501 - Set to true to create a reduce-only order # noqa: E501 + 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 # noqa: E501 :return: The reduce_only of this FuturesInitialOrder. # noqa: E501 :rtype: bool @@ -265,7 +259,7 @@ def reduce_only(self): def reduce_only(self, reduce_only): """Sets the reduce_only of this FuturesInitialOrder. - Set to true to create a reduce-only order # noqa: E501 + 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 # noqa: E501 :param reduce_only: The reduce_only of this FuturesInitialOrder. # noqa: E501 :type: bool @@ -273,6 +267,29 @@ def reduce_only(self, reduce_only): self._reduce_only = reduce_only + @property + def auto_size(self): + """Gets the auto_size of this FuturesInitialOrder. # noqa: E501 + + Single position mode: auto_size is not required Dual position mode full closing (size=0): auto_size must be set, close_long for closing long positions, close_short for closing short positions Dual position mode partial closing (size≠0): auto_size is not required # noqa: E501 + + :return: The auto_size of this FuturesInitialOrder. # noqa: E501 + :rtype: str + """ + return self._auto_size + + @auto_size.setter + def auto_size(self, auto_size): + """Sets the auto_size of this FuturesInitialOrder. + + Single position mode: auto_size is not required Dual position mode full closing (size=0): auto_size must be set, close_long for closing long positions, close_short for closing short positions Dual position mode partial closing (size≠0): auto_size is not required # noqa: E501 + + :param auto_size: The auto_size of this FuturesInitialOrder. # noqa: E501 + :type: str + """ + + self._auto_size = auto_size + @property def is_reduce_only(self): """Gets the is_reduce_only of this FuturesInitialOrder. # noqa: E501 @@ -326,16 +343,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/futures_limit_risk_tiers.py b/gate_api/models/futures_limit_risk_tiers.py new file mode 100644 index 0000000..a636a2e --- /dev/null +++ b/gate_api/models/futures_limit_risk_tiers.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 FuturesLimitRiskTiers(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'tier': 'int', + 'risk_limit': 'str', + 'initial_rate': 'str', + 'maintenance_rate': 'str', + 'leverage_max': 'str', + 'contract': 'str', + 'deduction': 'str' + } + + attribute_map = { + 'tier': 'tier', + 'risk_limit': 'risk_limit', + 'initial_rate': 'initial_rate', + 'maintenance_rate': 'maintenance_rate', + 'leverage_max': 'leverage_max', + 'contract': 'contract', + 'deduction': 'deduction' + } + + def __init__(self, tier=None, risk_limit=None, initial_rate=None, maintenance_rate=None, leverage_max=None, contract=None, deduction=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, str, str, str, str, str, Configuration) -> None + """FuturesLimitRiskTiers - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._tier = None + self._risk_limit = None + self._initial_rate = None + self._maintenance_rate = None + self._leverage_max = None + self._contract = None + self._deduction = None + self.discriminator = None + + if tier is not None: + self.tier = tier + if risk_limit is not None: + self.risk_limit = risk_limit + if initial_rate is not None: + self.initial_rate = initial_rate + if maintenance_rate is not None: + self.maintenance_rate = maintenance_rate + if leverage_max is not None: + self.leverage_max = leverage_max + if contract is not None: + self.contract = contract + if deduction is not None: + self.deduction = deduction + + @property + def tier(self): + """Gets the tier of this FuturesLimitRiskTiers. # noqa: E501 + + Tier # noqa: E501 + + :return: The tier of this FuturesLimitRiskTiers. # noqa: E501 + :rtype: int + """ + return self._tier + + @tier.setter + def tier(self, tier): + """Sets the tier of this FuturesLimitRiskTiers. + + Tier # noqa: E501 + + :param tier: The tier of this FuturesLimitRiskTiers. # noqa: E501 + :type: int + """ + + self._tier = tier + + @property + def risk_limit(self): + """Gets the risk_limit of this FuturesLimitRiskTiers. # noqa: E501 + + Position risk limit # noqa: E501 + + :return: The risk_limit of this FuturesLimitRiskTiers. # noqa: E501 + :rtype: str + """ + return self._risk_limit + + @risk_limit.setter + def risk_limit(self, risk_limit): + """Sets the risk_limit of this FuturesLimitRiskTiers. + + Position risk limit # noqa: E501 + + :param risk_limit: The risk_limit of this FuturesLimitRiskTiers. # noqa: E501 + :type: str + """ + + self._risk_limit = risk_limit + + @property + def initial_rate(self): + """Gets the initial_rate of this FuturesLimitRiskTiers. # noqa: E501 + + Initial margin rate # noqa: E501 + + :return: The initial_rate of this FuturesLimitRiskTiers. # noqa: E501 + :rtype: str + """ + return self._initial_rate + + @initial_rate.setter + def initial_rate(self, initial_rate): + """Sets the initial_rate of this FuturesLimitRiskTiers. + + Initial margin rate # noqa: E501 + + :param initial_rate: The initial_rate of this FuturesLimitRiskTiers. # noqa: E501 + :type: str + """ + + self._initial_rate = initial_rate + + @property + def maintenance_rate(self): + """Gets the maintenance_rate of this FuturesLimitRiskTiers. # noqa: E501 + + Maintenance margin rate # noqa: E501 + + :return: The maintenance_rate of this FuturesLimitRiskTiers. # noqa: E501 + :rtype: str + """ + return self._maintenance_rate + + @maintenance_rate.setter + def maintenance_rate(self, maintenance_rate): + """Sets the maintenance_rate of this FuturesLimitRiskTiers. + + Maintenance margin rate # noqa: E501 + + :param maintenance_rate: The maintenance_rate of this FuturesLimitRiskTiers. # noqa: E501 + :type: str + """ + + self._maintenance_rate = maintenance_rate + + @property + def leverage_max(self): + """Gets the leverage_max of this FuturesLimitRiskTiers. # noqa: E501 + + Maximum leverage # noqa: E501 + + :return: The leverage_max of this FuturesLimitRiskTiers. # noqa: E501 + :rtype: str + """ + return self._leverage_max + + @leverage_max.setter + def leverage_max(self, leverage_max): + """Sets the leverage_max of this FuturesLimitRiskTiers. + + Maximum leverage # noqa: E501 + + :param leverage_max: The leverage_max of this FuturesLimitRiskTiers. # noqa: E501 + :type: str + """ + + self._leverage_max = leverage_max + + @property + def contract(self): + """Gets the contract of this FuturesLimitRiskTiers. # noqa: E501 + + Market, only visible when market pagination is requested # noqa: E501 + + :return: The contract of this FuturesLimitRiskTiers. # noqa: E501 + :rtype: str + """ + return self._contract + + @contract.setter + def contract(self, contract): + """Sets the contract of this FuturesLimitRiskTiers. + + Market, only visible when market pagination is requested # noqa: E501 + + :param contract: The contract of this FuturesLimitRiskTiers. # noqa: E501 + :type: str + """ + + self._contract = contract + + @property + def deduction(self): + """Gets the deduction of this FuturesLimitRiskTiers. # noqa: E501 + + Maintenance margin quick calculation deduction amount # noqa: E501 + + :return: The deduction of this FuturesLimitRiskTiers. # noqa: E501 + :rtype: str + """ + return self._deduction + + @deduction.setter + def deduction(self, deduction): + """Sets the deduction of this FuturesLimitRiskTiers. + + Maintenance margin quick calculation deduction amount # noqa: E501 + + :param deduction: The deduction of this FuturesLimitRiskTiers. # noqa: E501 + :type: str + """ + + self._deduction = deduction + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FuturesLimitRiskTiers): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FuturesLimitRiskTiers): + 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 new file mode 100644 index 0000000..fabcb0a --- /dev/null +++ b/gate_api/models/futures_liq_order.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 FuturesLiqOrder(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'contract': 'str', + 'size': 'int', + 'order_size': 'int', + 'order_price': 'str', + 'fill_price': 'str', + 'left': 'int' + } + + attribute_map = { + 'time': 'time', + 'contract': 'contract', + 'size': 'size', + 'order_size': 'order_size', + 'order_price': 'order_price', + 'fill_price': 'fill_price', + 'left': 'left' + } + + def __init__(self, time=None, contract=None, size=None, order_size=None, order_price=None, fill_price=None, left=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, int, int, str, str, int, Configuration) -> None + """FuturesLiqOrder - a 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._contract = None + self._size = None + self._order_size = None + self._order_price = None + self._fill_price = None + self._left = None + self.discriminator = None + + if time is not None: + self.time = time + if contract is not None: + self.contract = contract + if size is not None: + self.size = size + if order_size is not None: + self.order_size = order_size + if order_price is not None: + self.order_price = order_price + if fill_price is not None: + self.fill_price = fill_price + if left is not None: + self.left = left + + @property + def time(self): + """Gets the time of this FuturesLiqOrder. # noqa: E501 + + Liquidation time # noqa: E501 + + :return: The time of this FuturesLiqOrder. # noqa: E501 + :rtype: int + """ + return self._time + + @time.setter + def time(self, time): + """Sets the time of this FuturesLiqOrder. + + Liquidation time # noqa: E501 + + :param time: The time of this FuturesLiqOrder. # noqa: E501 + :type: int + """ + + self._time = time + + @property + def contract(self): + """Gets the contract of this FuturesLiqOrder. # noqa: E501 + + Futures contract # noqa: E501 + + :return: The contract of this FuturesLiqOrder. # noqa: E501 + :rtype: str + """ + return self._contract + + @contract.setter + def contract(self, contract): + """Sets the contract of this FuturesLiqOrder. + + Futures contract # noqa: E501 + + :param contract: The contract of this FuturesLiqOrder. # noqa: E501 + :type: str + """ + + self._contract = contract + + @property + def size(self): + """Gets the size of this FuturesLiqOrder. # noqa: E501 + + User position size # noqa: E501 + + :return: The size of this FuturesLiqOrder. # noqa: E501 + :rtype: int + """ + return self._size + + @size.setter + def size(self, size): + """Sets the size of this FuturesLiqOrder. + + User position size # noqa: E501 + + :param size: The size of this FuturesLiqOrder. # noqa: E501 + :type: int + """ + + self._size = size + + @property + def order_size(self): + """Gets the order_size of this FuturesLiqOrder. # noqa: E501 + + Number of forced liquidation orders # noqa: E501 + + :return: The order_size of this FuturesLiqOrder. # noqa: E501 + :rtype: int + """ + return self._order_size + + @order_size.setter + def order_size(self, order_size): + """Sets the order_size of this FuturesLiqOrder. + + Number of forced liquidation orders # noqa: E501 + + :param order_size: The order_size of this FuturesLiqOrder. # noqa: E501 + :type: int + """ + + self._order_size = order_size + + @property + def order_price(self): + """Gets the order_price of this FuturesLiqOrder. # noqa: E501 + + Liquidation order price # noqa: E501 + + :return: The order_price of this FuturesLiqOrder. # noqa: E501 + :rtype: str + """ + return self._order_price + + @order_price.setter + def order_price(self, order_price): + """Sets the order_price of this FuturesLiqOrder. + + Liquidation order price # noqa: E501 + + :param order_price: The order_price of this FuturesLiqOrder. # noqa: E501 + :type: str + """ + + self._order_price = order_price + + @property + def fill_price(self): + """Gets the fill_price of this FuturesLiqOrder. # noqa: E501 + + Liquidation order average taker price # noqa: E501 + + :return: The fill_price of this FuturesLiqOrder. # noqa: E501 + :rtype: str + """ + return self._fill_price + + @fill_price.setter + def fill_price(self, fill_price): + """Sets the fill_price of this FuturesLiqOrder. + + Liquidation order average taker price # noqa: E501 + + :param fill_price: The fill_price of this FuturesLiqOrder. # noqa: E501 + :type: str + """ + + self._fill_price = fill_price + + @property + def left(self): + """Gets the left of this FuturesLiqOrder. # noqa: E501 + + System liquidation order maker size # noqa: E501 + + :return: The left of this FuturesLiqOrder. # noqa: E501 + :rtype: int + """ + return self._left + + @left.setter + def left(self, left): + """Sets the left of this FuturesLiqOrder. + + System liquidation order maker size # noqa: E501 + + :param left: The left of this FuturesLiqOrder. # noqa: E501 + :type: int + """ + + 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, FuturesLiqOrder): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FuturesLiqOrder): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/futures_liquidate.py b/gate_api/models/futures_liquidate.py index 95ed1a6..549e71f 100644 --- a/gate_api/models/futures_liquidate.py +++ b/gate_api/models/futures_liquidate.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -44,7 +44,7 @@ class FuturesLiquidate(object): 'order_id': 'int', 'order_price': 'str', 'fill_price': 'str', - 'left': 'int', + 'left': 'int' } attribute_map = { @@ -59,25 +59,10 @@ class FuturesLiquidate(object): 'order_id': 'order_id', 'order_price': 'order_price', 'fill_price': 'fill_price', - 'left': 'left', + 'left': 'left' } - def __init__( - self, - time=None, - contract=None, - leverage=None, - size=None, - margin=None, - entry_price=None, - liq_price=None, - mark_price=None, - order_id=None, - order_price=None, - fill_price=None, - left=None, - local_vars_configuration=None, - ): # noqa: E501 + def __init__(self, time=None, contract=None, leverage=None, size=None, margin=None, entry_price=None, liq_price=None, mark_price=None, order_id=None, order_price=None, fill_price=None, left=None, local_vars_configuration=None): # noqa: E501 # type: (int, str, str, int, str, str, str, str, int, str, str, int, Configuration) -> None """FuturesLiquidate - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: @@ -173,7 +158,7 @@ def contract(self, contract): def leverage(self): """Gets the leverage of this FuturesLiquidate. # noqa: E501 - Position leverage. Not returned in public endpoints. # noqa: E501 + Position leverage. Not returned in public endpoints # noqa: E501 :return: The leverage of this FuturesLiquidate. # noqa: E501 :rtype: str @@ -184,7 +169,7 @@ def leverage(self): def leverage(self, leverage): """Sets the leverage of this FuturesLiquidate. - Position leverage. Not returned in public endpoints. # noqa: E501 + Position leverage. Not returned in public endpoints # noqa: E501 :param leverage: The leverage of this FuturesLiquidate. # noqa: E501 :type: str @@ -219,7 +204,7 @@ def size(self, size): def margin(self): """Gets the margin of this FuturesLiquidate. # noqa: E501 - Position margin. Not returned in public endpoints. # noqa: E501 + Position margin. Not returned in public endpoints # noqa: E501 :return: The margin of this FuturesLiquidate. # noqa: E501 :rtype: str @@ -230,7 +215,7 @@ def margin(self): def margin(self, margin): """Sets the margin of this FuturesLiquidate. - Position margin. Not returned in public endpoints. # noqa: E501 + Position margin. Not returned in public endpoints # noqa: E501 :param margin: The margin of this FuturesLiquidate. # noqa: E501 :type: str @@ -242,7 +227,7 @@ def margin(self, margin): def entry_price(self): """Gets the entry_price of this FuturesLiquidate. # noqa: E501 - Average entry price. Not returned in public endpoints. # noqa: E501 + Average entry price. Not returned in public endpoints # noqa: E501 :return: The entry_price of this FuturesLiquidate. # noqa: E501 :rtype: str @@ -253,7 +238,7 @@ def entry_price(self): def entry_price(self, entry_price): """Sets the entry_price of this FuturesLiquidate. - Average entry price. Not returned in public endpoints. # noqa: E501 + Average entry price. Not returned in public endpoints # noqa: E501 :param entry_price: The entry_price of this FuturesLiquidate. # noqa: E501 :type: str @@ -265,7 +250,7 @@ def entry_price(self, entry_price): def liq_price(self): """Gets the liq_price of this FuturesLiquidate. # noqa: E501 - Liquidation price. Not returned in public endpoints. # noqa: E501 + Liquidation price. Not returned in public endpoints # noqa: E501 :return: The liq_price of this FuturesLiquidate. # noqa: E501 :rtype: str @@ -276,7 +261,7 @@ def liq_price(self): def liq_price(self, liq_price): """Sets the liq_price of this FuturesLiquidate. - Liquidation price. Not returned in public endpoints. # noqa: E501 + Liquidation price. Not returned in public endpoints # noqa: E501 :param liq_price: The liq_price of this FuturesLiquidate. # noqa: E501 :type: str @@ -288,7 +273,7 @@ def liq_price(self, liq_price): def mark_price(self): """Gets the mark_price of this FuturesLiquidate. # noqa: E501 - Mark price. Not returned in public endpoints. # noqa: E501 + Mark price. Not returned in public endpoints # noqa: E501 :return: The mark_price of this FuturesLiquidate. # noqa: E501 :rtype: str @@ -299,7 +284,7 @@ def mark_price(self): def mark_price(self, mark_price): """Sets the mark_price of this FuturesLiquidate. - Mark price. Not returned in public endpoints. # noqa: E501 + Mark price. Not returned in public endpoints # noqa: E501 :param mark_price: The mark_price of this FuturesLiquidate. # noqa: E501 :type: str @@ -311,7 +296,7 @@ def mark_price(self, mark_price): def order_id(self): """Gets the order_id of this FuturesLiquidate. # noqa: E501 - Liquidation order ID. Not returned in public endpoints. # noqa: E501 + Liquidation order ID. Not returned in public endpoints # noqa: E501 :return: The order_id of this FuturesLiquidate. # noqa: E501 :rtype: int @@ -322,7 +307,7 @@ def order_id(self): def order_id(self, order_id): """Sets the order_id of this FuturesLiquidate. - Liquidation order ID. Not returned in public endpoints. # noqa: E501 + Liquidation order ID. Not returned in public endpoints # noqa: E501 :param order_id: The order_id of this FuturesLiquidate. # noqa: E501 :type: int @@ -406,16 +391,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/futures_order.py b/gate_api/models/futures_order.py index d01344a..0f60281 100644 --- a/gate_api/models/futures_order.py +++ b/gate_api/models/futures_order.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -36,6 +36,7 @@ class FuturesOrder(object): 'id': 'int', 'user': 'int', 'create_time': 'float', + 'update_time': 'float', 'finish_time': 'float', 'finish_as': 'str', 'status': 'str', @@ -56,12 +57,18 @@ class FuturesOrder(object): 'mkfr': 'str', 'refu': 'int', 'auto_size': 'str', + 'stp_id': 'int', + 'stp_act': 'str', + 'amend_text': 'str', + 'limit_vip': 'int', + 'pid': 'int' } attribute_map = { 'id': 'id', 'user': 'user', 'create_time': 'create_time', + 'update_time': 'update_time', 'finish_time': 'finish_time', 'finish_as': 'finish_as', 'status': 'status', @@ -82,36 +89,15 @@ class FuturesOrder(object): 'mkfr': 'mkfr', 'refu': 'refu', 'auto_size': 'auto_size', + 'stp_id': 'stp_id', + 'stp_act': 'stp_act', + 'amend_text': 'amend_text', + 'limit_vip': 'limit_vip', + 'pid': 'pid' } - def __init__( - self, - id=None, - user=None, - create_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, - local_vars_configuration=None, - ): # noqa: E501 - # type: (int, int, float, float, str, str, str, int, int, str, bool, bool, bool, bool, bool, str, int, str, str, str, str, int, 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, limit_vip=None, pid=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, float, float, float, str, str, str, int, int, str, bool, bool, bool, bool, bool, str, int, str, str, str, str, int, str, int, str, str, int, int, Configuration) -> None """FuturesOrder - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -120,6 +106,7 @@ def __init__( 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 @@ -140,6 +127,11 @@ def __init__( self._mkfr = None self._refu = None self._auto_size = None + self._stp_id = None + self._stp_act = None + self._amend_text = None + self._limit_vip = None + self._pid = None self.discriminator = None if id is not None: @@ -148,6 +140,8 @@ def __init__( 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: @@ -186,6 +180,16 @@ def __init__( 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 limit_vip is not None: + self.limit_vip = limit_vip + if pid is not None: + self.pid = pid @property def id(self): @@ -256,6 +260,29 @@ def create_time(self, create_time): self._create_time = create_time + @property + def update_time(self): + """Gets the update_time of this FuturesOrder. # noqa: E501 + + OrderUpdateTime # noqa: E501 + + :return: The update_time of this FuturesOrder. # noqa: E501 + :rtype: float + """ + return self._update_time + + @update_time.setter + def update_time(self, update_time): + """Sets the update_time of this FuturesOrder. + + OrderUpdateTime # noqa: E501 + + :param update_time: The update_time of this FuturesOrder. # noqa: E501 + :type: float + """ + + self._update_time = update_time + @property def finish_time(self): """Gets the finish_time of this FuturesOrder. # noqa: E501 @@ -283,7 +310,7 @@ def finish_time(self, finish_time): def finish_as(self): """Gets the finish_as of this FuturesOrder. # 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 of position close # 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 FuturesOrder. # noqa: E501 :rtype: str @@ -294,26 +321,16 @@ def finish_as(self): def finish_as(self, finish_as): """Sets the finish_as of this FuturesOrder. - 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 of position close # 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 :param finish_as: The finish_as of this FuturesOrder. # noqa: E501 :type: str """ - allowed_values = [ - "filled", - "cancelled", - "liquidated", - "ioc", - "auto_deleveraged", - "reduce_only", - "position_closed", - "reduce_out", - ] # noqa: E501 + 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}".format( # noqa: E501 - finish_as, allowed_values - ) + "Invalid value for `finish_as` ({0}), must be one of {1}" # noqa: E501 + .format(finish_as, allowed_values) ) self._finish_as = finish_as @@ -322,7 +339,7 @@ def finish_as(self, finish_as): def status(self): """Gets the status of this FuturesOrder. # noqa: E501 - Order status - `open`: waiting to be traded - `finished`: finished # noqa: E501 + Order status - `open`: Pending - `finished`: Completed # noqa: E501 :return: The status of this FuturesOrder. # noqa: E501 :rtype: str @@ -333,7 +350,7 @@ def status(self): def status(self, status): """Sets the status of this FuturesOrder. - Order status - `open`: waiting to be traded - `finished`: finished # noqa: E501 + Order status - `open`: Pending - `finished`: Completed # noqa: E501 :param status: The status of this FuturesOrder. # noqa: E501 :type: str @@ -341,7 +358,8 @@ def status(self, status): 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}".format(status, allowed_values) # noqa: E501 + "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 + .format(status, allowed_values) ) self._status = status @@ -375,7 +393,7 @@ def contract(self, contract): def size(self): """Gets the size of this FuturesOrder. # noqa: E501 - Order size. Specify positive number to make a bid, and negative number to ask # 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 FuturesOrder. # noqa: E501 :rtype: int @@ -386,7 +404,7 @@ def size(self): def size(self, size): """Sets the size of this FuturesOrder. - Order size. Specify positive number to make a bid, and negative number to ask # noqa: E501 + Required. Trading quantity. Positive for buy, negative for sell. Set to 0 for close position orders. # noqa: E501 :param size: The size of this FuturesOrder. # noqa: E501 :type: int @@ -400,7 +418,7 @@ def size(self, size): def iceberg(self): """Gets the iceberg of this FuturesOrder. # noqa: E501 - Display size for iceberg order. 0 for non-iceberg. Note that you will have to pay the taker fee for the hidden size # 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 FuturesOrder. # noqa: E501 :rtype: int @@ -411,7 +429,7 @@ def iceberg(self): def iceberg(self, iceberg): """Sets the iceberg of this FuturesOrder. - Display size for iceberg order. 0 for non-iceberg. Note that you will have to pay the taker fee for the hidden size # noqa: E501 + 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 FuturesOrder. # noqa: E501 :type: int @@ -423,7 +441,7 @@ def iceberg(self, iceberg): def price(self): """Gets the price of this FuturesOrder. # noqa: E501 - Order price. 0 for market order with `tif` set as `ioc` # noqa: E501 + Order price. Price of 0 with `tif` set to `ioc` represents a market order. # noqa: E501 :return: The price of this FuturesOrder. # noqa: E501 :rtype: str @@ -434,7 +452,7 @@ def price(self): def price(self, price): """Sets the price of this FuturesOrder. - Order price. 0 for market order with `tif` set as `ioc` # noqa: E501 + Order price. Price of 0 with `tif` set to `ioc` represents a market order. # noqa: E501 :param price: The price of this FuturesOrder. # noqa: E501 :type: str @@ -561,7 +579,7 @@ def is_liq(self, is_liq): def tif(self): """Gets the tif of this FuturesOrder. # noqa: E501 - Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, reduce-only # 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 FuturesOrder. # noqa: E501 :rtype: str @@ -572,15 +590,16 @@ def tif(self): def tif(self, tif): """Sets the tif of this FuturesOrder. - Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, reduce-only # 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 :param tif: The tif of this FuturesOrder. # noqa: E501 :type: str """ - allowed_values = ["gtc", "ioc", "poc"] # noqa: E501 + 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}".format(tif, allowed_values) # noqa: E501 + "Invalid value for `tif` ({0}), must be one of {1}" # noqa: E501 + .format(tif, allowed_values) ) self._tif = tif @@ -589,7 +608,7 @@ def tif(self, tif): def left(self): """Gets the left of this FuturesOrder. # noqa: E501 - Size left to be traded # noqa: E501 + Unfilled quantity # noqa: E501 :return: The left of this FuturesOrder. # noqa: E501 :rtype: int @@ -600,7 +619,7 @@ def left(self): def left(self, left): """Sets the left of this FuturesOrder. - Size left to be traded # noqa: E501 + Unfilled quantity # noqa: E501 :param left: The left of this FuturesOrder. # noqa: E501 :type: int @@ -612,7 +631,7 @@ def left(self, left): def fill_price(self): """Gets the fill_price of this FuturesOrder. # noqa: E501 - Fill price of the order # noqa: E501 + Fill price # noqa: E501 :return: The fill_price of this FuturesOrder. # noqa: E501 :rtype: str @@ -623,7 +642,7 @@ def fill_price(self): def fill_price(self, fill_price): """Sets the fill_price of this FuturesOrder. - Fill price of the order # noqa: E501 + Fill price # noqa: E501 :param fill_price: The fill_price of this FuturesOrder. # noqa: E501 :type: str @@ -635,7 +654,7 @@ def fill_price(self, fill_price): def text(self): """Gets the text of this FuturesOrder. # 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: - web: from web - api: from API - app: from mobile phones - auto_deleveraging: from ADL - liquidation: from liquidation - insurance: from insurance # 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 # noqa: E501 :return: The text of this FuturesOrder. # noqa: E501 :rtype: str @@ -646,7 +665,7 @@ def text(self): def text(self, text): """Sets the text of this FuturesOrder. - 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: - web: from web - api: from API - app: from mobile phones - auto_deleveraging: from ADL - liquidation: from liquidation - insurance: from insurance # 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 # noqa: E501 :param text: The text of this FuturesOrder. # noqa: E501 :type: str @@ -704,7 +723,7 @@ def mkfr(self, mkfr): def refu(self): """Gets the refu of this FuturesOrder. # noqa: E501 - Reference user ID # noqa: E501 + Referrer user ID # noqa: E501 :return: The refu of this FuturesOrder. # noqa: E501 :rtype: int @@ -715,7 +734,7 @@ def refu(self): def refu(self, refu): """Sets the refu of this FuturesOrder. - Reference user ID # noqa: E501 + Referrer user ID # noqa: E501 :param refu: The refu of this FuturesOrder. # noqa: E501 :type: int @@ -746,13 +765,133 @@ def auto_size(self, auto_size): 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}".format( # noqa: E501 - auto_size, allowed_values - ) + "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 FuturesOrder. # 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 FuturesOrder. # noqa: E501 + :rtype: int + """ + return self._stp_id + + @stp_id.setter + def stp_id(self, stp_id): + """Sets the stp_id of this FuturesOrder. + + 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 FuturesOrder. # noqa: E501 + :type: int + """ + + self._stp_id = stp_id + + @property + def stp_act(self): + """Gets the stp_act of this FuturesOrder. # 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 FuturesOrder. # noqa: E501 + :rtype: str + """ + return self._stp_act + + @stp_act.setter + def stp_act(self, stp_act): + """Sets the stp_act of this FuturesOrder. + + 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 FuturesOrder. # 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 FuturesOrder. # noqa: E501 + + The custom data that the user remarked when amending the order # noqa: E501 + + :return: The amend_text of this FuturesOrder. # noqa: E501 + :rtype: str + """ + return self._amend_text + + @amend_text.setter + def amend_text(self, amend_text): + """Sets the amend_text of this FuturesOrder. + + The custom data that the user remarked when amending the order # noqa: E501 + + :param amend_text: The amend_text of this FuturesOrder. # noqa: E501 + :type: str + """ + + self._amend_text = amend_text + + @property + def limit_vip(self): + """Gets the limit_vip of this FuturesOrder. # 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 FuturesOrder. # noqa: E501 + :rtype: int + """ + return self._limit_vip + + @limit_vip.setter + def limit_vip(self, limit_vip): + """Sets the limit_vip of this FuturesOrder. + + 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 FuturesOrder. # noqa: E501 + :type: int + """ + + self._limit_vip = limit_vip + + @property + def pid(self): + """Gets the pid of this FuturesOrder. # noqa: E501 + + Position ID # noqa: E501 + + :return: The pid of this FuturesOrder. # noqa: E501 + :rtype: int + """ + return self._pid + + @pid.setter + def pid(self, pid): + """Sets the pid of this FuturesOrder. + + Position ID # noqa: E501 + + :param pid: The pid of this FuturesOrder. # noqa: E501 + :type: int + """ + + self._pid = pid + def to_dict(self): """Returns the model properties as a dict""" result = {} @@ -760,16 +899,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/futures_order_amendment.py b/gate_api/models/futures_order_amendment.py new file mode 100644 index 0000000..1232631 --- /dev/null +++ b/gate_api/models/futures_order_amendment.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 FuturesOrderAmendment(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'size': 'int', + 'price': 'str', + 'amend_text': 'str', + 'text': 'str' + } + + attribute_map = { + 'size': 'size', + 'price': 'price', + 'amend_text': 'amend_text', + 'text': 'text' + } + + def __init__(self, size=None, price=None, amend_text=None, text=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, str, str, Configuration) -> None + """FuturesOrderAmendment - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._size = None + self._price = None + self._amend_text = None + self._text = None + self.discriminator = None + + if size is not None: + self.size = size + if price is not None: + self.price = price + if amend_text is not None: + self.amend_text = amend_text + if text is not None: + self.text = text + + @property + def size(self): + """Gets the size of this FuturesOrderAmendment. # noqa: E501 + + New order size, including filled part. - If new size is less than or equal to filled size, the order will be cancelled. - Order side must be identical to the original one. - Close order size cannot be changed. - For reduce only orders, increasing size may leads to other reduce only orders being cancelled. - If price is not changed, decreasing size will not change its precedence in order book, while increasing will move it to the last at current price. # noqa: E501 + + :return: The size of this FuturesOrderAmendment. # noqa: E501 + :rtype: int + """ + return self._size + + @size.setter + def size(self, size): + """Sets the size of this FuturesOrderAmendment. + + New order size, including filled part. - If new size is less than or equal to filled size, the order will be cancelled. - Order side must be identical to the original one. - Close order size cannot be changed. - For reduce only orders, increasing size may leads to other reduce only orders being cancelled. - If price is not changed, decreasing size will not change its precedence in order book, while increasing will move it to the last at current price. # noqa: E501 + + :param size: The size of this FuturesOrderAmendment. # noqa: E501 + :type: int + """ + + self._size = size + + @property + def price(self): + """Gets the price of this FuturesOrderAmendment. # noqa: E501 + + New order price # noqa: E501 + + :return: The price of this FuturesOrderAmendment. # noqa: E501 + :rtype: str + """ + return self._price + + @price.setter + def price(self, price): + """Sets the price of this FuturesOrderAmendment. + + New order price # noqa: E501 + + :param price: The price of this FuturesOrderAmendment. # noqa: E501 + :type: str + """ + + self._price = price + + @property + def amend_text(self): + """Gets the amend_text of this FuturesOrderAmendment. # noqa: E501 + + Custom info during order amendment # noqa: E501 + + :return: The amend_text of this FuturesOrderAmendment. # noqa: E501 + :rtype: str + """ + return self._amend_text + + @amend_text.setter + def amend_text(self, amend_text): + """Sets the amend_text of this FuturesOrderAmendment. + + Custom info during order amendment # noqa: E501 + + :param amend_text: The amend_text of this FuturesOrderAmendment. # noqa: E501 + :type: str + """ + + self._amend_text = amend_text + + @property + def text(self): + """Gets the text of this FuturesOrderAmendment. # noqa: E501 + + Internal users can modify information in the text field. # noqa: E501 + + :return: The text of this FuturesOrderAmendment. # noqa: E501 + :rtype: str + """ + return self._text + + @text.setter + def text(self, text): + """Sets the text of this FuturesOrderAmendment. + + Internal users can modify information in the text field. # noqa: E501 + + :param text: The text of this FuturesOrderAmendment. # 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, FuturesOrderAmendment): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FuturesOrderAmendment): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/futures_order_book.py b/gate_api/models/futures_order_book.py index 93c1ea7..cc240a6 100644 --- a/gate_api/models/futures_order_book.py +++ b/gate_api/models/futures_order_book.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -37,14 +37,18 @@ class FuturesOrderBook(object): 'current': 'float', 'update': 'float', 'asks': 'list[FuturesOrderBookItem]', - 'bids': 'list[FuturesOrderBookItem]', + 'bids': 'list[FuturesOrderBookItem]' } - attribute_map = {'id': 'id', 'current': 'current', 'update': 'update', 'asks': 'asks', 'bids': 'bids'} + attribute_map = { + 'id': 'id', + 'current': 'current', + 'update': 'update', + 'asks': 'asks', + 'bids': 'bids' + } - def __init__( - self, id=None, current=None, update=None, asks=None, bids=None, local_vars_configuration=None - ): # noqa: E501 + def __init__(self, id=None, current=None, update=None, asks=None, bids=None, local_vars_configuration=None): # noqa: E501 # type: (int, float, float, list[FuturesOrderBookItem], list[FuturesOrderBookItem], Configuration) -> None """FuturesOrderBook - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: @@ -140,7 +144,7 @@ def update(self, update): def asks(self): """Gets the asks of this FuturesOrderBook. # noqa: E501 - Asks order depth # noqa: E501 + Ask Depth # noqa: E501 :return: The asks of this FuturesOrderBook. # noqa: E501 :rtype: list[FuturesOrderBookItem] @@ -151,7 +155,7 @@ def asks(self): def asks(self, asks): """Sets the asks of this FuturesOrderBook. - Asks order depth # noqa: E501 + Ask Depth # noqa: E501 :param asks: The asks of this FuturesOrderBook. # noqa: E501 :type: list[FuturesOrderBookItem] @@ -165,7 +169,7 @@ def asks(self, asks): def bids(self): """Gets the bids of this FuturesOrderBook. # noqa: E501 - Bids order depth # noqa: E501 + Bid Depth # noqa: E501 :return: The bids of this FuturesOrderBook. # noqa: E501 :rtype: list[FuturesOrderBookItem] @@ -176,7 +180,7 @@ def bids(self): def bids(self, bids): """Sets the bids of this FuturesOrderBook. - Bids order depth # noqa: E501 + Bid Depth # noqa: E501 :param bids: The bids of this FuturesOrderBook. # noqa: E501 :type: list[FuturesOrderBookItem] @@ -193,16 +197,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/futures_order_book_item.py b/gate_api/models/futures_order_book_item.py index 7976974..4ca4732 100644 --- a/gate_api/models/futures_order_book_item.py +++ b/gate_api/models/futures_order_book_item.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -32,9 +32,15 @@ class FuturesOrderBookItem(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {'p': 'str', 's': 'int'} + openapi_types = { + 'p': 'str', + 's': 'int' + } - attribute_map = {'p': 'p', 's': 's'} + attribute_map = { + 'p': 'p', + 's': 's' + } def __init__(self, p=None, s=None, local_vars_configuration=None): # noqa: E501 # type: (str, int, Configuration) -> None @@ -56,7 +62,7 @@ def __init__(self, p=None, s=None, local_vars_configuration=None): # noqa: E501 def p(self): """Gets the p of this FuturesOrderBookItem. # noqa: E501 - Price # noqa: E501 + Price (quote currency) # noqa: E501 :return: The p of this FuturesOrderBookItem. # noqa: E501 :rtype: str @@ -67,7 +73,7 @@ def p(self): def p(self, p): """Sets the p of this FuturesOrderBookItem. - Price # noqa: E501 + Price (quote currency) # noqa: E501 :param p: The p of this FuturesOrderBookItem. # noqa: E501 :type: str @@ -105,16 +111,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/futures_position_cross_mode.py b/gate_api/models/futures_position_cross_mode.py new file mode 100644 index 0000000..4f4a83c --- /dev/null +++ b/gate_api/models/futures_position_cross_mode.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 FuturesPositionCrossMode(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'mode': 'str', + 'contract': 'str' + } + + attribute_map = { + 'mode': 'mode', + 'contract': 'contract' + } + + def __init__(self, mode=None, contract=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """FuturesPositionCrossMode - a 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._contract = None + self.discriminator = None + + self.mode = mode + self.contract = contract + + @property + 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 + + :return: The mode of this FuturesPositionCrossMode. # noqa: E501 + :rtype: str + """ + return self._mode + + @mode.setter + 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 + + :param mode: The mode of this FuturesPositionCrossMode. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and mode is None: # noqa: E501 + raise ValueError("Invalid value for `mode`, must not be `None`") # noqa: E501 + + self._mode = mode + + @property + def contract(self): + """Gets the contract of this FuturesPositionCrossMode. # noqa: E501 + + Futures market # noqa: E501 + + :return: The contract of this FuturesPositionCrossMode. # noqa: E501 + :rtype: str + """ + return self._contract + + @contract.setter + def contract(self, contract): + """Sets the contract of this FuturesPositionCrossMode. + + Futures market # noqa: E501 + + :param contract: The contract of this FuturesPositionCrossMode. # 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 + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FuturesPositionCrossMode): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FuturesPositionCrossMode): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/futures_premium_index.py b/gate_api/models/futures_premium_index.py new file mode 100644 index 0000000..f02adc1 --- /dev/null +++ b/gate_api/models/futures_premium_index.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 FuturesPremiumIndex(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 't': 'float', + 'c': 'str', + 'h': 'str', + 'l': 'str', + 'o': 'str' + } + + attribute_map = { + 't': 't', + 'c': 'c', + 'h': 'h', + 'l': 'l', + 'o': 'o' + } + + def __init__(self, t=None, c=None, h=None, l=None, o=None, local_vars_configuration=None): # noqa: E501 + # type: (float, str, str, str, str, Configuration) -> None + """FuturesPremiumIndex - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._t = None + self._c = None + self._h = None + self._l = None + self._o = None + self.discriminator = None + + if t is not None: + self.t = t + 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 o is not None: + self.o = o + + @property + def t(self): + """Gets the t of this FuturesPremiumIndex. # noqa: E501 + + Unix timestamp in seconds # noqa: E501 + + :return: The t of this FuturesPremiumIndex. # noqa: E501 + :rtype: float + """ + return self._t + + @t.setter + def t(self, t): + """Sets the t of this FuturesPremiumIndex. + + Unix timestamp in seconds # noqa: E501 + + :param t: The t of this FuturesPremiumIndex. # noqa: E501 + :type: float + """ + + self._t = t + + @property + def c(self): + """Gets the c of this FuturesPremiumIndex. # noqa: E501 + + Close price # noqa: E501 + + :return: The c of this FuturesPremiumIndex. # noqa: E501 + :rtype: str + """ + return self._c + + @c.setter + def c(self, c): + """Sets the c of this FuturesPremiumIndex. + + Close price # noqa: E501 + + :param c: The c of this FuturesPremiumIndex. # noqa: E501 + :type: str + """ + + self._c = c + + @property + def h(self): + """Gets the h of this FuturesPremiumIndex. # noqa: E501 + + Highest price # noqa: E501 + + :return: The h of this FuturesPremiumIndex. # noqa: E501 + :rtype: str + """ + return self._h + + @h.setter + def h(self, h): + """Sets the h of this FuturesPremiumIndex. + + Highest price # noqa: E501 + + :param h: The h of this FuturesPremiumIndex. # noqa: E501 + :type: str + """ + + self._h = h + + @property + def l(self): + """Gets the l of this FuturesPremiumIndex. # noqa: E501 + + Lowest price # noqa: E501 + + :return: The l of this FuturesPremiumIndex. # noqa: E501 + :rtype: str + """ + return self._l + + @l.setter + def l(self, l): + """Sets the l of this FuturesPremiumIndex. + + Lowest price # noqa: E501 + + :param l: The l of this FuturesPremiumIndex. # noqa: E501 + :type: str + """ + + self._l = l + + @property + def o(self): + """Gets the o of this FuturesPremiumIndex. # noqa: E501 + + Open price # noqa: E501 + + :return: The o of this FuturesPremiumIndex. # noqa: E501 + :rtype: str + """ + return self._o + + @o.setter + def o(self, o): + """Sets the o of this FuturesPremiumIndex. + + Open price # noqa: E501 + + :param o: The o of this FuturesPremiumIndex. # noqa: E501 + :type: str + """ + + self._o = o + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FuturesPremiumIndex): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FuturesPremiumIndex): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/futures_price_trigger.py b/gate_api/models/futures_price_trigger.py index 4f6b612..7dd48a6 100644 --- a/gate_api/models/futures_price_trigger.py +++ b/gate_api/models/futures_price_trigger.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -32,19 +32,23 @@ class FuturesPriceTrigger(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {'strategy_type': 'int', 'price_type': 'int', 'price': 'str', 'rule': 'int', 'expiration': 'int'} + openapi_types = { + 'strategy_type': 'int', + 'price_type': 'int', + 'price': 'str', + 'rule': 'int', + 'expiration': 'int' + } attribute_map = { 'strategy_type': 'strategy_type', 'price_type': 'price_type', 'price': 'price', 'rule': 'rule', - 'expiration': 'expiration', + 'expiration': 'expiration' } - def __init__( - self, strategy_type=None, price_type=None, price=None, rule=None, expiration=None, local_vars_configuration=None - ): # noqa: E501 + def __init__(self, strategy_type=None, price_type=None, price=None, rule=None, expiration=None, local_vars_configuration=None): # noqa: E501 # type: (int, int, str, int, int, Configuration) -> None """FuturesPriceTrigger - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: @@ -73,7 +77,7 @@ def __init__( def strategy_type(self): """Gets the strategy_type of this FuturesPriceTrigger. # noqa: E501 - How the order will be triggered - `0`: by price, which means the order will be triggered if price condition is satisfied - `1`: by price gap, which means the order will be triggered if gap of recent two prices of specified `price_type` are satisfied. Only `0` is supported currently # noqa: E501 + Trigger Strategy - 0: Price trigger, triggered when price meets conditions - 1: Price spread trigger, i.e. the difference between the latest price specified in `price_type` and the second-last price Currently only supports 0 (latest transaction price) # noqa: E501 :return: The strategy_type of this FuturesPriceTrigger. # noqa: E501 :rtype: int @@ -84,7 +88,7 @@ def strategy_type(self): def strategy_type(self, strategy_type): """Sets the strategy_type of this FuturesPriceTrigger. - How the order will be triggered - `0`: by price, which means the order will be triggered if price condition is satisfied - `1`: by price gap, which means the order will be triggered if gap of recent two prices of specified `price_type` are satisfied. Only `0` is supported currently # noqa: E501 + Trigger Strategy - 0: Price trigger, triggered when price meets conditions - 1: Price spread trigger, i.e. the difference between the latest price specified in `price_type` and the second-last price Currently only supports 0 (latest transaction price) # noqa: E501 :param strategy_type: The strategy_type of this FuturesPriceTrigger. # noqa: E501 :type: int @@ -92,9 +96,8 @@ def strategy_type(self, strategy_type): allowed_values = [0, 1] # 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}".format( # noqa: E501 - strategy_type, allowed_values - ) + "Invalid value for `strategy_type` ({0}), must be one of {1}" # noqa: E501 + .format(strategy_type, allowed_values) ) self._strategy_type = strategy_type @@ -103,7 +106,7 @@ def strategy_type(self, strategy_type): def price_type(self): """Gets the price_type of this FuturesPriceTrigger. # noqa: E501 - Price type. 0 - latest deal price, 1 - mark price, 2 - index price # noqa: E501 + Reference price type. 0 - Latest trade price, 1 - Mark price, 2 - Index price # noqa: E501 :return: The price_type of this FuturesPriceTrigger. # noqa: E501 :rtype: int @@ -114,7 +117,7 @@ def price_type(self): def price_type(self, price_type): """Sets the price_type of this FuturesPriceTrigger. - Price type. 0 - latest deal price, 1 - mark price, 2 - index price # noqa: E501 + Reference price type. 0 - Latest trade price, 1 - Mark price, 2 - Index price # noqa: E501 :param price_type: The price_type of this FuturesPriceTrigger. # noqa: E501 :type: int @@ -122,9 +125,8 @@ def price_type(self, price_type): allowed_values = [0, 1, 2] # 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}".format( # noqa: E501 - price_type, allowed_values - ) + "Invalid value for `price_type` ({0}), must be one of {1}" # noqa: E501 + .format(price_type, allowed_values) ) self._price_type = price_type @@ -133,7 +135,7 @@ def price_type(self, price_type): def price(self): """Gets the price of this FuturesPriceTrigger. # noqa: E501 - Value of price on price triggered, or price gap on price gap triggered # noqa: E501 + Price value for price trigger, or spread value for spread trigger # noqa: E501 :return: The price of this FuturesPriceTrigger. # noqa: E501 :rtype: str @@ -144,7 +146,7 @@ def price(self): def price(self, price): """Sets the price of this FuturesPriceTrigger. - Value of price on price triggered, or price gap on price gap triggered # noqa: E501 + Price value for price trigger, or spread value for spread trigger # noqa: E501 :param price: The price of this FuturesPriceTrigger. # noqa: E501 :type: str @@ -156,7 +158,7 @@ def price(self, price): def rule(self): """Gets the rule of this FuturesPriceTrigger. # noqa: E501 - Trigger condition type - `1`: calculated price based on `strategy_type` and `price_type` >= `price` - `2`: calculated price based on `strategy_type` and `price_type` <= `price` # noqa: E501 + Price Condition Type - 1: Trigger when the price calculated based on `strategy_type` and `price_type` is greater than or equal to `Trigger.Price`, while Trigger.Price must > last_price - 2: Trigger when the price calculated based on `strategy_type` and `price_type` is less than or equal to `Trigger.Price`, and Trigger.Price must < last_price # noqa: E501 :return: The rule of this FuturesPriceTrigger. # noqa: E501 :rtype: int @@ -167,7 +169,7 @@ def rule(self): def rule(self, rule): """Sets the rule of this FuturesPriceTrigger. - Trigger condition type - `1`: calculated price based on `strategy_type` and `price_type` >= `price` - `2`: calculated price based on `strategy_type` and `price_type` <= `price` # noqa: E501 + Price Condition Type - 1: Trigger when the price calculated based on `strategy_type` and `price_type` is greater than or equal to `Trigger.Price`, while Trigger.Price must > last_price - 2: Trigger when the price calculated based on `strategy_type` and `price_type` is less than or equal to `Trigger.Price`, and Trigger.Price must < last_price # noqa: E501 :param rule: The rule of this FuturesPriceTrigger. # noqa: E501 :type: int @@ -175,7 +177,8 @@ def rule(self, rule): allowed_values = [1, 2] # noqa: E501 if self.local_vars_configuration.client_side_validation and rule not in allowed_values: # noqa: E501 raise ValueError( - "Invalid value for `rule` ({0}), must be one of {1}".format(rule, allowed_values) # noqa: E501 + "Invalid value for `rule` ({0}), must be one of {1}" # noqa: E501 + .format(rule, allowed_values) ) self._rule = rule @@ -184,7 +187,7 @@ def rule(self, rule): def expiration(self): """Gets the expiration of this FuturesPriceTrigger. # noqa: E501 - How long (in seconds) to wait for the condition to be triggered before cancelling the order. # noqa: E501 + Maximum wait time for trigger condition (in seconds). Order will be cancelled if timeout # noqa: E501 :return: The expiration of this FuturesPriceTrigger. # noqa: E501 :rtype: int @@ -195,7 +198,7 @@ def expiration(self): def expiration(self, expiration): """Sets the expiration of this FuturesPriceTrigger. - How long (in seconds) to wait for the condition to be triggered before cancelling the order. # noqa: E501 + Maximum wait time for trigger condition (in seconds). Order will be cancelled if timeout # noqa: E501 :param expiration: The expiration of this FuturesPriceTrigger. # noqa: E501 :type: int @@ -210,16 +213,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/futures_price_triggered_order.py b/gate_api/models/futures_price_triggered_order.py index 009cac4..14e16ae 100644 --- a/gate_api/models/futures_price_triggered_order.py +++ b/gate_api/models/futures_price_triggered_order.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -43,6 +43,8 @@ class FuturesPriceTriggeredOrder(object): 'status': 'str', 'finish_as': 'str', 'reason': 'str', + 'order_type': 'str', + 'me_order_id': 'int' } attribute_map = { @@ -56,23 +58,12 @@ class FuturesPriceTriggeredOrder(object): 'status': 'status', 'finish_as': 'finish_as', 'reason': 'reason', + 'order_type': 'order_type', + 'me_order_id': 'me_order_id' } - 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, - local_vars_configuration=None, - ): # noqa: E501 - # type: (FuturesInitialOrder, FuturesPriceTrigger, int, int, float, float, int, str, str, str, Configuration) -> None + 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 """FuturesPriceTriggeredOrder - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -88,6 +79,8 @@ def __init__( self._status = None self._finish_as = None self._reason = None + self._order_type = None + self._me_order_id = None self.discriminator = None self.initial = initial @@ -108,6 +101,10 @@ def __init__( self.finish_as = finish_as if reason is not None: self.reason = reason + if order_type is not None: + self.order_type = order_type + if me_order_id is not None: + self.me_order_id = me_order_id @property def initial(self): @@ -205,7 +202,7 @@ def user(self, user): def create_time(self): """Gets the create_time of this FuturesPriceTriggeredOrder. # noqa: E501 - Creation time # noqa: E501 + Created time # noqa: E501 :return: The create_time of this FuturesPriceTriggeredOrder. # noqa: E501 :rtype: float @@ -216,7 +213,7 @@ def create_time(self): def create_time(self, create_time): """Sets the create_time of this FuturesPriceTriggeredOrder. - Creation time # noqa: E501 + Created time # noqa: E501 :param create_time: The create_time of this FuturesPriceTriggeredOrder. # noqa: E501 :type: float @@ -228,7 +225,7 @@ def create_time(self, create_time): def finish_time(self): """Gets the finish_time of this FuturesPriceTriggeredOrder. # noqa: E501 - Finished time # noqa: E501 + End time # noqa: E501 :return: The finish_time of this FuturesPriceTriggeredOrder. # noqa: E501 :rtype: float @@ -239,7 +236,7 @@ def finish_time(self): def finish_time(self, finish_time): """Sets the finish_time of this FuturesPriceTriggeredOrder. - Finished time # noqa: E501 + End time # noqa: E501 :param finish_time: The finish_time of this FuturesPriceTriggeredOrder. # noqa: E501 :type: float @@ -251,7 +248,7 @@ def finish_time(self, finish_time): def trade_id(self): """Gets the trade_id of this FuturesPriceTriggeredOrder. # noqa: E501 - ID of the newly created order on condition triggered # noqa: E501 + ID of the order created after trigger # noqa: E501 :return: The trade_id of this FuturesPriceTriggeredOrder. # noqa: E501 :rtype: int @@ -262,7 +259,7 @@ def trade_id(self): def trade_id(self, trade_id): """Sets the trade_id of this FuturesPriceTriggeredOrder. - ID of the newly created order on condition triggered # noqa: E501 + ID of the order created after trigger # noqa: E501 :param trade_id: The trade_id of this FuturesPriceTriggeredOrder. # noqa: E501 :type: int @@ -274,7 +271,7 @@ def trade_id(self, trade_id): def status(self): """Gets the status of this FuturesPriceTriggeredOrder. # noqa: E501 - Order status. # noqa: E501 + Order status - `open`: Active - `finished`: Finished - `inactive`: Inactive, only applies to order take-profit/stop-loss - `invalid`: Invalid, only applies to order take-profit/stop-loss # noqa: E501 :return: The status of this FuturesPriceTriggeredOrder. # noqa: E501 :rtype: str @@ -285,15 +282,16 @@ def status(self): def status(self, status): """Sets the status of this FuturesPriceTriggeredOrder. - Order status. # noqa: E501 + Order status - `open`: Active - `finished`: Finished - `inactive`: Inactive, only applies to order take-profit/stop-loss - `invalid`: Invalid, only applies to order take-profit/stop-loss # noqa: E501 :param status: The status of this FuturesPriceTriggeredOrder. # noqa: E501 :type: str """ - allowed_values = ["open", "finished"] # noqa: E501 + allowed_values = ["open", "finished", "inactive", "invalid"] # 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}".format(status, allowed_values) # noqa: E501 + "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 + .format(status, allowed_values) ) self._status = status @@ -302,7 +300,7 @@ def status(self, status): def finish_as(self): """Gets the finish_as of this FuturesPriceTriggeredOrder. # noqa: E501 - How order is finished # noqa: E501 + Finish status: cancelled - Cancelled; succeeded - Succeeded; failed - Failed; expired - Expired # noqa: E501 :return: The finish_as of this FuturesPriceTriggeredOrder. # noqa: E501 :rtype: str @@ -313,7 +311,7 @@ def finish_as(self): def finish_as(self, finish_as): """Sets the finish_as of this FuturesPriceTriggeredOrder. - How order is finished # noqa: E501 + Finish status: cancelled - Cancelled; succeeded - Succeeded; failed - Failed; expired - Expired # noqa: E501 :param finish_as: The finish_as of this FuturesPriceTriggeredOrder. # noqa: E501 :type: str @@ -321,9 +319,8 @@ def finish_as(self, finish_as): allowed_values = ["cancelled", "succeeded", "failed", "expired"] # 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}".format( # noqa: E501 - finish_as, allowed_values - ) + "Invalid value for `finish_as` ({0}), must be one of {1}" # noqa: E501 + .format(finish_as, allowed_values) ) self._finish_as = finish_as @@ -332,7 +329,7 @@ def finish_as(self, finish_as): def reason(self): """Gets the reason of this FuturesPriceTriggeredOrder. # noqa: E501 - Additional remarks on how the order was finished # noqa: E501 + Additional description of how the order was completed # noqa: E501 :return: The reason of this FuturesPriceTriggeredOrder. # noqa: E501 :rtype: str @@ -343,7 +340,7 @@ def reason(self): def reason(self, reason): """Sets the reason of this FuturesPriceTriggeredOrder. - Additional remarks on how the order was finished # noqa: E501 + Additional description of how the order was completed # noqa: E501 :param reason: The reason of this FuturesPriceTriggeredOrder. # noqa: E501 :type: str @@ -351,6 +348,52 @@ def reason(self, reason): self._reason = reason + @property + def order_type(self): + """Gets the order_type of this FuturesPriceTriggeredOrder. # noqa: E501 + + 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 # noqa: E501 + + :return: The order_type of this FuturesPriceTriggeredOrder. # noqa: E501 + :rtype: str + """ + return self._order_type + + @order_type.setter + def order_type(self, order_type): + """Sets the order_type of this FuturesPriceTriggeredOrder. + + 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 # noqa: E501 + + :param order_type: The order_type of this FuturesPriceTriggeredOrder. # noqa: E501 + :type: str + """ + + self._order_type = order_type + + @property + def me_order_id(self): + """Gets the me_order_id of this FuturesPriceTriggeredOrder. # noqa: E501 + + Corresponding order ID for order take-profit/stop-loss orders # noqa: E501 + + :return: The me_order_id of this FuturesPriceTriggeredOrder. # noqa: E501 + :rtype: int + """ + return self._me_order_id + + @me_order_id.setter + def me_order_id(self, me_order_id): + """Sets the me_order_id of this FuturesPriceTriggeredOrder. + + Corresponding order ID for order take-profit/stop-loss orders # noqa: E501 + + :param me_order_id: The me_order_id of this FuturesPriceTriggeredOrder. # noqa: E501 + :type: int + """ + + self._me_order_id = me_order_id + def to_dict(self): """Returns the model properties as a dict""" result = {} @@ -358,16 +401,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/futures_risk_limit_tier.py b/gate_api/models/futures_risk_limit_tier.py new file mode 100644 index 0000000..fcbc314 --- /dev/null +++ b/gate_api/models/futures_risk_limit_tier.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 FuturesRiskLimitTier(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'tier': 'int', + 'risk_limit': 'str', + 'initial_rate': 'str', + 'maintenance_rate': 'str', + 'leverage_max': 'str', + 'deduction': 'str' + } + + attribute_map = { + 'tier': 'tier', + 'risk_limit': 'risk_limit', + 'initial_rate': 'initial_rate', + 'maintenance_rate': 'maintenance_rate', + 'leverage_max': 'leverage_max', + 'deduction': 'deduction' + } + + def __init__(self, tier=None, risk_limit=None, initial_rate=None, maintenance_rate=None, leverage_max=None, deduction=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, str, str, str, str, Configuration) -> None + """FuturesRiskLimitTier - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._tier = None + self._risk_limit = None + self._initial_rate = None + self._maintenance_rate = None + self._leverage_max = None + self._deduction = None + self.discriminator = None + + if tier is not None: + self.tier = tier + if risk_limit is not None: + self.risk_limit = risk_limit + if initial_rate is not None: + self.initial_rate = initial_rate + if maintenance_rate is not None: + self.maintenance_rate = maintenance_rate + if leverage_max is not None: + self.leverage_max = leverage_max + if deduction is not None: + self.deduction = deduction + + @property + def tier(self): + """Gets the tier of this FuturesRiskLimitTier. # noqa: E501 + + Tier # noqa: E501 + + :return: The tier of this FuturesRiskLimitTier. # noqa: E501 + :rtype: int + """ + return self._tier + + @tier.setter + def tier(self, tier): + """Sets the tier of this FuturesRiskLimitTier. + + Tier # noqa: E501 + + :param tier: The tier of this FuturesRiskLimitTier. # noqa: E501 + :type: int + """ + + self._tier = tier + + @property + def risk_limit(self): + """Gets the risk_limit of this FuturesRiskLimitTier. # noqa: E501 + + Position risk limit # noqa: E501 + + :return: The risk_limit of this FuturesRiskLimitTier. # noqa: E501 + :rtype: str + """ + return self._risk_limit + + @risk_limit.setter + def risk_limit(self, risk_limit): + """Sets the risk_limit of this FuturesRiskLimitTier. + + Position risk limit # noqa: E501 + + :param risk_limit: The risk_limit of this FuturesRiskLimitTier. # noqa: E501 + :type: str + """ + + self._risk_limit = risk_limit + + @property + def initial_rate(self): + """Gets the initial_rate of this FuturesRiskLimitTier. # noqa: E501 + + Initial margin rate # noqa: E501 + + :return: The initial_rate of this FuturesRiskLimitTier. # noqa: E501 + :rtype: str + """ + return self._initial_rate + + @initial_rate.setter + def initial_rate(self, initial_rate): + """Sets the initial_rate of this FuturesRiskLimitTier. + + Initial margin rate # noqa: E501 + + :param initial_rate: The initial_rate of this FuturesRiskLimitTier. # noqa: E501 + :type: str + """ + + self._initial_rate = initial_rate + + @property + def maintenance_rate(self): + """Gets the maintenance_rate of this FuturesRiskLimitTier. # noqa: E501 + + Maintenance margin rate # noqa: E501 + + :return: The maintenance_rate of this FuturesRiskLimitTier. # noqa: E501 + :rtype: str + """ + return self._maintenance_rate + + @maintenance_rate.setter + def maintenance_rate(self, maintenance_rate): + """Sets the maintenance_rate of this FuturesRiskLimitTier. + + Maintenance margin rate # noqa: E501 + + :param maintenance_rate: The maintenance_rate of this FuturesRiskLimitTier. # noqa: E501 + :type: str + """ + + self._maintenance_rate = maintenance_rate + + @property + def leverage_max(self): + """Gets the leverage_max of this FuturesRiskLimitTier. # noqa: E501 + + Maximum leverage # noqa: E501 + + :return: The leverage_max of this FuturesRiskLimitTier. # noqa: E501 + :rtype: str + """ + return self._leverage_max + + @leverage_max.setter + def leverage_max(self, leverage_max): + """Sets the leverage_max of this FuturesRiskLimitTier. + + Maximum leverage # noqa: E501 + + :param leverage_max: The leverage_max of this FuturesRiskLimitTier. # noqa: E501 + :type: str + """ + + self._leverage_max = leverage_max + + @property + def deduction(self): + """Gets the deduction of this FuturesRiskLimitTier. # noqa: E501 + + Maintenance margin quick calculation deduction amount # noqa: E501 + + :return: The deduction of this FuturesRiskLimitTier. # noqa: E501 + :rtype: str + """ + return self._deduction + + @deduction.setter + def deduction(self, deduction): + """Sets the deduction of this FuturesRiskLimitTier. + + Maintenance margin quick calculation deduction amount # noqa: E501 + + :param deduction: The deduction of this FuturesRiskLimitTier. # noqa: E501 + :type: str + """ + + self._deduction = deduction + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FuturesRiskLimitTier): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FuturesRiskLimitTier): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/futures_ticker.py b/gate_api/models/futures_ticker.py index 8694402..37acc8e 100644 --- a/gate_api/models/futures_ticker.py +++ b/gate_api/models/futures_ticker.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -50,6 +50,15 @@ class FuturesTicker(object): 'funding_rate_indicative': 'str', 'index_price': 'str', 'quanto_base_rate': 'str', + 'lowest_ask': 'str', + 'lowest_size': 'str', + 'highest_bid': 'str', + 'highest_size': 'str', + 'change_utc0': 'str', + 'change_utc8': 'str', + 'change_price': 'str', + 'change_utc0_price': 'str', + 'change_utc8_price': 'str' } attribute_map = { @@ -70,30 +79,19 @@ class FuturesTicker(object): 'funding_rate_indicative': 'funding_rate_indicative', 'index_price': 'index_price', 'quanto_base_rate': 'quanto_base_rate', + 'lowest_ask': 'lowest_ask', + 'lowest_size': 'lowest_size', + 'highest_bid': 'highest_bid', + 'highest_size': 'highest_size', + 'change_utc0': 'change_utc0', + 'change_utc8': 'change_utc8', + 'change_price': 'change_price', + 'change_utc0_price': 'change_utc0_price', + 'change_utc8_price': 'change_utc8_price' } - def __init__( - self, - contract=None, - last=None, - change_percentage=None, - total_size=None, - low_24h=None, - high_24h=None, - volume_24h=None, - volume_24h_btc=None, - volume_24h_usd=None, - volume_24h_base=None, - volume_24h_quote=None, - volume_24h_settle=None, - mark_price=None, - funding_rate=None, - funding_rate_indicative=None, - index_price=None, - quanto_base_rate=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, Configuration) -> None + def __init__(self, contract=None, last=None, change_percentage=None, total_size=None, low_24h=None, high_24h=None, volume_24h=None, volume_24h_btc=None, volume_24h_usd=None, volume_24h_base=None, volume_24h_quote=None, volume_24h_settle=None, mark_price=None, funding_rate=None, funding_rate_indicative=None, index_price=None, quanto_base_rate=None, lowest_ask=None, lowest_size=None, highest_bid=None, highest_size=None, change_utc0=None, change_utc8=None, change_price=None, change_utc0_price=None, change_utc8_price=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, Configuration) -> None """FuturesTicker - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -116,6 +114,15 @@ def __init__( self._funding_rate_indicative = None self._index_price = None self._quanto_base_rate = None + self._lowest_ask = None + self._lowest_size = None + self._highest_bid = None + self._highest_size = None + self._change_utc0 = None + self._change_utc8 = None + self._change_price = None + self._change_utc0_price = None + self._change_utc8_price = None self.discriminator = None if contract is not None: @@ -152,6 +159,24 @@ def __init__( self.index_price = index_price if quanto_base_rate is not None: self.quanto_base_rate = quanto_base_rate + if lowest_ask is not None: + self.lowest_ask = lowest_ask + if lowest_size is not None: + self.lowest_size = lowest_size + if highest_bid is not None: + self.highest_bid = highest_bid + if highest_size is not None: + self.highest_size = highest_size + if change_utc0 is not None: + self.change_utc0 = change_utc0 + if change_utc8 is not None: + self.change_utc8 = change_utc8 + if change_price is not None: + self.change_price = change_price + if change_utc0_price is not None: + self.change_utc0_price = change_utc0_price + if change_utc8_price is not None: + self.change_utc8_price = change_utc8_price @property def contract(self): @@ -203,7 +228,7 @@ def last(self, last): def change_percentage(self): """Gets the change_percentage of this FuturesTicker. # noqa: E501 - Change percentage. # noqa: E501 + Price change percentage. Negative values indicate price decrease, e.g. -7.45 # noqa: E501 :return: The change_percentage of this FuturesTicker. # noqa: E501 :rtype: str @@ -214,7 +239,7 @@ def change_percentage(self): def change_percentage(self, change_percentage): """Sets the change_percentage of this FuturesTicker. - Change percentage. # noqa: E501 + Price change percentage. Negative values indicate price decrease, e.g. -7.45 # noqa: E501 :param change_percentage: The change_percentage of this FuturesTicker. # noqa: E501 :type: str @@ -249,7 +274,7 @@ def total_size(self, total_size): def low_24h(self): """Gets the low_24h of this FuturesTicker. # noqa: E501 - Lowest trading price in recent 24h # noqa: E501 + 24-hour lowest price # noqa: E501 :return: The low_24h of this FuturesTicker. # noqa: E501 :rtype: str @@ -260,7 +285,7 @@ def low_24h(self): def low_24h(self, low_24h): """Sets the low_24h of this FuturesTicker. - Lowest trading price in recent 24h # noqa: E501 + 24-hour lowest price # noqa: E501 :param low_24h: The low_24h of this FuturesTicker. # noqa: E501 :type: str @@ -272,7 +297,7 @@ def low_24h(self, low_24h): def high_24h(self): """Gets the high_24h of this FuturesTicker. # noqa: E501 - Highest trading price in recent 24h # noqa: E501 + 24-hour highest price # noqa: E501 :return: The high_24h of this FuturesTicker. # noqa: E501 :rtype: str @@ -283,7 +308,7 @@ def high_24h(self): def high_24h(self, high_24h): """Sets the high_24h of this FuturesTicker. - Highest trading price in recent 24h # noqa: E501 + 24-hour highest price # noqa: E501 :param high_24h: The high_24h of this FuturesTicker. # noqa: E501 :type: str @@ -295,7 +320,7 @@ def high_24h(self, high_24h): def volume_24h(self): """Gets the volume_24h of this FuturesTicker. # noqa: E501 - Trade size in recent 24h # noqa: E501 + 24-hour trading volume # noqa: E501 :return: The volume_24h of this FuturesTicker. # noqa: E501 :rtype: str @@ -306,7 +331,7 @@ def volume_24h(self): def volume_24h(self, volume_24h): """Sets the volume_24h of this FuturesTicker. - Trade size in recent 24h # noqa: E501 + 24-hour trading volume # noqa: E501 :param volume_24h: The volume_24h of this FuturesTicker. # noqa: E501 :type: str @@ -318,7 +343,7 @@ def volume_24h(self, volume_24h): def volume_24h_btc(self): """Gets the volume_24h_btc of this FuturesTicker. # noqa: E501 - Trade volumes in recent 24h in BTC(deprecated, use `volume_24h_base`, `volume_24h_quote`, `volume_24h_settle` instead) # noqa: E501 + 24-hour trading volume in BTC (deprecated, use `volume_24h_base`, `volume_24h_quote`, `volume_24h_settle` instead) # noqa: E501 :return: The volume_24h_btc of this FuturesTicker. # noqa: E501 :rtype: str @@ -329,7 +354,7 @@ def volume_24h_btc(self): def volume_24h_btc(self, volume_24h_btc): """Sets the volume_24h_btc of this FuturesTicker. - Trade volumes in recent 24h in BTC(deprecated, use `volume_24h_base`, `volume_24h_quote`, `volume_24h_settle` instead) # noqa: E501 + 24-hour trading volume in BTC (deprecated, use `volume_24h_base`, `volume_24h_quote`, `volume_24h_settle` instead) # noqa: E501 :param volume_24h_btc: The volume_24h_btc of this FuturesTicker. # noqa: E501 :type: str @@ -341,7 +366,7 @@ def volume_24h_btc(self, volume_24h_btc): def volume_24h_usd(self): """Gets the volume_24h_usd of this FuturesTicker. # noqa: E501 - Trade volumes in recent 24h in USD(deprecated, use `volume_24h_base`, `volume_24h_quote`, `volume_24h_settle` instead) # noqa: E501 + 24-hour trading volume in USD (deprecated, use `volume_24h_base`, `volume_24h_quote`, `volume_24h_settle` instead) # noqa: E501 :return: The volume_24h_usd of this FuturesTicker. # noqa: E501 :rtype: str @@ -352,7 +377,7 @@ def volume_24h_usd(self): def volume_24h_usd(self, volume_24h_usd): """Sets the volume_24h_usd of this FuturesTicker. - Trade volumes in recent 24h in USD(deprecated, use `volume_24h_base`, `volume_24h_quote`, `volume_24h_settle` instead) # noqa: E501 + 24-hour trading volume in USD (deprecated, use `volume_24h_base`, `volume_24h_quote`, `volume_24h_settle` instead) # noqa: E501 :param volume_24h_usd: The volume_24h_usd of this FuturesTicker. # noqa: E501 :type: str @@ -364,7 +389,7 @@ def volume_24h_usd(self, volume_24h_usd): def volume_24h_base(self): """Gets the volume_24h_base of this FuturesTicker. # noqa: E501 - Trade volume in recent 24h, in base currency # noqa: E501 + 24-hour trading volume in base currency # noqa: E501 :return: The volume_24h_base of this FuturesTicker. # noqa: E501 :rtype: str @@ -375,7 +400,7 @@ def volume_24h_base(self): def volume_24h_base(self, volume_24h_base): """Sets the volume_24h_base of this FuturesTicker. - Trade volume in recent 24h, in base currency # noqa: E501 + 24-hour trading volume in base currency # noqa: E501 :param volume_24h_base: The volume_24h_base of this FuturesTicker. # noqa: E501 :type: str @@ -387,7 +412,7 @@ def volume_24h_base(self, volume_24h_base): def volume_24h_quote(self): """Gets the volume_24h_quote of this FuturesTicker. # noqa: E501 - Trade volume in recent 24h, in quote currency # noqa: E501 + 24-hour trading volume in quote currency # noqa: E501 :return: The volume_24h_quote of this FuturesTicker. # noqa: E501 :rtype: str @@ -398,7 +423,7 @@ def volume_24h_quote(self): def volume_24h_quote(self, volume_24h_quote): """Sets the volume_24h_quote of this FuturesTicker. - Trade volume in recent 24h, in quote currency # noqa: E501 + 24-hour trading volume in quote currency # noqa: E501 :param volume_24h_quote: The volume_24h_quote of this FuturesTicker. # noqa: E501 :type: str @@ -410,7 +435,7 @@ def volume_24h_quote(self, volume_24h_quote): def volume_24h_settle(self): """Gets the volume_24h_settle of this FuturesTicker. # noqa: E501 - Trade volume in recent 24h, in settle currency # noqa: E501 + 24-hour trading volume in settle currency # noqa: E501 :return: The volume_24h_settle of this FuturesTicker. # noqa: E501 :rtype: str @@ -421,7 +446,7 @@ def volume_24h_settle(self): def volume_24h_settle(self, volume_24h_settle): """Sets the volume_24h_settle of this FuturesTicker. - Trade volume in recent 24h, in settle currency # noqa: E501 + 24-hour trading volume in settle currency # noqa: E501 :param volume_24h_settle: The volume_24h_settle of this FuturesTicker. # noqa: E501 :type: str @@ -479,7 +504,7 @@ def funding_rate(self, funding_rate): def funding_rate_indicative(self): """Gets the funding_rate_indicative of this FuturesTicker. # noqa: E501 - Indicative Funding rate in next period # noqa: E501 + Indicative Funding rate in next period. (deprecated. use `funding_rate`) # noqa: E501 :return: The funding_rate_indicative of this FuturesTicker. # noqa: E501 :rtype: str @@ -490,7 +515,7 @@ def funding_rate_indicative(self): def funding_rate_indicative(self, funding_rate_indicative): """Sets the funding_rate_indicative of this FuturesTicker. - Indicative Funding rate in next period # noqa: E501 + Indicative Funding rate in next period. (deprecated. use `funding_rate`) # noqa: E501 :param funding_rate_indicative: The funding_rate_indicative of this FuturesTicker. # noqa: E501 :type: str @@ -544,6 +569,213 @@ def quanto_base_rate(self, quanto_base_rate): self._quanto_base_rate = quanto_base_rate + @property + def lowest_ask(self): + """Gets the lowest_ask of this FuturesTicker. # noqa: E501 + + Recent lowest ask # noqa: E501 + + :return: The lowest_ask of this FuturesTicker. # noqa: E501 + :rtype: str + """ + return self._lowest_ask + + @lowest_ask.setter + def lowest_ask(self, lowest_ask): + """Sets the lowest_ask of this FuturesTicker. + + Recent lowest ask # noqa: E501 + + :param lowest_ask: The lowest_ask of this FuturesTicker. # noqa: E501 + :type: str + """ + + self._lowest_ask = lowest_ask + + @property + def lowest_size(self): + """Gets the lowest_size of this FuturesTicker. # noqa: E501 + + The latest seller's lowest price order quantity # noqa: E501 + + :return: The lowest_size of this FuturesTicker. # noqa: E501 + :rtype: str + """ + return self._lowest_size + + @lowest_size.setter + def lowest_size(self, lowest_size): + """Sets the lowest_size of this FuturesTicker. + + The latest seller's lowest price order quantity # noqa: E501 + + :param lowest_size: The lowest_size of this FuturesTicker. # noqa: E501 + :type: str + """ + + self._lowest_size = lowest_size + + @property + def highest_bid(self): + """Gets the highest_bid of this FuturesTicker. # noqa: E501 + + Recent highest bid # noqa: E501 + + :return: The highest_bid of this FuturesTicker. # noqa: E501 + :rtype: str + """ + return self._highest_bid + + @highest_bid.setter + def highest_bid(self, highest_bid): + """Sets the highest_bid of this FuturesTicker. + + Recent highest bid # noqa: E501 + + :param highest_bid: The highest_bid of this FuturesTicker. # noqa: E501 + :type: str + """ + + self._highest_bid = highest_bid + + @property + def highest_size(self): + """Gets the highest_size of this FuturesTicker. # noqa: E501 + + The latest buyer's highest price order volume # noqa: E501 + + :return: The highest_size of this FuturesTicker. # noqa: E501 + :rtype: str + """ + return self._highest_size + + @highest_size.setter + def highest_size(self, highest_size): + """Sets the highest_size of this FuturesTicker. + + The latest buyer's highest price order volume # noqa: E501 + + :param highest_size: The highest_size of this FuturesTicker. # noqa: E501 + :type: str + """ + + self._highest_size = highest_size + + @property + def change_utc0(self): + """Gets the change_utc0 of this FuturesTicker. # noqa: E501 + + Percentage change at utc0. Negative values indicate a drop, e.g., -7.45% # noqa: E501 + + :return: The change_utc0 of this FuturesTicker. # noqa: E501 + :rtype: str + """ + return self._change_utc0 + + @change_utc0.setter + def change_utc0(self, change_utc0): + """Sets the change_utc0 of this FuturesTicker. + + Percentage change at utc0. Negative values indicate a drop, e.g., -7.45% # noqa: E501 + + :param change_utc0: The change_utc0 of this FuturesTicker. # noqa: E501 + :type: str + """ + + self._change_utc0 = change_utc0 + + @property + def change_utc8(self): + """Gets the change_utc8 of this FuturesTicker. # noqa: E501 + + Percentage change at utc8. Negative values indicate a drop, e.g., -7.45% # noqa: E501 + + :return: The change_utc8 of this FuturesTicker. # noqa: E501 + :rtype: str + """ + return self._change_utc8 + + @change_utc8.setter + def change_utc8(self, change_utc8): + """Sets the change_utc8 of this FuturesTicker. + + Percentage change at utc8. Negative values indicate a drop, e.g., -7.45% # noqa: E501 + + :param change_utc8: The change_utc8 of this FuturesTicker. # noqa: E501 + :type: str + """ + + self._change_utc8 = change_utc8 + + @property + def change_price(self): + """Gets the change_price of this FuturesTicker. # noqa: E501 + + 24h change amount. Negative values indicate a drop, e.g., -7.45 # noqa: E501 + + :return: The change_price of this FuturesTicker. # noqa: E501 + :rtype: str + """ + return self._change_price + + @change_price.setter + def change_price(self, change_price): + """Sets the change_price of this FuturesTicker. + + 24h change amount. Negative values indicate a drop, e.g., -7.45 # noqa: E501 + + :param change_price: The change_price of this FuturesTicker. # noqa: E501 + :type: str + """ + + self._change_price = change_price + + @property + def change_utc0_price(self): + """Gets the change_utc0_price of this FuturesTicker. # noqa: E501 + + Change amount at utc0. Negative values indicate a drop, e.g., -7.45 # noqa: E501 + + :return: The change_utc0_price of this FuturesTicker. # noqa: E501 + :rtype: str + """ + return self._change_utc0_price + + @change_utc0_price.setter + def change_utc0_price(self, change_utc0_price): + """Sets the change_utc0_price of this FuturesTicker. + + Change amount at utc0. Negative values indicate a drop, e.g., -7.45 # noqa: E501 + + :param change_utc0_price: The change_utc0_price of this FuturesTicker. # noqa: E501 + :type: str + """ + + self._change_utc0_price = change_utc0_price + + @property + def change_utc8_price(self): + """Gets the change_utc8_price of this FuturesTicker. # noqa: E501 + + Change amount at utc8. Negative values indicate a drop, e.g., -7.45 # noqa: E501 + + :return: The change_utc8_price of this FuturesTicker. # noqa: E501 + :rtype: str + """ + return self._change_utc8_price + + @change_utc8_price.setter + def change_utc8_price(self, change_utc8_price): + """Sets the change_utc8_price of this FuturesTicker. + + Change amount at utc8. Negative values indicate a drop, e.g., -7.45 # noqa: E501 + + :param change_utc8_price: The change_utc8_price of this FuturesTicker. # noqa: E501 + :type: str + """ + + self._change_utc8_price = change_utc8_price + def to_dict(self): """Returns the model properties as a dict""" result = {} @@ -551,16 +783,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/futures_trade.py b/gate_api/models/futures_trade.py index fcc43c9..66b45c0 100644 --- a/gate_api/models/futures_trade.py +++ b/gate_api/models/futures_trade.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -39,6 +39,7 @@ class FuturesTrade(object): 'contract': 'str', 'size': 'int', 'price': 'str', + 'is_internal': 'bool' } attribute_map = { @@ -48,19 +49,11 @@ class FuturesTrade(object): 'contract': 'contract', 'size': 'size', 'price': 'price', + 'is_internal': 'is_internal' } - def __init__( - self, - id=None, - create_time=None, - create_time_ms=None, - contract=None, - size=None, - price=None, - local_vars_configuration=None, - ): # noqa: E501 - # type: (int, float, float, str, int, str, Configuration) -> None + def __init__(self, id=None, create_time=None, create_time_ms=None, contract=None, size=None, price=None, is_internal=None, local_vars_configuration=None): # noqa: E501 + # type: (int, float, float, str, int, str, bool, Configuration) -> None """FuturesTrade - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -72,6 +65,7 @@ def __init__( self._contract = None self._size = None self._price = None + self._is_internal = None self.discriminator = None if id is not None: @@ -86,12 +80,14 @@ def __init__( self.size = size if price is not None: self.price = price + if is_internal is not None: + self.is_internal = is_internal @property def id(self): """Gets the id of this FuturesTrade. # noqa: E501 - Trade ID # noqa: E501 + Fill ID # noqa: E501 :return: The id of this FuturesTrade. # noqa: E501 :rtype: int @@ -102,7 +98,7 @@ def id(self): def id(self, id): """Sets the id of this FuturesTrade. - Trade ID # noqa: E501 + Fill ID # noqa: E501 :param id: The id of this FuturesTrade. # noqa: E501 :type: int @@ -114,7 +110,7 @@ def id(self, id): def create_time(self): """Gets the create_time of this FuturesTrade. # noqa: E501 - Trading time # noqa: E501 + Fill Time # noqa: E501 :return: The create_time of this FuturesTrade. # noqa: E501 :rtype: float @@ -125,7 +121,7 @@ def create_time(self): def create_time(self, create_time): """Sets the create_time of this FuturesTrade. - Trading time # noqa: E501 + Fill Time # noqa: E501 :param create_time: The create_time of this FuturesTrade. # noqa: E501 :type: float @@ -137,7 +133,7 @@ def create_time(self, create_time): def create_time_ms(self): """Gets the create_time_ms of this FuturesTrade. # noqa: E501 - Trading time, with milliseconds set to 3 decimal places. # noqa: E501 + Trade time, with millisecond precision to 3 decimal places # noqa: E501 :return: The create_time_ms of this FuturesTrade. # noqa: E501 :rtype: float @@ -148,7 +144,7 @@ def create_time_ms(self): def create_time_ms(self, create_time_ms): """Sets the create_time_ms of this FuturesTrade. - Trading time, with milliseconds set to 3 decimal places. # noqa: E501 + Trade time, with millisecond precision to 3 decimal places # noqa: E501 :param create_time_ms: The create_time_ms of this FuturesTrade. # noqa: E501 :type: float @@ -206,7 +202,7 @@ def size(self, size): def price(self): """Gets the price of this FuturesTrade. # noqa: E501 - Trading price # noqa: E501 + Trade price (quote currency) # noqa: E501 :return: The price of this FuturesTrade. # noqa: E501 :rtype: str @@ -217,7 +213,7 @@ def price(self): def price(self, price): """Sets the price of this FuturesTrade. - Trading price # noqa: E501 + Trade price (quote currency) # noqa: E501 :param price: The price of this FuturesTrade. # noqa: E501 :type: str @@ -225,6 +221,29 @@ def price(self, price): self._price = price + @property + def is_internal(self): + """Gets the is_internal of this FuturesTrade. # noqa: E501 + + Whether it is an internal trade. Internal trade refers to the takeover of liquidation orders by the insurance fund and ADL users. Since it is not a normal matching on the market depth, the trade price may deviate from the market, and it will not be recorded in the K-line. If it is not an internal trade, this field will not be returned # noqa: E501 + + :return: The is_internal of this FuturesTrade. # noqa: E501 + :rtype: bool + """ + return self._is_internal + + @is_internal.setter + def is_internal(self, is_internal): + """Sets the is_internal of this FuturesTrade. + + Whether it is an internal trade. Internal trade refers to the takeover of liquidation orders by the insurance fund and ADL users. Since it is not a normal matching on the market depth, the trade price may deviate from the market, and it will not be recorded in the K-line. If it is not an internal trade, this field will not be returned # noqa: E501 + + :param is_internal: The is_internal of this FuturesTrade. # noqa: E501 + :type: bool + """ + + self._is_internal = is_internal + def to_dict(self): """Returns the model properties as a dict""" result = {} @@ -232,16 +251,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/index_constituent.py b/gate_api/models/index_constituent.py new file mode 100644 index 0000000..7357ff1 --- /dev/null +++ b/gate_api/models/index_constituent.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 IndexConstituent(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'symbols': 'list[str]' + } + + attribute_map = { + 'exchange': 'exchange', + 'symbols': 'symbols' + } + + def __init__(self, exchange=None, symbols=None, local_vars_configuration=None): # noqa: E501 + # type: (str, list[str], Configuration) -> None + """IndexConstituent - a 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._symbols = None + self.discriminator = None + + if exchange is not None: + self.exchange = exchange + if symbols is not None: + self.symbols = symbols + + @property + def exchange(self): + """Gets the exchange of this IndexConstituent. # noqa: E501 + + Exchange # noqa: E501 + + :return: The exchange of this IndexConstituent. # noqa: E501 + :rtype: str + """ + return self._exchange + + @exchange.setter + def exchange(self, exchange): + """Sets the exchange of this IndexConstituent. + + Exchange # noqa: E501 + + :param exchange: The exchange of this IndexConstituent. # noqa: E501 + :type: str + """ + + self._exchange = exchange + + @property + def symbols(self): + """Gets the symbols of this IndexConstituent. # noqa: E501 + + Symbol list # noqa: E501 + + :return: The symbols of this IndexConstituent. # noqa: E501 + :rtype: list[str] + """ + return self._symbols + + @symbols.setter + def symbols(self, symbols): + """Sets the symbols of this IndexConstituent. + + Symbol list # noqa: E501 + + :param symbols: The symbols of this IndexConstituent. # noqa: E501 + :type: list[str] + """ + + self._symbols = symbols + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, IndexConstituent): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, IndexConstituent): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/inline_object.py b/gate_api/models/inline_object.py new file mode 100644 index 0000000..a034500 --- /dev/null +++ b/gate_api/models/inline_object.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 InlineObject(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'mode': 'str', + 'contract': 'str' + } + + attribute_map = { + 'mode': 'mode', + 'contract': 'contract' + } + + 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 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._mode = None + self._contract = None + self.discriminator = None + + self.mode = mode + self.contract = contract + + @property + def mode(self): + """Gets the mode of this InlineObject. # noqa: E501 + + Cross margin or isolated margin mode. ISOLATED - isolated margin mode, CROSS - cross margin mode # noqa: E501 + + :return: The mode of this InlineObject. # noqa: E501 + :rtype: str + """ + return self._mode + + @mode.setter + def mode(self, mode): + """Sets the mode of this InlineObject. + + Cross margin or isolated margin mode. ISOLATED - isolated margin mode, CROSS - cross margin mode # noqa: E501 + + :param mode: The mode of this InlineObject. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and mode is None: # noqa: E501 + raise ValueError("Invalid value for `mode`, must not be `None`") # noqa: E501 + + self._mode = mode + + @property + def contract(self): + """Gets the contract of this InlineObject. # noqa: E501 + + Futures market # noqa: E501 + + :return: The contract of this InlineObject. # noqa: E501 + :rtype: str + """ + return self._contract + + @contract.setter + def contract(self, contract): + """Sets the contract of this InlineObject. + + Futures market # noqa: E501 + + :param contract: The contract of this InlineObject. # 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 + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, InlineObject): + return 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): + 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 new file mode 100644 index 0000000..171fd14 --- /dev/null +++ b/gate_api/models/inline_response200.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 InlineResponse200(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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 + """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.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 InlineResponse200. # noqa: E501 + + + :return: The time of this InlineResponse200. # noqa: E501 + :rtype: int + """ + return self._time + + @time.setter + def time(self, time): + """Sets the time of this InlineResponse200. + + + :param time: The time of this InlineResponse200. # noqa: E501 + :type: int + """ + + self._time = time + + @property + def value(self): + """Gets the value of this InlineResponse200. # noqa: E501 + + + :return: The value of this InlineResponse200. # noqa: E501 + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this InlineResponse200. + + + :param value: The value of this InlineResponse200. # 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, InlineResponse200): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, InlineResponse200): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/inline_response2001.py b/gate_api/models/inline_response2001.py new file mode 100644 index 0000000..e637913 --- /dev/null +++ b/gate_api/models/inline_response2001.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 InlineResponse2001(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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 + """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.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 InlineResponse2001. # noqa: E501 + + + :return: The currency of this InlineResponse2001. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this InlineResponse2001. + + + :param currency: The currency of this InlineResponse2001. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def est_rate(self): + """Gets the est_rate of this InlineResponse2001. # noqa: E501 + + Unconverted percentage # noqa: E501 + + :return: The est_rate of this InlineResponse2001. # noqa: E501 + :rtype: str + """ + return self._est_rate + + @est_rate.setter + def est_rate(self, est_rate): + """Sets the est_rate of this InlineResponse2001. + + Unconverted percentage # noqa: E501 + + :param est_rate: The est_rate of this InlineResponse2001. # 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, InlineResponse2001): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, InlineResponse2001): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/insurance_record.py b/gate_api/models/insurance_record.py index 26d017c..9ee7e93 100644 --- a/gate_api/models/insurance_record.py +++ b/gate_api/models/insurance_record.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -32,9 +32,15 @@ class InsuranceRecord(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {'t': 'int', 'b': 'str'} + openapi_types = { + 't': 'int', + 'b': 'str' + } - attribute_map = {'t': 't', 'b': 'b'} + attribute_map = { + 't': 't', + 'b': 'b' + } def __init__(self, t=None, b=None, local_vars_configuration=None): # noqa: E501 # type: (int, str, Configuration) -> None @@ -105,16 +111,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/ledger_record.py b/gate_api/models/ledger_record.py index 2648357..c1cd314 100644 --- a/gate_api/models/ledger_record.py +++ b/gate_api/models/ledger_record.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -35,41 +35,35 @@ class LedgerRecord(object): openapi_types = { 'id': 'str', 'txid': 'str', + 'withdraw_order_id': 'str', 'timestamp': 'str', 'amount': 'str', 'currency': 'str', 'address': 'str', 'memo': 'str', + 'withdraw_id': 'str', + 'asset_class': 'str', 'status': 'str', - 'chain': 'str', + 'chain': 'str' } attribute_map = { 'id': 'id', 'txid': 'txid', + 'withdraw_order_id': 'withdraw_order_id', 'timestamp': 'timestamp', 'amount': 'amount', 'currency': 'currency', 'address': 'address', 'memo': 'memo', + 'withdraw_id': 'withdraw_id', + 'asset_class': 'asset_class', 'status': 'status', - 'chain': 'chain', + '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, withdraw_order_id=None, timestamp=None, amount=None, currency=None, address=None, memo=None, withdraw_id=None, asset_class=None, status=None, chain=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, str, str, str, str, str, Configuration) -> None """LedgerRecord - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -77,11 +71,14 @@ def __init__( self._id = None self._txid = None + self._withdraw_order_id = None self._timestamp = None self._amount = None self._currency = None self._address = None self._memo = None + self._withdraw_id = None + self._asset_class = None self._status = None self._chain = None self.discriminator = None @@ -90,6 +87,8 @@ def __init__( self.id = id if txid is not None: self.txid = txid + if withdraw_order_id is not None: + self.withdraw_order_id = withdraw_order_id if timestamp is not None: self.timestamp = timestamp self.amount = amount @@ -98,10 +97,13 @@ def __init__( self.address = address if memo is not None: self.memo = memo + if withdraw_id is not None: + self.withdraw_id = withdraw_id + if asset_class is not None: + self.asset_class = asset_class if status is not None: self.status = status - if chain is not None: - self.chain = chain + self.chain = chain @property def id(self): @@ -149,6 +151,29 @@ def txid(self, txid): self._txid = txid + @property + def withdraw_order_id(self): + """Gets the withdraw_order_id of this LedgerRecord. # noqa: E501 + + User-defined order number for withdrawal. Default is empty. When not empty, the specified user-defined order number record will be queried # noqa: E501 + + :return: The withdraw_order_id of this LedgerRecord. # noqa: E501 + :rtype: str + """ + return self._withdraw_order_id + + @withdraw_order_id.setter + def withdraw_order_id(self, withdraw_order_id): + """Sets the withdraw_order_id of this LedgerRecord. + + User-defined order number for withdrawal. Default is empty. When not empty, the specified user-defined order number record will be queried # noqa: E501 + + :param withdraw_order_id: The withdraw_order_id of this LedgerRecord. # noqa: E501 + :type: str + """ + + self._withdraw_order_id = withdraw_order_id + @property def timestamp(self): """Gets the timestamp of this LedgerRecord. # noqa: E501 @@ -176,7 +201,7 @@ def timestamp(self, timestamp): def amount(self): """Gets the amount of this LedgerRecord. # noqa: E501 - Currency amount # noqa: E501 + Token amount # noqa: E501 :return: The amount of this LedgerRecord. # noqa: E501 :rtype: str @@ -187,7 +212,7 @@ def amount(self): def amount(self, amount): """Sets the amount of this LedgerRecord. - Currency amount # noqa: E501 + Token amount # noqa: E501 :param amount: The amount of this LedgerRecord. # noqa: E501 :type: str @@ -268,11 +293,57 @@ def memo(self, memo): self._memo = memo + @property + def withdraw_id(self): + """Gets the withdraw_id of this LedgerRecord. # noqa: E501 + + 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 # noqa: E501 + + :return: The withdraw_id of this LedgerRecord. # noqa: E501 + :rtype: str + """ + return self._withdraw_id + + @withdraw_id.setter + def withdraw_id(self, withdraw_id): + """Sets the withdraw_id of this LedgerRecord. + + 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 # noqa: E501 + + :param withdraw_id: The withdraw_id of this LedgerRecord. # noqa: E501 + :type: str + """ + + self._withdraw_id = withdraw_id + + @property + def asset_class(self): + """Gets the asset_class of this LedgerRecord. # noqa: E501 + + Withdrawal record currency type, empty by default. Supports users to query withdrawal records in main area and innovation area on demand. Valid values: SPOT, PILOT SPOT: Main area PILOT: Innovation area # noqa: E501 + + :return: The asset_class of this LedgerRecord. # noqa: E501 + :rtype: str + """ + return self._asset_class + + @asset_class.setter + def asset_class(self, asset_class): + """Sets the asset_class of this LedgerRecord. + + Withdrawal record currency type, empty by default. Supports users to query withdrawal records in main area and innovation area on demand. Valid values: SPOT, PILOT SPOT: Main area PILOT: Innovation area # noqa: E501 + + :param asset_class: The asset_class of this LedgerRecord. # noqa: E501 + :type: str + """ + + self._asset_class = asset_class + @property def status(self): """Gets the status of this LedgerRecord. # noqa: E501 - Record status. - DONE: done - CANCEL: cancelled - REQUEST: requesting - MANUAL: pending manual approval - BCODE: GateCode operation - EXTPEND: pending confirm after sending - FAIL: pending confirm when fail # noqa: E501 + Transaction status - DONE: Completed - CANCEL: Cancelled - REQUEST: Requesting - MANUAL: Pending manual review - BCODE: GateCode operation - EXTPEND: Sent, waiting for confirmation - FAIL: Failed on chain, waiting for confirmation - INVALID: Invalid order - VERIFY: Verifying - PROCES: Processing - PEND: Processing - DMOVE: Pending manual review - REVIEW: Under review # noqa: E501 :return: The status of this LedgerRecord. # noqa: E501 :rtype: str @@ -283,16 +354,11 @@ def status(self): def status(self, status): """Sets the status of this LedgerRecord. - Record status. - DONE: done - CANCEL: cancelled - REQUEST: requesting - MANUAL: pending manual approval - BCODE: GateCode operation - EXTPEND: pending confirm after sending - FAIL: pending confirm when fail # noqa: E501 + Transaction status - DONE: Completed - CANCEL: Cancelled - REQUEST: Requesting - MANUAL: Pending manual review - BCODE: GateCode operation - EXTPEND: Sent, waiting for confirmation - FAIL: Failed on chain, waiting for confirmation - INVALID: Invalid order - VERIFY: Verifying - PROCES: Processing - PEND: Processing - DMOVE: Pending manual review - REVIEW: Under review # noqa: E501 :param status: The status of this LedgerRecord. # noqa: E501 :type: str """ - allowed_values = ["DONE", "CANCEL", "REQUEST", "MANUAL", "BCODE", "EXTPEND", "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}".format(status, allowed_values) # noqa: E501 - ) self._status = status @@ -316,6 +382,8 @@ def chain(self, chain): :param chain: The chain of this LedgerRecord. # noqa: E501 :type: str """ + if self.local_vars_configuration.client_side_validation and chain is None: # noqa: E501 + raise ValueError("Invalid value for `chain`, must not be `None`") # noqa: E501 self._chain = chain @@ -326,16 +394,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/liquidate_order.py b/gate_api/models/liquidate_order.py new file mode 100644 index 0000000..97214b5 --- /dev/null +++ b/gate_api/models/liquidate_order.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 LiquidateOrder(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'currency_pair': 'str', + 'amount': 'str', + 'price': 'str', + 'action_mode': 'str' + } + + attribute_map = { + 'text': 'text', + 'currency_pair': 'currency_pair', + 'amount': 'amount', + 'price': 'price', + 'action_mode': 'action_mode' + } + + def __init__(self, text=None, currency_pair=None, amount=None, price=None, action_mode=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, Configuration) -> None + """LiquidateOrder - a 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._currency_pair = None + self._amount = None + self._price = None + self._action_mode = None + self.discriminator = None + + if text is not None: + self.text = text + self.currency_pair = currency_pair + self.amount = amount + self.price = price + if action_mode is not None: + self.action_mode = action_mode + + @property + def text(self): + """Gets the text of this LiquidateOrder. # 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 LiquidateOrder. # noqa: E501 + :rtype: str + """ + return self._text + + @text.setter + def text(self, text): + """Sets the text of this LiquidateOrder. + + 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 LiquidateOrder. # noqa: E501 + :type: str + """ + + self._text = text + + @property + def currency_pair(self): + """Gets the currency_pair of this LiquidateOrder. # noqa: E501 + + Currency pair # noqa: E501 + + :return: The currency_pair of this LiquidateOrder. # noqa: E501 + :rtype: str + """ + return self._currency_pair + + @currency_pair.setter + def currency_pair(self, currency_pair): + """Sets the currency_pair of this LiquidateOrder. + + Currency pair # noqa: E501 + + :param currency_pair: The currency_pair of this LiquidateOrder. # 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 amount(self): + """Gets the amount of this LiquidateOrder. # noqa: E501 + + Trade amount # noqa: E501 + + :return: The amount of this LiquidateOrder. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this LiquidateOrder. + + Trade amount # noqa: E501 + + :param amount: The amount of this LiquidateOrder. # 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(self): + """Gets the price of this LiquidateOrder. # noqa: E501 + + Order price # noqa: E501 + + :return: The price of this LiquidateOrder. # noqa: E501 + :rtype: str + """ + return self._price + + @price.setter + def price(self, price): + """Sets the price of this LiquidateOrder. + + Order price # noqa: E501 + + :param price: The price of this LiquidateOrder. # 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 action_mode(self): + """Gets the action_mode of this LiquidateOrder. # noqa: E501 + + Processing mode: Different fields are returned when placing an order based on action_mode. This field is only valid during the request and is not included in the response `ACK`: Asynchronous mode, only returns key order fields `RESULT`: No liquidation information `FULL`: Full mode (default) # noqa: E501 + + :return: The action_mode of this LiquidateOrder. # noqa: E501 + :rtype: str + """ + return self._action_mode + + @action_mode.setter + def action_mode(self, action_mode): + """Sets the action_mode of this LiquidateOrder. + + Processing mode: Different fields are returned when placing an order based on action_mode. This field is only valid during the request and is not included in the response `ACK`: Asynchronous mode, only returns key order fields `RESULT`: No liquidation information `FULL`: Full mode (default) # noqa: E501 + + :param action_mode: The action_mode of this LiquidateOrder. # noqa: E501 + :type: str + """ + + self._action_mode = action_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, LiquidateOrder): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, LiquidateOrder): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/loan.py b/gate_api/models/loan.py deleted file mode 100644 index e1ef772..0000000 --- a/gate_api/models/loan.py +++ /dev/null @@ -1,631 +0,0 @@ -# coding: utf-8 - -""" - Gate API v4 - - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 - - Contact: support@mail.gate.io - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from gate_api.configuration import Configuration - - -class Loan(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - 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', - 'create_time': 'str', - 'expire_time': 'str', - 'status': 'str', - 'side': 'str', - 'currency': 'str', - 'rate': 'str', - 'amount': 'str', - 'days': 'int', - 'auto_renew': 'bool', - 'currency_pair': 'str', - 'left': 'str', - 'repaid': 'str', - 'paid_interest': 'str', - 'unpaid_interest': 'str', - 'fee_rate': 'str', - 'orig_id': 'str', - 'text': 'str', - } - - attribute_map = { - 'id': 'id', - 'create_time': 'create_time', - 'expire_time': 'expire_time', - 'status': 'status', - 'side': 'side', - 'currency': 'currency', - 'rate': 'rate', - 'amount': 'amount', - 'days': 'days', - 'auto_renew': 'auto_renew', - 'currency_pair': 'currency_pair', - 'left': 'left', - 'repaid': 'repaid', - 'paid_interest': 'paid_interest', - 'unpaid_interest': 'unpaid_interest', - 'fee_rate': 'fee_rate', - 'orig_id': 'orig_id', - 'text': 'text', - } - - def __init__( - self, - id=None, - create_time=None, - expire_time=None, - status=None, - side=None, - currency=None, - rate=None, - amount=None, - days=None, - auto_renew=False, - currency_pair=None, - left=None, - repaid=None, - paid_interest=None, - unpaid_interest=None, - fee_rate=None, - orig_id=None, - text=None, - local_vars_configuration=None, - ): # noqa: E501 - # type: (str, str, str, str, str, str, str, str, int, bool, str, str, str, str, str, str, str, str, Configuration) -> None - """Loan - a 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._create_time = None - self._expire_time = None - self._status = None - self._side = None - self._currency = None - self._rate = None - self._amount = None - self._days = None - self._auto_renew = None - self._currency_pair = None - self._left = None - self._repaid = None - self._paid_interest = None - self._unpaid_interest = None - self._fee_rate = None - self._orig_id = None - self._text = None - self.discriminator = None - - if id is not None: - self.id = id - if create_time is not None: - self.create_time = create_time - if expire_time is not None: - self.expire_time = expire_time - if status is not None: - self.status = status - self.side = side - self.currency = currency - if rate is not None: - self.rate = rate - self.amount = amount - if days is not None: - self.days = days - if auto_renew is not None: - self.auto_renew = auto_renew - if currency_pair is not None: - self.currency_pair = currency_pair - if left is not None: - self.left = left - if repaid is not None: - self.repaid = repaid - if paid_interest is not None: - self.paid_interest = paid_interest - if unpaid_interest is not None: - self.unpaid_interest = unpaid_interest - if fee_rate is not None: - self.fee_rate = fee_rate - if orig_id is not None: - self.orig_id = orig_id - if text is not None: - self.text = text - - @property - def id(self): - """Gets the id of this Loan. # noqa: E501 - - Loan ID # noqa: E501 - - :return: The id of this Loan. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this Loan. - - Loan ID # noqa: E501 - - :param id: The id of this Loan. # noqa: E501 - :type: str - """ - - self._id = id - - @property - def create_time(self): - """Gets the create_time of this Loan. # noqa: E501 - - Creation time # noqa: E501 - - :return: The create_time of this Loan. # noqa: E501 - :rtype: str - """ - return self._create_time - - @create_time.setter - def create_time(self, create_time): - """Sets the create_time of this Loan. - - Creation time # noqa: E501 - - :param create_time: The create_time of this Loan. # noqa: E501 - :type: str - """ - - self._create_time = create_time - - @property - def expire_time(self): - """Gets the expire_time of this Loan. # noqa: E501 - - Repay time of the loan. No value will be returned for lending loan # noqa: E501 - - :return: The expire_time of this Loan. # noqa: E501 - :rtype: str - """ - return self._expire_time - - @expire_time.setter - def expire_time(self, expire_time): - """Sets the expire_time of this Loan. - - Repay time of the loan. No value will be returned for lending loan # noqa: E501 - - :param expire_time: The expire_time of this Loan. # noqa: E501 - :type: str - """ - - self._expire_time = expire_time - - @property - def status(self): - """Gets the status of this Loan. # noqa: E501 - - Loan status open - not fully loaned loaned - all loaned out for lending loan; loaned in for borrowing side finished - loan is finished, either being all repaid or cancelled by the lender auto_repaid - automatically repaid by the system # noqa: E501 - - :return: The status of this Loan. # noqa: E501 - :rtype: str - """ - return self._status - - @status.setter - def status(self, status): - """Sets the status of this Loan. - - Loan status open - not fully loaned loaned - all loaned out for lending loan; loaned in for borrowing side finished - loan is finished, either being all repaid or cancelled by the lender auto_repaid - automatically repaid by the system # noqa: E501 - - :param status: The status of this Loan. # noqa: E501 - :type: str - """ - allowed_values = ["open", "loaned", "finished", "auto_repaid"] # 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}".format(status, allowed_values) # noqa: E501 - ) - - self._status = status - - @property - def side(self): - """Gets the side of this Loan. # noqa: E501 - - Loan side # noqa: E501 - - :return: The side of this Loan. # noqa: E501 - :rtype: str - """ - return self._side - - @side.setter - def side(self, side): - """Sets the side of this Loan. - - Loan side # noqa: E501 - - :param side: The side of this Loan. # 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 = ["lend", "borrow"] # 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}".format(side, allowed_values) # noqa: E501 - ) - - self._side = side - - @property - def currency(self): - """Gets the currency of this Loan. # noqa: E501 - - Loan currency # noqa: E501 - - :return: The currency of this Loan. # noqa: E501 - :rtype: str - """ - return self._currency - - @currency.setter - def currency(self, currency): - """Sets the currency of this Loan. - - Loan currency # noqa: E501 - - :param currency: The currency of this Loan. # 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 rate(self): - """Gets the rate of this Loan. # noqa: E501 - - Loan rate. Only rates in [0.0002, 0.002] are supported. Not required in lending. Market rate calculated from recent rates will be used if not set # noqa: E501 - - :return: The rate of this Loan. # noqa: E501 - :rtype: str - """ - return self._rate - - @rate.setter - def rate(self, rate): - """Sets the rate of this Loan. - - Loan rate. Only rates in [0.0002, 0.002] are supported. Not required in lending. Market rate calculated from recent rates will be used if not set # noqa: E501 - - :param rate: The rate of this Loan. # noqa: E501 - :type: str - """ - - self._rate = rate - - @property - def amount(self): - """Gets the amount of this Loan. # noqa: E501 - - Loan amount # noqa: E501 - - :return: The amount of this Loan. # noqa: E501 - :rtype: str - """ - return self._amount - - @amount.setter - def amount(self, amount): - """Sets the amount of this Loan. - - Loan amount # noqa: E501 - - :param amount: The amount of this Loan. # 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 days(self): - """Gets the days of this Loan. # noqa: E501 - - Loan days. Only 10 is supported for now # noqa: E501 - - :return: The days of this Loan. # noqa: E501 - :rtype: int - """ - return self._days - - @days.setter - def days(self, days): - """Sets the days of this Loan. - - Loan days. Only 10 is supported for now # noqa: E501 - - :param days: The days of this Loan. # noqa: E501 - :type: int - """ - - self._days = days - - @property - def auto_renew(self): - """Gets the auto_renew of this Loan. # noqa: E501 - - Whether to auto renew the loan upon expiration # noqa: E501 - - :return: The auto_renew of this Loan. # noqa: E501 - :rtype: bool - """ - return self._auto_renew - - @auto_renew.setter - def auto_renew(self, auto_renew): - """Sets the auto_renew of this Loan. - - Whether to auto renew the loan upon expiration # noqa: E501 - - :param auto_renew: The auto_renew of this Loan. # noqa: E501 - :type: bool - """ - - self._auto_renew = auto_renew - - @property - def currency_pair(self): - """Gets the currency_pair of this Loan. # noqa: E501 - - Currency pair. Required if borrowing # noqa: E501 - - :return: The currency_pair of this Loan. # noqa: E501 - :rtype: str - """ - return self._currency_pair - - @currency_pair.setter - def currency_pair(self, currency_pair): - """Sets the currency_pair of this Loan. - - Currency pair. Required if borrowing # noqa: E501 - - :param currency_pair: The currency_pair of this Loan. # noqa: E501 - :type: str - """ - - self._currency_pair = currency_pair - - @property - def left(self): - """Gets the left of this Loan. # noqa: E501 - - Amount not lent out yet # noqa: E501 - - :return: The left of this Loan. # noqa: E501 - :rtype: str - """ - return self._left - - @left.setter - def left(self, left): - """Sets the left of this Loan. - - Amount not lent out yet # noqa: E501 - - :param left: The left of this Loan. # noqa: E501 - :type: str - """ - - self._left = left - - @property - def repaid(self): - """Gets the repaid of this Loan. # noqa: E501 - - Repaid amount # noqa: E501 - - :return: The repaid of this Loan. # noqa: E501 - :rtype: str - """ - return self._repaid - - @repaid.setter - def repaid(self, repaid): - """Sets the repaid of this Loan. - - Repaid amount # noqa: E501 - - :param repaid: The repaid of this Loan. # noqa: E501 - :type: str - """ - - self._repaid = repaid - - @property - def paid_interest(self): - """Gets the paid_interest of this Loan. # noqa: E501 - - Repaid interest # noqa: E501 - - :return: The paid_interest of this Loan. # noqa: E501 - :rtype: str - """ - return self._paid_interest - - @paid_interest.setter - def paid_interest(self, paid_interest): - """Sets the paid_interest of this Loan. - - Repaid interest # noqa: E501 - - :param paid_interest: The paid_interest of this Loan. # noqa: E501 - :type: str - """ - - self._paid_interest = paid_interest - - @property - def unpaid_interest(self): - """Gets the unpaid_interest of this Loan. # noqa: E501 - - Outstanding interest yet to be paid # noqa: E501 - - :return: The unpaid_interest of this Loan. # noqa: E501 - :rtype: str - """ - return self._unpaid_interest - - @unpaid_interest.setter - def unpaid_interest(self, unpaid_interest): - """Sets the unpaid_interest of this Loan. - - Outstanding interest yet to be paid # noqa: E501 - - :param unpaid_interest: The unpaid_interest of this Loan. # noqa: E501 - :type: str - """ - - self._unpaid_interest = unpaid_interest - - @property - def fee_rate(self): - """Gets the fee_rate of this Loan. # noqa: E501 - - Loan fee rate # noqa: E501 - - :return: The fee_rate of this Loan. # noqa: E501 - :rtype: str - """ - return self._fee_rate - - @fee_rate.setter - def fee_rate(self, fee_rate): - """Sets the fee_rate of this Loan. - - Loan fee rate # noqa: E501 - - :param fee_rate: The fee_rate of this Loan. # noqa: E501 - :type: str - """ - - self._fee_rate = fee_rate - - @property - def orig_id(self): - """Gets the orig_id of this Loan. # noqa: E501 - - Original loan ID of the loan if auto-renewed, otherwise equals to id # noqa: E501 - - :return: The orig_id of this Loan. # noqa: E501 - :rtype: str - """ - return self._orig_id - - @orig_id.setter - def orig_id(self, orig_id): - """Sets the orig_id of this Loan. - - Original loan ID of the loan if auto-renewed, otherwise equals to id # noqa: E501 - - :param orig_id: The orig_id of this Loan. # noqa: E501 - :type: str - """ - - self._orig_id = orig_id - - @property - def text(self): - """Gets the text of this Loan. # noqa: E501 - - User defined custom ID # noqa: E501 - - :return: The text of this Loan. # noqa: E501 - :rtype: str - """ - return self._text - - @text.setter - def text(self, text): - """Sets the text of this Loan. - - User defined custom ID # noqa: E501 - - :param text: The text of this Loan. # 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, Loan): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Loan): - return True - - return self.to_dict() != other.to_dict() diff --git a/gate_api/models/loan_patch.py b/gate_api/models/loan_patch.py deleted file mode 100644 index 05dfc0e..0000000 --- a/gate_api/models/loan_patch.py +++ /dev/null @@ -1,237 +0,0 @@ -# coding: utf-8 - -""" - Gate API v4 - - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 - - Contact: support@mail.gate.io - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from gate_api.configuration import Configuration - - -class LoanPatch(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - 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', 'auto_renew': 'bool', 'currency_pair': 'str', 'loan_id': 'str'} - - attribute_map = { - 'currency': 'currency', - 'side': 'side', - 'auto_renew': 'auto_renew', - 'currency_pair': 'currency_pair', - 'loan_id': 'loan_id', - } - - def __init__( - self, currency=None, side=None, auto_renew=None, currency_pair=None, loan_id=None, local_vars_configuration=None - ): # noqa: E501 - # type: (str, str, bool, str, str, Configuration) -> None - """LoanPatch - a 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._auto_renew = None - self._currency_pair = None - self._loan_id = None - self.discriminator = None - - self.currency = currency - self.side = side - self.auto_renew = auto_renew - if currency_pair is not None: - self.currency_pair = currency_pair - if loan_id is not None: - self.loan_id = loan_id - - @property - def currency(self): - """Gets the currency of this LoanPatch. # noqa: E501 - - Loan currency # noqa: E501 - - :return: The currency of this LoanPatch. # noqa: E501 - :rtype: str - """ - return self._currency - - @currency.setter - def currency(self, currency): - """Sets the currency of this LoanPatch. - - Loan currency # noqa: E501 - - :param currency: The currency of this LoanPatch. # 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 LoanPatch. # noqa: E501 - - Loan side. Possible values are `lend` and `borrow`. For `LoanRecord` patching, only `lend` is supported # noqa: E501 - - :return: The side of this LoanPatch. # noqa: E501 - :rtype: str - """ - return self._side - - @side.setter - def side(self, side): - """Sets the side of this LoanPatch. - - Loan side. Possible values are `lend` and `borrow`. For `LoanRecord` patching, only `lend` is supported # noqa: E501 - - :param side: The side of this LoanPatch. # 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 = ["lend", "borrow"] # 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}".format(side, allowed_values) # noqa: E501 - ) - - self._side = side - - @property - def auto_renew(self): - """Gets the auto_renew of this LoanPatch. # noqa: E501 - - Auto renew # noqa: E501 - - :return: The auto_renew of this LoanPatch. # noqa: E501 - :rtype: bool - """ - return self._auto_renew - - @auto_renew.setter - def auto_renew(self, auto_renew): - """Sets the auto_renew of this LoanPatch. - - Auto renew # noqa: E501 - - :param auto_renew: The auto_renew of this LoanPatch. # noqa: E501 - :type: bool - """ - if self.local_vars_configuration.client_side_validation and auto_renew is None: # noqa: E501 - raise ValueError("Invalid value for `auto_renew`, must not be `None`") # noqa: E501 - - self._auto_renew = auto_renew - - @property - def currency_pair(self): - """Gets the currency_pair of this LoanPatch. # noqa: E501 - - Currency pair. Required if borrowing # noqa: E501 - - :return: The currency_pair of this LoanPatch. # noqa: E501 - :rtype: str - """ - return self._currency_pair - - @currency_pair.setter - def currency_pair(self, currency_pair): - """Sets the currency_pair of this LoanPatch. - - Currency pair. Required if borrowing # noqa: E501 - - :param currency_pair: The currency_pair of this LoanPatch. # noqa: E501 - :type: str - """ - - self._currency_pair = currency_pair - - @property - def loan_id(self): - """Gets the loan_id of this LoanPatch. # noqa: E501 - - Loan ID. Required for `LoanRecord` patching # noqa: E501 - - :return: The loan_id of this LoanPatch. # noqa: E501 - :rtype: str - """ - return self._loan_id - - @loan_id.setter - def loan_id(self, loan_id): - """Sets the loan_id of this LoanPatch. - - Loan ID. Required for `LoanRecord` patching # noqa: E501 - - :param loan_id: The loan_id of this LoanPatch. # noqa: E501 - :type: str - """ - - self._loan_id = loan_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, LoanPatch): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, LoanPatch): - return True - - return self.to_dict() != other.to_dict() diff --git a/gate_api/models/loan_record.py b/gate_api/models/loan_record.py deleted file mode 100644 index 7e0f5a0..0000000 --- a/gate_api/models/loan_record.py +++ /dev/null @@ -1,507 +0,0 @@ -# coding: utf-8 - -""" - Gate API v4 - - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 - - Contact: support@mail.gate.io - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from gate_api.configuration import Configuration - - -class LoanRecord(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - 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', - 'loan_id': 'str', - 'create_time': 'str', - 'expire_time': 'str', - 'status': 'str', - 'borrow_user_id': 'str', - 'currency': 'str', - 'rate': 'str', - 'amount': 'str', - 'days': 'int', - 'auto_renew': 'bool', - 'repaid': 'str', - 'paid_interest': 'str', - 'unpaid_interest': 'str', - } - - attribute_map = { - 'id': 'id', - 'loan_id': 'loan_id', - 'create_time': 'create_time', - 'expire_time': 'expire_time', - 'status': 'status', - 'borrow_user_id': 'borrow_user_id', - 'currency': 'currency', - 'rate': 'rate', - 'amount': 'amount', - 'days': 'days', - 'auto_renew': 'auto_renew', - 'repaid': 'repaid', - 'paid_interest': 'paid_interest', - 'unpaid_interest': 'unpaid_interest', - } - - def __init__( - self, - id=None, - loan_id=None, - create_time=None, - expire_time=None, - status=None, - borrow_user_id=None, - currency=None, - rate=None, - amount=None, - days=None, - auto_renew=False, - repaid=None, - paid_interest=None, - unpaid_interest=None, - local_vars_configuration=None, - ): # noqa: E501 - # type: (str, str, str, str, str, str, str, str, str, int, bool, str, str, str, Configuration) -> None - """LoanRecord - a 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._loan_id = None - self._create_time = None - self._expire_time = None - self._status = None - self._borrow_user_id = None - self._currency = None - self._rate = None - self._amount = None - self._days = None - self._auto_renew = None - self._repaid = None - self._paid_interest = None - self._unpaid_interest = None - self.discriminator = None - - if id is not None: - self.id = id - if loan_id is not None: - self.loan_id = loan_id - if create_time is not None: - self.create_time = create_time - if expire_time is not None: - self.expire_time = expire_time - if status is not None: - self.status = status - if borrow_user_id is not None: - self.borrow_user_id = borrow_user_id - if currency is not None: - self.currency = currency - if rate is not None: - self.rate = rate - if amount is not None: - self.amount = amount - if days is not None: - self.days = days - if auto_renew is not None: - self.auto_renew = auto_renew - if repaid is not None: - self.repaid = repaid - if paid_interest is not None: - self.paid_interest = paid_interest - if unpaid_interest is not None: - self.unpaid_interest = unpaid_interest - - @property - def id(self): - """Gets the id of this LoanRecord. # noqa: E501 - - Loan record ID # noqa: E501 - - :return: The id of this LoanRecord. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this LoanRecord. - - Loan record ID # noqa: E501 - - :param id: The id of this LoanRecord. # noqa: E501 - :type: str - """ - - self._id = id - - @property - def loan_id(self): - """Gets the loan_id of this LoanRecord. # noqa: E501 - - Loan ID the record belongs to # noqa: E501 - - :return: The loan_id of this LoanRecord. # noqa: E501 - :rtype: str - """ - return self._loan_id - - @loan_id.setter - def loan_id(self, loan_id): - """Sets the loan_id of this LoanRecord. - - Loan ID the record belongs to # noqa: E501 - - :param loan_id: The loan_id of this LoanRecord. # noqa: E501 - :type: str - """ - - self._loan_id = loan_id - - @property - def create_time(self): - """Gets the create_time of this LoanRecord. # noqa: E501 - - Loan time # noqa: E501 - - :return: The create_time of this LoanRecord. # noqa: E501 - :rtype: str - """ - return self._create_time - - @create_time.setter - def create_time(self, create_time): - """Sets the create_time of this LoanRecord. - - Loan time # noqa: E501 - - :param create_time: The create_time of this LoanRecord. # noqa: E501 - :type: str - """ - - self._create_time = create_time - - @property - def expire_time(self): - """Gets the expire_time of this LoanRecord. # noqa: E501 - - Expiration time # noqa: E501 - - :return: The expire_time of this LoanRecord. # noqa: E501 - :rtype: str - """ - return self._expire_time - - @expire_time.setter - def expire_time(self, expire_time): - """Sets the expire_time of this LoanRecord. - - Expiration time # noqa: E501 - - :param expire_time: The expire_time of this LoanRecord. # noqa: E501 - :type: str - """ - - self._expire_time = expire_time - - @property - def status(self): - """Gets the status of this LoanRecord. # noqa: E501 - - Loan record status # noqa: E501 - - :return: The status of this LoanRecord. # noqa: E501 - :rtype: str - """ - return self._status - - @status.setter - def status(self, status): - """Sets the status of this LoanRecord. - - Loan record status # noqa: E501 - - :param status: The status of this LoanRecord. # noqa: E501 - :type: str - """ - allowed_values = ["loaned", "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}".format(status, allowed_values) # noqa: E501 - ) - - self._status = status - - @property - def borrow_user_id(self): - """Gets the borrow_user_id of this LoanRecord. # noqa: E501 - - Garbled user ID # noqa: E501 - - :return: The borrow_user_id of this LoanRecord. # noqa: E501 - :rtype: str - """ - return self._borrow_user_id - - @borrow_user_id.setter - def borrow_user_id(self, borrow_user_id): - """Sets the borrow_user_id of this LoanRecord. - - Garbled user ID # noqa: E501 - - :param borrow_user_id: The borrow_user_id of this LoanRecord. # noqa: E501 - :type: str - """ - - self._borrow_user_id = borrow_user_id - - @property - def currency(self): - """Gets the currency of this LoanRecord. # noqa: E501 - - Loan currency # noqa: E501 - - :return: The currency of this LoanRecord. # noqa: E501 - :rtype: str - """ - return self._currency - - @currency.setter - def currency(self, currency): - """Sets the currency of this LoanRecord. - - Loan currency # noqa: E501 - - :param currency: The currency of this LoanRecord. # noqa: E501 - :type: str - """ - - self._currency = currency - - @property - def rate(self): - """Gets the rate of this LoanRecord. # noqa: E501 - - Loan rate # noqa: E501 - - :return: The rate of this LoanRecord. # noqa: E501 - :rtype: str - """ - return self._rate - - @rate.setter - def rate(self, rate): - """Sets the rate of this LoanRecord. - - Loan rate # noqa: E501 - - :param rate: The rate of this LoanRecord. # noqa: E501 - :type: str - """ - - self._rate = rate - - @property - def amount(self): - """Gets the amount of this LoanRecord. # noqa: E501 - - Loan amount # noqa: E501 - - :return: The amount of this LoanRecord. # noqa: E501 - :rtype: str - """ - return self._amount - - @amount.setter - def amount(self, amount): - """Sets the amount of this LoanRecord. - - Loan amount # noqa: E501 - - :param amount: The amount of this LoanRecord. # noqa: E501 - :type: str - """ - - self._amount = amount - - @property - def days(self): - """Gets the days of this LoanRecord. # noqa: E501 - - Loan days # noqa: E501 - - :return: The days of this LoanRecord. # noqa: E501 - :rtype: int - """ - return self._days - - @days.setter - def days(self, days): - """Sets the days of this LoanRecord. - - Loan days # noqa: E501 - - :param days: The days of this LoanRecord. # noqa: E501 - :type: int - """ - - self._days = days - - @property - def auto_renew(self): - """Gets the auto_renew of this LoanRecord. # noqa: E501 - - Whether the record will auto renew on expiration # noqa: E501 - - :return: The auto_renew of this LoanRecord. # noqa: E501 - :rtype: bool - """ - return self._auto_renew - - @auto_renew.setter - def auto_renew(self, auto_renew): - """Sets the auto_renew of this LoanRecord. - - Whether the record will auto renew on expiration # noqa: E501 - - :param auto_renew: The auto_renew of this LoanRecord. # noqa: E501 - :type: bool - """ - - self._auto_renew = auto_renew - - @property - def repaid(self): - """Gets the repaid of this LoanRecord. # noqa: E501 - - Repaid amount # noqa: E501 - - :return: The repaid of this LoanRecord. # noqa: E501 - :rtype: str - """ - return self._repaid - - @repaid.setter - def repaid(self, repaid): - """Sets the repaid of this LoanRecord. - - Repaid amount # noqa: E501 - - :param repaid: The repaid of this LoanRecord. # noqa: E501 - :type: str - """ - - self._repaid = repaid - - @property - def paid_interest(self): - """Gets the paid_interest of this LoanRecord. # noqa: E501 - - Repaid interest # noqa: E501 - - :return: The paid_interest of this LoanRecord. # noqa: E501 - :rtype: str - """ - return self._paid_interest - - @paid_interest.setter - def paid_interest(self, paid_interest): - """Sets the paid_interest of this LoanRecord. - - Repaid interest # noqa: E501 - - :param paid_interest: The paid_interest of this LoanRecord. # noqa: E501 - :type: str - """ - - self._paid_interest = paid_interest - - @property - def unpaid_interest(self): - """Gets the unpaid_interest of this LoanRecord. # noqa: E501 - - Outstanding interest yet to be paid # noqa: E501 - - :return: The unpaid_interest of this LoanRecord. # noqa: E501 - :rtype: str - """ - return self._unpaid_interest - - @unpaid_interest.setter - def unpaid_interest(self, unpaid_interest): - """Sets the unpaid_interest of this LoanRecord. - - Outstanding interest yet to be paid # noqa: E501 - - :param unpaid_interest: The unpaid_interest of this LoanRecord. # noqa: E501 - :type: str - """ - - self._unpaid_interest = unpaid_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, LoanRecord): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, LoanRecord): - return True - - return self.to_dict() != other.to_dict() diff --git a/gate_api/models/margin_account.py b/gate_api/models/margin_account.py index c79e5ad..45561e7 100644 --- a/gate_api/models/margin_account.py +++ b/gate_api/models/margin_account.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -34,42 +34,55 @@ class MarginAccount(object): """ openapi_types = { 'currency_pair': 'str', + 'account_type': 'str', + 'leverage': 'str', 'locked': 'bool', 'risk': 'str', + 'mmr': 'str', 'base': 'MarginAccountCurrency', - 'quote': 'MarginAccountCurrency', + 'quote': 'MarginAccountCurrency' } attribute_map = { 'currency_pair': 'currency_pair', + 'account_type': 'account_type', + 'leverage': 'leverage', 'locked': 'locked', 'risk': 'risk', + 'mmr': 'mmr', 'base': 'base', - 'quote': 'quote', + 'quote': 'quote' } - def __init__( - self, currency_pair=None, locked=None, risk=None, base=None, quote=None, local_vars_configuration=None - ): # noqa: E501 - # type: (str, bool, str, MarginAccountCurrency, MarginAccountCurrency, Configuration) -> None + def __init__(self, currency_pair=None, account_type=None, leverage=None, locked=None, risk=None, mmr=None, base=None, quote=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, bool, str, str, MarginAccountCurrency, MarginAccountCurrency, Configuration) -> None """MarginAccount - a 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._account_type = None + self._leverage = None self._locked = None self._risk = None + self._mmr = None self._base = None self._quote = None self.discriminator = None if currency_pair is not None: self.currency_pair = currency_pair + if account_type is not None: + self.account_type = account_type + if leverage is not None: + self.leverage = leverage if locked is not None: self.locked = locked if risk is not None: self.risk = risk + if mmr is not None: + self.mmr = mmr if base is not None: self.base = base if quote is not None: @@ -98,11 +111,57 @@ def currency_pair(self, currency_pair): self._currency_pair = currency_pair + @property + def account_type(self): + """Gets the account_type of this MarginAccount. # noqa: E501 + + Account type: risk - risk rate account, mmr - maintenance margin rate account, inactive - market not activated # noqa: E501 + + :return: The account_type of this MarginAccount. # noqa: E501 + :rtype: str + """ + return self._account_type + + @account_type.setter + def account_type(self, account_type): + """Sets the account_type of this MarginAccount. + + Account type: risk - risk rate account, mmr - maintenance margin rate account, inactive - market not activated # noqa: E501 + + :param account_type: The account_type of this MarginAccount. # noqa: E501 + :type: str + """ + + self._account_type = account_type + + @property + def leverage(self): + """Gets the leverage of this MarginAccount. # noqa: E501 + + User's current market leverage multiplier # noqa: E501 + + :return: The leverage of this MarginAccount. # noqa: E501 + :rtype: str + """ + return self._leverage + + @leverage.setter + def leverage(self, leverage): + """Sets the leverage of this MarginAccount. + + User's current market leverage multiplier # noqa: E501 + + :param leverage: The leverage of this MarginAccount. # noqa: E501 + :type: str + """ + + self._leverage = leverage + @property def locked(self): """Gets the locked of this MarginAccount. # noqa: E501 - Whether account is locked # noqa: E501 + Whether the account is locked # noqa: E501 :return: The locked of this MarginAccount. # noqa: E501 :rtype: bool @@ -113,7 +172,7 @@ def locked(self): def locked(self, locked): """Sets the locked of this MarginAccount. - Whether account is locked # noqa: E501 + Whether the account is locked # noqa: E501 :param locked: The locked of this MarginAccount. # noqa: E501 :type: bool @@ -125,7 +184,7 @@ def locked(self, locked): def risk(self): """Gets the risk of this MarginAccount. # noqa: E501 - Current risk rate of margin account # noqa: E501 + Current risk rate of the margin account (returned when the account is a risk rate account) # noqa: E501 :return: The risk of this MarginAccount. # noqa: E501 :rtype: str @@ -136,7 +195,7 @@ def risk(self): def risk(self, risk): """Sets the risk of this MarginAccount. - Current risk rate of margin account # noqa: E501 + Current risk rate of the margin account (returned when the account is a risk rate account) # noqa: E501 :param risk: The risk of this MarginAccount. # noqa: E501 :type: str @@ -144,6 +203,29 @@ def risk(self, risk): self._risk = risk + @property + def mmr(self): + """Gets the mmr of this MarginAccount. # noqa: E501 + + Leveraged Account Current Maintenance Margin Rate (returned when the Account is Account) # noqa: E501 + + :return: The mmr of this MarginAccount. # noqa: E501 + :rtype: str + """ + return self._mmr + + @mmr.setter + def mmr(self, mmr): + """Sets the mmr of this MarginAccount. + + Leveraged Account Current Maintenance Margin Rate (returned when the Account is Account) # noqa: E501 + + :param mmr: The mmr of this MarginAccount. # noqa: E501 + :type: str + """ + + self._mmr = mmr + @property def base(self): """Gets the base of this MarginAccount. # noqa: E501 @@ -193,16 +275,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/margin_account_book.py b/gate_api/models/margin_account_book.py index f70e450..1ee6bbd 100644 --- a/gate_api/models/margin_account_book.py +++ b/gate_api/models/margin_account_book.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -40,6 +40,7 @@ class MarginAccountBook(object): 'currency_pair': 'str', 'change': 'str', 'balance': 'str', + 'type': 'str' } attribute_map = { @@ -50,20 +51,11 @@ class MarginAccountBook(object): 'currency_pair': 'currency_pair', 'change': 'change', 'balance': 'balance', + 'type': 'type' } - def __init__( - self, - id=None, - time=None, - time_ms=None, - currency=None, - currency_pair=None, - change=None, - balance=None, - local_vars_configuration=None, - ): # noqa: E501 - # type: (str, str, int, str, str, str, str, Configuration) -> None + def __init__(self, id=None, time=None, time_ms=None, currency=None, currency_pair=None, change=None, balance=None, type=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, int, str, str, str, str, str, Configuration) -> None """MarginAccountBook - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -76,6 +68,7 @@ def __init__( self._currency_pair = None self._change = None self._balance = None + self._type = None self.discriminator = None if id is not None: @@ -92,6 +85,8 @@ def __init__( self.change = change if balance is not None: self.balance = balance + if type is not None: + self.type = type @property def id(self): @@ -120,7 +115,7 @@ def id(self, id): def time(self): """Gets the time of this MarginAccountBook. # noqa: E501 - Balance changed timestamp # noqa: E501 + Account change timestamp # noqa: E501 :return: The time of this MarginAccountBook. # noqa: E501 :rtype: str @@ -131,7 +126,7 @@ def time(self): def time(self, time): """Sets the time of this MarginAccountBook. - Balance changed timestamp # noqa: E501 + Account change timestamp # noqa: E501 :param time: The time of this MarginAccountBook. # noqa: E501 :type: str @@ -189,7 +184,7 @@ def currency(self, currency): def currency_pair(self): """Gets the currency_pair of this MarginAccountBook. # noqa: E501 - Account currency pair # noqa: E501 + Account trading pair # noqa: E501 :return: The currency_pair of this MarginAccountBook. # noqa: E501 :rtype: str @@ -200,7 +195,7 @@ def currency_pair(self): def currency_pair(self, currency_pair): """Sets the currency_pair of this MarginAccountBook. - Account currency pair # noqa: E501 + Account trading pair # noqa: E501 :param currency_pair: The currency_pair of this MarginAccountBook. # noqa: E501 :type: str @@ -254,6 +249,29 @@ def balance(self, balance): self._balance = balance + @property + def type(self): + """Gets the type of this MarginAccountBook. # noqa: E501 + + Account book type. Please refer to [account book type](#accountbook-type) for more detail # noqa: E501 + + :return: The type of this MarginAccountBook. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this MarginAccountBook. + + Account book type. Please refer to [account book type](#accountbook-type) for more detail # noqa: E501 + + :param type: The type of this MarginAccountBook. # noqa: E501 + :type: str + """ + + self._type = type + def to_dict(self): """Returns the model properties as a dict""" result = {} @@ -261,16 +279,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/margin_account_currency.py b/gate_api/models/margin_account_currency.py index 64ad9a5..cb96b38 100644 --- a/gate_api/models/margin_account_currency.py +++ b/gate_api/models/margin_account_currency.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -32,19 +32,23 @@ class MarginAccountCurrency(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {'currency': 'str', 'available': 'str', 'locked': 'str', 'borrowed': 'str', 'interest': 'str'} + openapi_types = { + 'currency': 'str', + 'available': 'str', + 'locked': 'str', + 'borrowed': 'str', + 'interest': 'str' + } attribute_map = { 'currency': 'currency', 'available': 'available', 'locked': 'locked', 'borrowed': 'borrowed', - 'interest': 'interest', + 'interest': 'interest' } - def __init__( - self, currency=None, available=None, locked=None, borrowed=None, interest=None, local_vars_configuration=None - ): # noqa: E501 + def __init__(self, currency=None, available=None, locked=None, borrowed=None, interest=None, local_vars_configuration=None): # noqa: E501 # type: (str, str, str, str, str, Configuration) -> None """MarginAccountCurrency - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: @@ -96,7 +100,7 @@ def currency(self, currency): def available(self): """Gets the available of this MarginAccountCurrency. # noqa: E501 - Amount suitable for margin trading. # noqa: E501 + Amount available for margin trading, available = margin + borrowed # noqa: E501 :return: The available of this MarginAccountCurrency. # noqa: E501 :rtype: str @@ -107,7 +111,7 @@ def available(self): def available(self, available): """Sets the available of this MarginAccountCurrency. - Amount suitable for margin trading. # noqa: E501 + Amount available for margin trading, available = margin + borrowed # noqa: E501 :param available: The available of this MarginAccountCurrency. # noqa: E501 :type: str @@ -119,7 +123,7 @@ def available(self, available): def locked(self): """Gets the locked of this MarginAccountCurrency. # noqa: E501 - Locked amount, used in margin trading # noqa: E501 + Frozen funds, such as amounts already placed in margin market for order trading # noqa: E501 :return: The locked of this MarginAccountCurrency. # noqa: E501 :rtype: str @@ -130,7 +134,7 @@ def locked(self): def locked(self, locked): """Sets the locked of this MarginAccountCurrency. - Locked amount, used in margin trading # noqa: E501 + Frozen funds, such as amounts already placed in margin market for order trading # noqa: E501 :param locked: The locked of this MarginAccountCurrency. # noqa: E501 :type: str @@ -142,7 +146,7 @@ def locked(self, locked): def borrowed(self): """Gets the borrowed of this MarginAccountCurrency. # noqa: E501 - Borrowed amount # noqa: E501 + Borrowed funds # noqa: E501 :return: The borrowed of this MarginAccountCurrency. # noqa: E501 :rtype: str @@ -153,7 +157,7 @@ def borrowed(self): def borrowed(self, borrowed): """Sets the borrowed of this MarginAccountCurrency. - Borrowed amount # noqa: E501 + Borrowed funds # noqa: E501 :param borrowed: The borrowed of this MarginAccountCurrency. # noqa: E501 :type: str @@ -165,7 +169,7 @@ def borrowed(self, borrowed): def interest(self): """Gets the interest of this MarginAccountCurrency. # noqa: E501 - Unpaid interests # noqa: E501 + Unpaid interest # noqa: E501 :return: The interest of this MarginAccountCurrency. # noqa: E501 :rtype: str @@ -176,7 +180,7 @@ def interest(self): def interest(self, interest): """Sets the interest of this MarginAccountCurrency. - Unpaid interests # noqa: E501 + Unpaid interest # noqa: E501 :param interest: The interest of this MarginAccountCurrency. # noqa: E501 :type: str @@ -191,16 +195,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/margin_borrowable.py b/gate_api/models/margin_borrowable.py deleted file mode 100644 index 919e471..0000000 --- a/gate_api/models/margin_borrowable.py +++ /dev/null @@ -1,169 +0,0 @@ -# coding: utf-8 - -""" - Gate API v4 - - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 - - Contact: support@mail.gate.io - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from gate_api.configuration import Configuration - - -class MarginBorrowable(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - 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', 'currency_pair': 'str', 'amount': 'str'} - - attribute_map = {'currency': 'currency', 'currency_pair': 'currency_pair', 'amount': 'amount'} - - def __init__(self, currency=None, currency_pair=None, amount=None, local_vars_configuration=None): # noqa: E501 - # type: (str, str, str, Configuration) -> None - """MarginBorrowable - a 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._currency_pair = None - self._amount = None - self.discriminator = None - - if currency is not None: - self.currency = currency - if currency_pair is not None: - self.currency_pair = currency_pair - if amount is not None: - self.amount = amount - - @property - def currency(self): - """Gets the currency of this MarginBorrowable. # noqa: E501 - - Currency detail # noqa: E501 - - :return: The currency of this MarginBorrowable. # noqa: E501 - :rtype: str - """ - return self._currency - - @currency.setter - def currency(self, currency): - """Sets the currency of this MarginBorrowable. - - Currency detail # noqa: E501 - - :param currency: The currency of this MarginBorrowable. # noqa: E501 - :type: str - """ - - self._currency = currency - - @property - def currency_pair(self): - """Gets the currency_pair of this MarginBorrowable. # noqa: E501 - - Currency pair # noqa: E501 - - :return: The currency_pair of this MarginBorrowable. # noqa: E501 - :rtype: str - """ - return self._currency_pair - - @currency_pair.setter - def currency_pair(self, currency_pair): - """Sets the currency_pair of this MarginBorrowable. - - Currency pair # noqa: E501 - - :param currency_pair: The currency_pair of this MarginBorrowable. # noqa: E501 - :type: str - """ - - self._currency_pair = currency_pair - - @property - def amount(self): - """Gets the amount of this MarginBorrowable. # noqa: E501 - - Max borrowable amount # noqa: E501 - - :return: The amount of this MarginBorrowable. # noqa: E501 - :rtype: str - """ - return self._amount - - @amount.setter - def amount(self, amount): - """Sets the amount of this MarginBorrowable. - - Max borrowable amount # noqa: E501 - - :param amount: The amount of this MarginBorrowable. # noqa: E501 - :type: str - """ - - 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, MarginBorrowable): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, MarginBorrowable): - return True - - return self.to_dict() != other.to_dict() diff --git a/gate_api/models/margin_currency_pair.py b/gate_api/models/margin_currency_pair.py deleted file mode 100644 index d5111c4..0000000 --- a/gate_api/models/margin_currency_pair.py +++ /dev/null @@ -1,299 +0,0 @@ -# coding: utf-8 - -""" - Gate API v4 - - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 - - Contact: support@mail.gate.io - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from gate_api.configuration import Configuration - - -class MarginCurrencyPair(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - 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', - 'base': 'str', - 'quote': 'str', - 'leverage': 'int', - 'min_base_amount': 'str', - 'min_quote_amount': 'str', - 'max_quote_amount': 'str', - } - - attribute_map = { - 'id': 'id', - 'base': 'base', - 'quote': 'quote', - 'leverage': 'leverage', - 'min_base_amount': 'min_base_amount', - 'min_quote_amount': 'min_quote_amount', - 'max_quote_amount': 'max_quote_amount', - } - - def __init__( - self, - id=None, - base=None, - quote=None, - leverage=None, - min_base_amount=None, - min_quote_amount=None, - max_quote_amount=None, - local_vars_configuration=None, - ): # noqa: E501 - # type: (str, str, str, int, str, str, str, Configuration) -> None - """MarginCurrencyPair - a 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._base = None - self._quote = None - self._leverage = None - self._min_base_amount = None - self._min_quote_amount = None - self._max_quote_amount = None - self.discriminator = None - - if id is not None: - self.id = id - if base is not None: - self.base = base - if quote is not None: - self.quote = quote - if leverage is not None: - self.leverage = leverage - if min_base_amount is not None: - self.min_base_amount = min_base_amount - if min_quote_amount is not None: - self.min_quote_amount = min_quote_amount - if max_quote_amount is not None: - self.max_quote_amount = max_quote_amount - - @property - def id(self): - """Gets the id of this MarginCurrencyPair. # noqa: E501 - - Currency pair # noqa: E501 - - :return: The id of this MarginCurrencyPair. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this MarginCurrencyPair. - - Currency pair # noqa: E501 - - :param id: The id of this MarginCurrencyPair. # noqa: E501 - :type: str - """ - - self._id = id - - @property - def base(self): - """Gets the base of this MarginCurrencyPair. # noqa: E501 - - Base currency # noqa: E501 - - :return: The base of this MarginCurrencyPair. # noqa: E501 - :rtype: str - """ - return self._base - - @base.setter - def base(self, base): - """Sets the base of this MarginCurrencyPair. - - Base currency # noqa: E501 - - :param base: The base of this MarginCurrencyPair. # noqa: E501 - :type: str - """ - - self._base = base - - @property - def quote(self): - """Gets the quote of this MarginCurrencyPair. # noqa: E501 - - Quote currency # noqa: E501 - - :return: The quote of this MarginCurrencyPair. # noqa: E501 - :rtype: str - """ - return self._quote - - @quote.setter - def quote(self, quote): - """Sets the quote of this MarginCurrencyPair. - - Quote currency # noqa: E501 - - :param quote: The quote of this MarginCurrencyPair. # noqa: E501 - :type: str - """ - - self._quote = quote - - @property - def leverage(self): - """Gets the leverage of this MarginCurrencyPair. # noqa: E501 - - Leverage # noqa: E501 - - :return: The leverage of this MarginCurrencyPair. # noqa: E501 - :rtype: int - """ - return self._leverage - - @leverage.setter - def leverage(self, leverage): - """Sets the leverage of this MarginCurrencyPair. - - Leverage # noqa: E501 - - :param leverage: The leverage of this MarginCurrencyPair. # noqa: E501 - :type: int - """ - - self._leverage = leverage - - @property - def min_base_amount(self): - """Gets the min_base_amount of this MarginCurrencyPair. # noqa: E501 - - Minimum base currency to loan, `null` means no limit # noqa: E501 - - :return: The min_base_amount of this MarginCurrencyPair. # noqa: E501 - :rtype: str - """ - return self._min_base_amount - - @min_base_amount.setter - def min_base_amount(self, min_base_amount): - """Sets the min_base_amount of this MarginCurrencyPair. - - Minimum base currency to loan, `null` means no limit # noqa: E501 - - :param min_base_amount: The min_base_amount of this MarginCurrencyPair. # noqa: E501 - :type: str - """ - - self._min_base_amount = min_base_amount - - @property - def min_quote_amount(self): - """Gets the min_quote_amount of this MarginCurrencyPair. # noqa: E501 - - Minimum quote currency to loan, `null` means no limit # noqa: E501 - - :return: The min_quote_amount of this MarginCurrencyPair. # noqa: E501 - :rtype: str - """ - return self._min_quote_amount - - @min_quote_amount.setter - def min_quote_amount(self, min_quote_amount): - """Sets the min_quote_amount of this MarginCurrencyPair. - - Minimum quote currency to loan, `null` means no limit # noqa: E501 - - :param min_quote_amount: The min_quote_amount of this MarginCurrencyPair. # noqa: E501 - :type: str - """ - - self._min_quote_amount = min_quote_amount - - @property - def max_quote_amount(self): - """Gets the max_quote_amount of this MarginCurrencyPair. # noqa: E501 - - Maximum borrowable amount for quote currency. Base currency limit is calculated by quote maximum and market price. `null` means no limit # noqa: E501 - - :return: The max_quote_amount of this MarginCurrencyPair. # noqa: E501 - :rtype: str - """ - return self._max_quote_amount - - @max_quote_amount.setter - def max_quote_amount(self, max_quote_amount): - """Sets the max_quote_amount of this MarginCurrencyPair. - - Maximum borrowable amount for quote currency. Base currency limit is calculated by quote maximum and market price. `null` means no limit # noqa: E501 - - :param max_quote_amount: The max_quote_amount of this MarginCurrencyPair. # noqa: E501 - :type: str - """ - - self._max_quote_amount = max_quote_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, MarginCurrencyPair): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, MarginCurrencyPair): - return True - - return self.to_dict() != other.to_dict() diff --git a/gate_api/models/margin_leverage_tier.py b/gate_api/models/margin_leverage_tier.py new file mode 100644 index 0000000..ebf2237 --- /dev/null +++ b/gate_api/models/margin_leverage_tier.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 MarginLeverageTier(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'upper_limit': 'str', + 'mmr': 'str', + 'leverage': 'str' + } + + attribute_map = { + 'upper_limit': 'upper_limit', + 'mmr': 'mmr', + 'leverage': 'leverage' + } + + def __init__(self, upper_limit=None, mmr=None, leverage=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, Configuration) -> None + """MarginLeverageTier - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._upper_limit = None + self._mmr = None + self._leverage = None + self.discriminator = None + + if upper_limit is not None: + self.upper_limit = upper_limit + if mmr is not None: + self.mmr = mmr + if leverage is not None: + self.leverage = leverage + + @property + def upper_limit(self): + """Gets the upper_limit of this MarginLeverageTier. # noqa: E501 + + Maximum loan limit # noqa: E501 + + :return: The upper_limit of this MarginLeverageTier. # noqa: E501 + :rtype: str + """ + return self._upper_limit + + @upper_limit.setter + def upper_limit(self, upper_limit): + """Sets the upper_limit of this MarginLeverageTier. + + Maximum loan limit # noqa: E501 + + :param upper_limit: The upper_limit of this MarginLeverageTier. # noqa: E501 + :type: str + """ + + self._upper_limit = upper_limit + + @property + def mmr(self): + """Gets the mmr of this MarginLeverageTier. # noqa: E501 + + Maintenance margin rate # noqa: E501 + + :return: The mmr of this MarginLeverageTier. # noqa: E501 + :rtype: str + """ + return self._mmr + + @mmr.setter + def mmr(self, mmr): + """Sets the mmr of this MarginLeverageTier. + + Maintenance margin rate # noqa: E501 + + :param mmr: The mmr of this MarginLeverageTier. # noqa: E501 + :type: str + """ + + self._mmr = mmr + + @property + def leverage(self): + """Gets the leverage of this MarginLeverageTier. # noqa: E501 + + Maximum leverage multiple # noqa: E501 + + :return: The leverage of this MarginLeverageTier. # noqa: E501 + :rtype: str + """ + return self._leverage + + @leverage.setter + def leverage(self, leverage): + """Sets the leverage of this MarginLeverageTier. + + Maximum leverage multiple # noqa: E501 + + :param leverage: The leverage of this MarginLeverageTier. # 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, MarginLeverageTier): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, MarginLeverageTier): + 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 new file mode 100644 index 0000000..f024010 --- /dev/null +++ b/gate_api/models/margin_market_leverage.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 MarginMarketLeverage(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'leverage': 'str' + } + + attribute_map = { + 'currency_pair': 'currency_pair', + 'leverage': 'leverage' + } + + def __init__(self, currency_pair=None, leverage=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """MarginMarketLeverage - a 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._leverage = None + self.discriminator = None + + if currency_pair is not None: + self.currency_pair = currency_pair + self.leverage = leverage + + @property + def currency_pair(self): + """Gets the currency_pair of this MarginMarketLeverage. # noqa: E501 + + Market # noqa: E501 + + :return: The currency_pair of this MarginMarketLeverage. # noqa: E501 + :rtype: str + """ + return self._currency_pair + + @currency_pair.setter + def currency_pair(self, currency_pair): + """Sets the currency_pair of this MarginMarketLeverage. + + Market # noqa: E501 + + :param currency_pair: The currency_pair of this MarginMarketLeverage. # noqa: E501 + :type: str + """ + + self._currency_pair = currency_pair + + @property + def leverage(self): + """Gets the leverage of this MarginMarketLeverage. # noqa: E501 + + Position leverage # noqa: E501 + + :return: The leverage of this MarginMarketLeverage. # noqa: E501 + :rtype: str + """ + return self._leverage + + @leverage.setter + def leverage(self, leverage): + """Sets the leverage of this MarginMarketLeverage. + + Position leverage # noqa: E501 + + :param leverage: The leverage of this MarginMarketLeverage. # 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, MarginMarketLeverage): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, MarginMarketLeverage): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/margin_tiers.py b/gate_api/models/margin_tiers.py new file mode 100644 index 0000000..a1bb5e7 --- /dev/null +++ b/gate_api/models/margin_tiers.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 MarginTiers(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'tier': 'str', + 'margin_rate': 'str', + 'lower_limit': 'str', + 'upper_limit': 'str', + 'leverage': 'str' + } + + attribute_map = { + 'tier': 'tier', + 'margin_rate': 'margin_rate', + 'lower_limit': 'lower_limit', + 'upper_limit': 'upper_limit', + 'leverage': 'leverage' + } + + def __init__(self, tier=None, margin_rate=None, lower_limit=None, upper_limit=None, leverage=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, Configuration) -> None + """MarginTiers - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._tier = None + self._margin_rate = None + self._lower_limit = None + self._upper_limit = None + self._leverage = None + self.discriminator = None + + if tier is not None: + self.tier = tier + if margin_rate is not None: + self.margin_rate = margin_rate + if lower_limit is not None: + self.lower_limit = lower_limit + if upper_limit is not None: + self.upper_limit = upper_limit + if leverage is not None: + self.leverage = leverage + + @property + def tier(self): + """Gets the tier of this MarginTiers. # noqa: E501 + + Tier # noqa: E501 + + :return: The tier of this MarginTiers. # noqa: E501 + :rtype: str + """ + return self._tier + + @tier.setter + def tier(self, tier): + """Sets the tier of this MarginTiers. + + Tier # noqa: E501 + + :param tier: The tier of this MarginTiers. # noqa: E501 + :type: str + """ + + self._tier = tier + + @property + def margin_rate(self): + """Gets the margin_rate of this MarginTiers. # noqa: E501 + + Discount # noqa: E501 + + :return: The margin_rate of this MarginTiers. # noqa: E501 + :rtype: str + """ + return self._margin_rate + + @margin_rate.setter + def margin_rate(self, margin_rate): + """Sets the margin_rate of this MarginTiers. + + Discount # noqa: E501 + + :param margin_rate: The margin_rate of this MarginTiers. # noqa: E501 + :type: str + """ + + self._margin_rate = margin_rate + + @property + def lower_limit(self): + """Gets the lower_limit of this MarginTiers. # noqa: E501 + + Lower limit # noqa: E501 + + :return: The lower_limit of this MarginTiers. # noqa: E501 + :rtype: str + """ + return self._lower_limit + + @lower_limit.setter + def lower_limit(self, lower_limit): + """Sets the lower_limit of this MarginTiers. + + Lower limit # noqa: E501 + + :param lower_limit: The lower_limit of this MarginTiers. # noqa: E501 + :type: str + """ + + self._lower_limit = lower_limit + + @property + def upper_limit(self): + """Gets the upper_limit of this MarginTiers. # noqa: E501 + + Upper limit, \"\" indicates greater than (the last tier) # noqa: E501 + + :return: The upper_limit of this MarginTiers. # noqa: E501 + :rtype: str + """ + return self._upper_limit + + @upper_limit.setter + def upper_limit(self, upper_limit): + """Sets the upper_limit of this MarginTiers. + + Upper limit, \"\" indicates greater than (the last tier) # noqa: E501 + + :param upper_limit: The upper_limit of this MarginTiers. # noqa: E501 + :type: str + """ + + self._upper_limit = upper_limit + + @property + def leverage(self): + """Gets the leverage of this MarginTiers. # noqa: E501 + + Position leverage # noqa: E501 + + :return: The leverage of this MarginTiers. # noqa: E501 + :rtype: str + """ + return self._leverage + + @leverage.setter + def leverage(self, leverage): + """Sets the leverage of this MarginTiers. + + Position leverage # noqa: E501 + + :param leverage: The leverage of this MarginTiers. # 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, MarginTiers): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, MarginTiers): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/margin_transferable.py b/gate_api/models/margin_transferable.py index 3736eed..4031c74 100644 --- a/gate_api/models/margin_transferable.py +++ b/gate_api/models/margin_transferable.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -32,9 +32,17 @@ class MarginTransferable(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {'currency': 'str', 'currency_pair': 'str', 'amount': 'str'} - - attribute_map = {'currency': 'currency', 'currency_pair': 'currency_pair', 'amount': 'amount'} + openapi_types = { + 'currency': 'str', + 'currency_pair': 'str', + 'amount': 'str' + } + + attribute_map = { + 'currency': 'currency', + 'currency_pair': 'currency_pair', + 'amount': 'amount' + } def __init__(self, currency=None, currency_pair=None, amount=None, local_vars_configuration=None): # noqa: E501 # type: (str, str, str, Configuration) -> None @@ -131,16 +139,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/max_uni_borrowable.py b/gate_api/models/max_uni_borrowable.py new file mode 100644 index 0000000..5ac2d09 --- /dev/null +++ b/gate_api/models/max_uni_borrowable.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 MaxUniBorrowable(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'currency_pair': 'str', + 'borrowable': 'str' + } + + attribute_map = { + 'currency': 'currency', + 'currency_pair': 'currency_pair', + 'borrowable': 'borrowable' + } + + def __init__(self, currency=None, currency_pair=None, borrowable=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, Configuration) -> None + """MaxUniBorrowable - a 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._currency_pair = None + self._borrowable = None + self.discriminator = None + + self.currency = currency + if currency_pair is not None: + self.currency_pair = currency_pair + self.borrowable = borrowable + + @property + def currency(self): + """Gets the currency of this MaxUniBorrowable. # noqa: E501 + + Currency # noqa: E501 + + :return: The currency of this MaxUniBorrowable. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this MaxUniBorrowable. + + Currency # noqa: E501 + + :param currency: The currency of this MaxUniBorrowable. # 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 currency_pair(self): + """Gets the currency_pair of this MaxUniBorrowable. # noqa: E501 + + Currency pair # noqa: E501 + + :return: The currency_pair of this MaxUniBorrowable. # noqa: E501 + :rtype: str + """ + return self._currency_pair + + @currency_pair.setter + def currency_pair(self, currency_pair): + """Sets the currency_pair of this MaxUniBorrowable. + + Currency pair # noqa: E501 + + :param currency_pair: The currency_pair of this MaxUniBorrowable. # noqa: E501 + :type: str + """ + + self._currency_pair = currency_pair + + @property + def borrowable(self): + """Gets the borrowable of this MaxUniBorrowable. # noqa: E501 + + Maximum borrowable # noqa: E501 + + :return: The borrowable of this MaxUniBorrowable. # noqa: E501 + :rtype: str + """ + return self._borrowable + + @borrowable.setter + def borrowable(self, borrowable): + """Sets the borrowable of this MaxUniBorrowable. + + Maximum borrowable # noqa: E501 + + :param borrowable: The borrowable of this MaxUniBorrowable. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and borrowable is None: # noqa: E501 + raise ValueError("Invalid value for `borrowable`, must not be `None`") # noqa: E501 + + self._borrowable = borrowable + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MaxUniBorrowable): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, MaxUniBorrowable): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/mock_futures_order.py b/gate_api/models/mock_futures_order.py new file mode 100644 index 0000000..3adadb8 --- /dev/null +++ b/gate_api/models/mock_futures_order.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 MockFuturesOrder(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'left': 'str' + } + + attribute_map = { + 'contract': 'contract', + 'size': 'size', + 'left': 'left' + } + + def __init__(self, contract=None, size=None, left=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, Configuration) -> None + """MockFuturesOrder - a 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._left = None + self.discriminator = None + + self.contract = contract + self.size = size + self.left = left + + @property + 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 + + :return: The contract of this MockFuturesOrder. # noqa: E501 + :rtype: str + """ + return self._contract + + @contract.setter + def contract(self, contract): + """Sets the contract of this MockFuturesOrder. + + Futures name, currently only supports USDT perpetual contracts for BTC and ETH # noqa: E501 + + :param contract: The contract of this MockFuturesOrder. # 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 MockFuturesOrder. # noqa: E501 + + Contract quantity, representing the initial order quantity, not involved in actual settlement # noqa: E501 + + :return: The size of this MockFuturesOrder. # noqa: E501 + :rtype: str + """ + return self._size + + @size.setter + def size(self, size): + """Sets the size of this MockFuturesOrder. + + Contract quantity, representing the initial order quantity, not involved in actual settlement # noqa: E501 + + :param size: The size of this MockFuturesOrder. # 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 left(self): + """Gets the left of this MockFuturesOrder. # noqa: E501 + + Unfilled contract quantity, involved in actual calculation # noqa: E501 + + :return: The left of this MockFuturesOrder. # noqa: E501 + :rtype: str + """ + return self._left + + @left.setter + def left(self, left): + """Sets the left of this MockFuturesOrder. + + Unfilled contract quantity, involved in actual calculation # noqa: E501 + + :param left: The left of this MockFuturesOrder. # 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, MockFuturesOrder): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, MockFuturesOrder): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/mock_futures_position.py b/gate_api/models/mock_futures_position.py new file mode 100644 index 0000000..158c6a7 --- /dev/null +++ b/gate_api/models/mock_futures_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 MockFuturesPosition(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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' + } + + attribute_map = { + 'contract': 'contract', + 'size': 'size' + } + + def __init__(self, contract=None, size=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """MockFuturesPosition - a 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.discriminator = None + + self.contract = contract + self.size = size + + @property + 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 + + :return: The contract of this MockFuturesPosition. # noqa: E501 + :rtype: str + """ + return self._contract + + @contract.setter + def contract(self, contract): + """Sets the contract of this MockFuturesPosition. + + Futures name, currently only supports USDT perpetual contracts for BTC and ETH # noqa: E501 + + :param contract: The contract of this MockFuturesPosition. # 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 MockFuturesPosition. # noqa: E501 + + Position size, measured in contract quantity # noqa: E501 + + :return: The size of this MockFuturesPosition. # noqa: E501 + :rtype: str + """ + return self._size + + @size.setter + def size(self, size): + """Sets the size of this MockFuturesPosition. + + Position size, measured in contract quantity # noqa: E501 + + :param size: The size of this MockFuturesPosition. # 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 + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MockFuturesPosition): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, MockFuturesPosition): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/mock_margin_result.py b/gate_api/models/mock_margin_result.py new file mode 100644 index 0000000..7181f58 --- /dev/null +++ b/gate_api/models/mock_margin_result.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 MockMarginResult(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'profit_loss_ranges': 'list[ProfitLossRange]', + 'max_loss': 'ProfitLossRange', + 'mr1': 'str', + 'mr2': 'str', + 'mr3': 'str', + 'mr4': 'str' + } + + attribute_map = { + 'type': 'type', + 'profit_loss_ranges': 'profit_loss_ranges', + 'max_loss': 'max_loss', + 'mr1': 'mr1', + 'mr2': 'mr2', + 'mr3': 'mr3', + 'mr4': 'mr4' + } + + def __init__(self, type=None, profit_loss_ranges=None, max_loss=None, mr1=None, mr2=None, mr3=None, mr4=None, local_vars_configuration=None): # noqa: E501 + # type: (str, list[ProfitLossRange], ProfitLossRange, str, str, str, str, Configuration) -> None + """MockMarginResult - a 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._profit_loss_ranges = None + self._max_loss = None + self._mr1 = None + self._mr2 = None + self._mr3 = None + self._mr4 = None + self.discriminator = None + + if type is not None: + self.type = type + if profit_loss_ranges is not None: + self.profit_loss_ranges = profit_loss_ranges + if max_loss is not None: + self.max_loss = max_loss + if mr1 is not None: + self.mr1 = mr1 + if mr2 is not None: + self.mr2 = mr2 + if mr3 is not None: + self.mr3 = mr3 + if mr4 is not None: + self.mr4 = mr4 + + @property + def type(self): + """Gets the type of this MockMarginResult. # noqa: E501 + + Position combination type `original_position` - Original position `long_delta_original_position` - Positive delta + Original position `short_delta_original_position` - Negative delta + Original position # noqa: E501 + + :return: The type of this MockMarginResult. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this MockMarginResult. + + Position combination type `original_position` - Original position `long_delta_original_position` - Positive delta + Original position `short_delta_original_position` - Negative delta + Original position # noqa: E501 + + :param type: The type of this MockMarginResult. # noqa: E501 + :type: str + """ + + self._type = type + + @property + def profit_loss_ranges(self): + """Gets the profit_loss_ranges of this MockMarginResult. # noqa: E501 + + Results of 33 stress scenarios for MR1 # noqa: E501 + + :return: The profit_loss_ranges of this MockMarginResult. # noqa: E501 + :rtype: list[ProfitLossRange] + """ + return self._profit_loss_ranges + + @profit_loss_ranges.setter + def profit_loss_ranges(self, profit_loss_ranges): + """Sets the profit_loss_ranges of this MockMarginResult. + + Results of 33 stress scenarios for MR1 # noqa: E501 + + :param profit_loss_ranges: The profit_loss_ranges of this MockMarginResult. # noqa: E501 + :type: list[ProfitLossRange] + """ + + self._profit_loss_ranges = profit_loss_ranges + + @property + def max_loss(self): + """Gets the max_loss of this MockMarginResult. # noqa: E501 + + 最大损失 # noqa: E501 + + :return: The max_loss of this MockMarginResult. # noqa: E501 + :rtype: ProfitLossRange + """ + return self._max_loss + + @max_loss.setter + def max_loss(self, max_loss): + """Sets the max_loss of this MockMarginResult. + + 最大损失 # noqa: E501 + + :param max_loss: The max_loss of this MockMarginResult. # noqa: E501 + :type: ProfitLossRange + """ + + self._max_loss = max_loss + + @property + def mr1(self): + """Gets the mr1 of this MockMarginResult. # noqa: E501 + + Stress testing # noqa: E501 + + :return: The mr1 of this MockMarginResult. # noqa: E501 + :rtype: str + """ + return self._mr1 + + @mr1.setter + def mr1(self, mr1): + """Sets the mr1 of this MockMarginResult. + + Stress testing # noqa: E501 + + :param mr1: The mr1 of this MockMarginResult. # noqa: E501 + :type: str + """ + + self._mr1 = mr1 + + @property + def mr2(self): + """Gets the mr2 of this MockMarginResult. # noqa: E501 + + Basis spread risk # noqa: E501 + + :return: The mr2 of this MockMarginResult. # noqa: E501 + :rtype: str + """ + return self._mr2 + + @mr2.setter + def mr2(self, mr2): + """Sets the mr2 of this MockMarginResult. + + Basis spread risk # noqa: E501 + + :param mr2: The mr2 of this MockMarginResult. # noqa: E501 + :type: str + """ + + self._mr2 = mr2 + + @property + def mr3(self): + """Gets the mr3 of this MockMarginResult. # noqa: E501 + + Volatility spread risk # noqa: E501 + + :return: The mr3 of this MockMarginResult. # noqa: E501 + :rtype: str + """ + return self._mr3 + + @mr3.setter + def mr3(self, mr3): + """Sets the mr3 of this MockMarginResult. + + Volatility spread risk # noqa: E501 + + :param mr3: The mr3 of this MockMarginResult. # noqa: E501 + :type: str + """ + + self._mr3 = mr3 + + @property + def mr4(self): + """Gets the mr4 of this MockMarginResult. # noqa: E501 + + Option short risk # noqa: E501 + + :return: The mr4 of this MockMarginResult. # noqa: E501 + :rtype: str + """ + return self._mr4 + + @mr4.setter + def mr4(self, mr4): + """Sets the mr4 of this MockMarginResult. + + Option short risk # noqa: E501 + + :param mr4: The mr4 of this MockMarginResult. # noqa: E501 + :type: str + """ + + self._mr4 = mr4 + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MockMarginResult): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, MockMarginResult): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/mock_options_order.py b/gate_api/models/mock_options_order.py new file mode 100644 index 0000000..7a5193c --- /dev/null +++ b/gate_api/models/mock_options_order.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 MockOptionsOrder(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'options_name': 'str', + 'size': 'str', + 'left': 'str' + } + + attribute_map = { + 'options_name': 'options_name', + 'size': 'size', + 'left': 'left' + } + + def __init__(self, options_name=None, size=None, left=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, Configuration) -> None + """MockOptionsOrder - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._options_name = None + self._size = None + self._left = None + self.discriminator = None + + self.options_name = options_name + self.size = size + self.left = left + + @property + 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 + + :return: The options_name of this MockOptionsOrder. # noqa: E501 + :rtype: str + """ + return self._options_name + + @options_name.setter + 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 + + :param options_name: The options_name of this MockOptionsOrder. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and options_name is None: # noqa: E501 + raise ValueError("Invalid value for `options_name`, must not be `None`") # noqa: E501 + + self._options_name = options_name + + @property + def size(self): + """Gets the size of this MockOptionsOrder. # noqa: E501 + + Initial order quantity, not involved in actual calculation # noqa: E501 + + :return: The size of this MockOptionsOrder. # noqa: E501 + :rtype: str + """ + return self._size + + @size.setter + def size(self, size): + """Sets the size of this MockOptionsOrder. + + Initial order quantity, not involved in actual calculation # noqa: E501 + + :param size: The size of this MockOptionsOrder. # 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 left(self): + """Gets the left of this MockOptionsOrder. # noqa: E501 + + Unfilled contract quantity, involved in actual calculation # noqa: E501 + + :return: The left of this MockOptionsOrder. # noqa: E501 + :rtype: str + """ + return self._left + + @left.setter + def left(self, left): + """Sets the left of this MockOptionsOrder. + + Unfilled contract quantity, involved in actual calculation # noqa: E501 + + :param left: The left of this MockOptionsOrder. # 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, MockOptionsOrder): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, MockOptionsOrder): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/mock_options_position.py b/gate_api/models/mock_options_position.py new file mode 100644 index 0000000..3d27436 --- /dev/null +++ b/gate_api/models/mock_options_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 MockOptionsPosition(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'options_name': 'str', + 'size': 'str' + } + + attribute_map = { + 'options_name': 'options_name', + 'size': 'size' + } + + def __init__(self, options_name=None, size=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """MockOptionsPosition - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._options_name = None + self._size = None + self.discriminator = None + + self.options_name = options_name + self.size = size + + @property + 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 + + :return: The options_name of this MockOptionsPosition. # noqa: E501 + :rtype: str + """ + return self._options_name + + @options_name.setter + 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 + + :param options_name: The options_name of this MockOptionsPosition. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and options_name is None: # noqa: E501 + raise ValueError("Invalid value for `options_name`, must not be `None`") # noqa: E501 + + self._options_name = options_name + + @property + def size(self): + """Gets the size of this MockOptionsPosition. # noqa: E501 + + Position size, measured in contract quantity # noqa: E501 + + :return: The size of this MockOptionsPosition. # noqa: E501 + :rtype: str + """ + return self._size + + @size.setter + def size(self, size): + """Sets the size of this MockOptionsPosition. + + Position size, measured in contract quantity # noqa: E501 + + :param size: The size of this MockOptionsPosition. # 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 + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MockOptionsPosition): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, MockOptionsPosition): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/mock_risk_unit.py b/gate_api/models/mock_risk_unit.py new file mode 100644 index 0000000..7ae22d4 --- /dev/null +++ b/gate_api/models/mock_risk_unit.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 MockRiskUnit(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'spot_in_use': 'str', + 'maintain_margin': 'str', + 'initial_margin': 'str', + 'margin_result': 'list[MockMarginResult]', + 'delta': 'str', + 'gamma': 'str', + 'theta': 'str', + 'vega': 'str' + } + + attribute_map = { + 'symbol': 'symbol', + 'spot_in_use': 'spot_in_use', + 'maintain_margin': 'maintain_margin', + 'initial_margin': 'initial_margin', + 'margin_result': 'margin_result', + 'delta': 'delta', + 'gamma': 'gamma', + 'theta': 'theta', + 'vega': 'vega' + } + + def __init__(self, symbol=None, spot_in_use=None, maintain_margin=None, initial_margin=None, margin_result=None, delta=None, gamma=None, theta=None, vega=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, list[MockMarginResult], str, str, str, str, Configuration) -> None + """MockRiskUnit - a 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._spot_in_use = None + self._maintain_margin = None + self._initial_margin = None + self._margin_result = None + self._delta = None + self._gamma = None + self._theta = None + self._vega = None + self.discriminator = None + + if symbol is not None: + self.symbol = symbol + if spot_in_use is not None: + self.spot_in_use = spot_in_use + if maintain_margin is not None: + self.maintain_margin = maintain_margin + if initial_margin is not None: + self.initial_margin = initial_margin + if margin_result is not None: + self.margin_result = margin_result + if delta is not None: + self.delta = delta + if gamma is not None: + self.gamma = gamma + if theta is not None: + self.theta = theta + if vega is not None: + self.vega = vega + + @property + def symbol(self): + """Gets the symbol of this MockRiskUnit. # noqa: E501 + + Risk unit name # noqa: E501 + + :return: The symbol of this MockRiskUnit. # noqa: E501 + :rtype: str + """ + return self._symbol + + @symbol.setter + def symbol(self, symbol): + """Sets the symbol of this MockRiskUnit. + + Risk unit name # noqa: E501 + + :param symbol: The symbol of this MockRiskUnit. # noqa: E501 + :type: str + """ + + self._symbol = symbol + + @property + def spot_in_use(self): + """Gets the spot_in_use of this MockRiskUnit. # noqa: E501 + + Spot hedge usage # noqa: E501 + + :return: The spot_in_use of this MockRiskUnit. # noqa: E501 + :rtype: str + """ + return self._spot_in_use + + @spot_in_use.setter + def spot_in_use(self, spot_in_use): + """Sets the spot_in_use of this MockRiskUnit. + + Spot hedge usage # noqa: E501 + + :param spot_in_use: The spot_in_use of this MockRiskUnit. # noqa: E501 + :type: str + """ + + self._spot_in_use = spot_in_use + + @property + def maintain_margin(self): + """Gets the maintain_margin of this MockRiskUnit. # noqa: E501 + + Maintenance margin # noqa: E501 + + :return: The maintain_margin of this MockRiskUnit. # noqa: E501 + :rtype: str + """ + return self._maintain_margin + + @maintain_margin.setter + def maintain_margin(self, maintain_margin): + """Sets the maintain_margin of this MockRiskUnit. + + Maintenance margin # noqa: E501 + + :param maintain_margin: The maintain_margin of this MockRiskUnit. # noqa: E501 + :type: str + """ + + self._maintain_margin = maintain_margin + + @property + def initial_margin(self): + """Gets the initial_margin of this MockRiskUnit. # noqa: E501 + + Initial margin # noqa: E501 + + :return: The initial_margin of this MockRiskUnit. # noqa: E501 + :rtype: str + """ + return self._initial_margin + + @initial_margin.setter + def initial_margin(self, initial_margin): + """Sets the initial_margin of this MockRiskUnit. + + Initial margin # noqa: E501 + + :param initial_margin: The initial_margin of this MockRiskUnit. # noqa: E501 + :type: str + """ + + self._initial_margin = initial_margin + + @property + def margin_result(self): + """Gets the margin_result of this MockRiskUnit. # noqa: E501 + + Margin result # noqa: E501 + + :return: The margin_result of this MockRiskUnit. # noqa: E501 + :rtype: list[MockMarginResult] + """ + return self._margin_result + + @margin_result.setter + def margin_result(self, margin_result): + """Sets the margin_result of this MockRiskUnit. + + Margin result # noqa: E501 + + :param margin_result: The margin_result of this MockRiskUnit. # noqa: E501 + :type: list[MockMarginResult] + """ + + self._margin_result = margin_result + + @property + def delta(self): + """Gets the delta of this MockRiskUnit. # noqa: E501 + + Total Delta of risk unit # noqa: E501 + + :return: The delta of this MockRiskUnit. # noqa: E501 + :rtype: str + """ + return self._delta + + @delta.setter + def delta(self, delta): + """Sets the delta of this MockRiskUnit. + + Total Delta of risk unit # noqa: E501 + + :param delta: The delta of this MockRiskUnit. # noqa: E501 + :type: str + """ + + self._delta = delta + + @property + def gamma(self): + """Gets the gamma of this MockRiskUnit. # noqa: E501 + + Total Gamma of risk unit # noqa: E501 + + :return: The gamma of this MockRiskUnit. # noqa: E501 + :rtype: str + """ + return self._gamma + + @gamma.setter + def gamma(self, gamma): + """Sets the gamma of this MockRiskUnit. + + Total Gamma of risk unit # noqa: E501 + + :param gamma: The gamma of this MockRiskUnit. # noqa: E501 + :type: str + """ + + self._gamma = gamma + + @property + def theta(self): + """Gets the theta of this MockRiskUnit. # noqa: E501 + + Total Theta of risk unit # noqa: E501 + + :return: The theta of this MockRiskUnit. # noqa: E501 + :rtype: str + """ + return self._theta + + @theta.setter + def theta(self, theta): + """Sets the theta of this MockRiskUnit. + + Total Theta of risk unit # noqa: E501 + + :param theta: The theta of this MockRiskUnit. # noqa: E501 + :type: str + """ + + self._theta = theta + + @property + def vega(self): + """Gets the vega of this MockRiskUnit. # noqa: E501 + + Total Vega of risk unit # noqa: E501 + + :return: The vega of this MockRiskUnit. # noqa: E501 + :rtype: str + """ + return self._vega + + @vega.setter + def vega(self, vega): + """Sets the vega of this MockRiskUnit. + + Total Vega of risk unit # noqa: E501 + + :param vega: The vega of this MockRiskUnit. # noqa: E501 + :type: str + """ + + self._vega = vega + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MockRiskUnit): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, MockRiskUnit): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/mock_spot_balance.py b/gate_api/models/mock_spot_balance.py new file mode 100644 index 0000000..721cf0b --- /dev/null +++ b/gate_api/models/mock_spot_balance.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 MockSpotBalance(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'equity': 'str' + } + + attribute_map = { + 'currency': 'currency', + 'equity': 'equity' + } + + def __init__(self, currency=None, equity=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """MockSpotBalance - a 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._equity = None + self.discriminator = None + + self.currency = currency + self.equity = equity + + @property + def currency(self): + """Gets the currency of this MockSpotBalance. # noqa: E501 + + Currency name # noqa: E501 + + :return: The currency of this MockSpotBalance. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this MockSpotBalance. + + Currency name # noqa: E501 + + :param currency: The currency of this MockSpotBalance. # 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 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 + + :return: The equity of this MockSpotBalance. # noqa: E501 + :rtype: str + """ + return self._equity + + @equity.setter + 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 + + :param equity: The equity of this MockSpotBalance. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and equity is None: # noqa: E501 + raise ValueError("Invalid value for `equity`, must not be `None`") # noqa: E501 + + self._equity = equity + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MockSpotBalance): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, MockSpotBalance): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/mock_spot_order.py b/gate_api/models/mock_spot_order.py new file mode 100644 index 0000000..d8f70cb --- /dev/null +++ b/gate_api/models/mock_spot_order.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 MockSpotOrder(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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_pairs': 'str', + 'order_price': 'str', + 'count': 'str', + 'left': 'str', + 'type': 'str' + } + + attribute_map = { + 'currency_pairs': 'currency_pairs', + 'order_price': 'order_price', + 'count': 'count', + 'left': 'left', + 'type': 'type' + } + + def __init__(self, currency_pairs=None, order_price=None, count=None, left=None, type=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, Configuration) -> None + """MockSpotOrder - a 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_pairs = None + self._order_price = None + self._count = None + self._left = None + self._type = None + self.discriminator = None + + self.currency_pairs = currency_pairs + self.order_price = order_price + if count is not None: + self.count = count + self.left = left + self.type = type + + @property + def currency_pairs(self): + """Gets the currency_pairs of this MockSpotOrder. # noqa: E501 + + Market # noqa: E501 + + :return: The currency_pairs of this MockSpotOrder. # noqa: E501 + :rtype: str + """ + return self._currency_pairs + + @currency_pairs.setter + def currency_pairs(self, currency_pairs): + """Sets the currency_pairs of this MockSpotOrder. + + Market # noqa: E501 + + :param currency_pairs: The currency_pairs of this MockSpotOrder. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and currency_pairs is None: # noqa: E501 + raise ValueError("Invalid value for `currency_pairs`, must not be `None`") # noqa: E501 + + self._currency_pairs = currency_pairs + + @property + def order_price(self): + """Gets the order_price of this MockSpotOrder. # noqa: E501 + + Price # noqa: E501 + + :return: The order_price of this MockSpotOrder. # noqa: E501 + :rtype: str + """ + return self._order_price + + @order_price.setter + def order_price(self, order_price): + """Sets the order_price of this MockSpotOrder. + + Price # noqa: E501 + + :param order_price: The order_price of this MockSpotOrder. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and order_price is None: # noqa: E501 + raise ValueError("Invalid value for `order_price`, must not be `None`") # noqa: E501 + + self._order_price = order_price + + @property + 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 + + :return: The count of this MockSpotOrder. # noqa: E501 + :rtype: str + """ + return self._count + + @count.setter + 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 + + :param count: The count of this MockSpotOrder. # noqa: E501 + :type: str + """ + + self._count = count + + @property + def left(self): + """Gets the left of this MockSpotOrder. # noqa: E501 + + Unfilled quantity, involved in actual calculation # noqa: E501 + + :return: The left of this MockSpotOrder. # noqa: E501 + :rtype: str + """ + return self._left + + @left.setter + def left(self, left): + """Sets the left of this MockSpotOrder. + + Unfilled quantity, involved in actual calculation # noqa: E501 + + :param left: The left of this MockSpotOrder. # 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 type(self): + """Gets the type of this MockSpotOrder. # noqa: E501 + + Order type, sell - sell order, buy - buy order # noqa: E501 + + :return: The type of this MockSpotOrder. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this MockSpotOrder. + + Order type, sell - sell order, buy - buy order # noqa: E501 + + :param type: The type of this MockSpotOrder. # 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, MockSpotOrder): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, MockSpotOrder): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/multi_chain_address_item.py b/gate_api/models/multi_chain_address_item.py index 64149d1..a18243c 100644 --- a/gate_api/models/multi_chain_address_item.py +++ b/gate_api/models/multi_chain_address_item.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -37,7 +37,7 @@ class MultiChainAddressItem(object): 'address': 'str', 'payment_id': 'str', 'payment_name': 'str', - 'obtain_failed': 'int', + 'obtain_failed': 'int' } attribute_map = { @@ -45,18 +45,10 @@ class MultiChainAddressItem(object): 'address': 'address', 'payment_id': 'payment_id', 'payment_name': 'payment_name', - 'obtain_failed': 'obtain_failed', + 'obtain_failed': 'obtain_failed' } - def __init__( - self, - chain=None, - address=None, - payment_id=None, - payment_name=None, - obtain_failed=None, - local_vars_configuration=None, - ): # noqa: E501 + def __init__(self, chain=None, address=None, payment_id=None, payment_name=None, obtain_failed=None, local_vars_configuration=None): # noqa: E501 # type: (str, str, str, str, int, Configuration) -> None """MultiChainAddressItem - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: @@ -203,16 +195,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/multi_collateral_currency.py b/gate_api/models/multi_collateral_currency.py new file mode 100644 index 0000000..95e5482 --- /dev/null +++ b/gate_api/models/multi_collateral_currency.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 MultiCollateralCurrency(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'loan_currencies': 'list[MultiLoanItem]', + 'collateral_currencies': 'list[MultiCollateralItem]' + } + + attribute_map = { + 'loan_currencies': 'loan_currencies', + 'collateral_currencies': 'collateral_currencies' + } + + def __init__(self, loan_currencies=None, collateral_currencies=None, local_vars_configuration=None): # noqa: E501 + # type: (list[MultiLoanItem], list[MultiCollateralItem], Configuration) -> None + """MultiCollateralCurrency - a 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_currencies = None + self._collateral_currencies = None + self.discriminator = None + + if loan_currencies is not None: + self.loan_currencies = loan_currencies + if collateral_currencies is not None: + self.collateral_currencies = collateral_currencies + + @property + def loan_currencies(self): + """Gets the loan_currencies of this MultiCollateralCurrency. # noqa: E501 + + List of supported borrowing currencies # noqa: E501 + + :return: The loan_currencies of this MultiCollateralCurrency. # noqa: E501 + :rtype: list[MultiLoanItem] + """ + return self._loan_currencies + + @loan_currencies.setter + def loan_currencies(self, loan_currencies): + """Sets the loan_currencies of this MultiCollateralCurrency. + + List of supported borrowing currencies # noqa: E501 + + :param loan_currencies: The loan_currencies of this MultiCollateralCurrency. # noqa: E501 + :type: list[MultiLoanItem] + """ + + self._loan_currencies = loan_currencies + + @property + def collateral_currencies(self): + """Gets the collateral_currencies of this MultiCollateralCurrency. # noqa: E501 + + List of supported collateral currencies # noqa: E501 + + :return: The collateral_currencies of this MultiCollateralCurrency. # noqa: E501 + :rtype: list[MultiCollateralItem] + """ + return self._collateral_currencies + + @collateral_currencies.setter + def collateral_currencies(self, collateral_currencies): + """Sets the collateral_currencies of this MultiCollateralCurrency. + + List of supported collateral currencies # noqa: E501 + + :param collateral_currencies: The collateral_currencies of this MultiCollateralCurrency. # noqa: E501 + :type: list[MultiCollateralItem] + """ + + self._collateral_currencies = collateral_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, MultiCollateralCurrency): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, MultiCollateralCurrency): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/multi_collateral_item.py b/gate_api/models/multi_collateral_item.py new file mode 100644 index 0000000..82cd1e4 --- /dev/null +++ b/gate_api/models/multi_collateral_item.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 MultiCollateralItem(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'index_price': 'str', + 'discount': 'str' + } + + attribute_map = { + 'currency': 'currency', + 'index_price': 'index_price', + 'discount': 'discount' + } + + def __init__(self, currency=None, index_price=None, discount=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, Configuration) -> None + """MultiCollateralItem - a 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._index_price = None + self._discount = None + self.discriminator = None + + if currency is not None: + self.currency = currency + if index_price is not None: + self.index_price = index_price + if discount is not None: + self.discount = discount + + @property + def currency(self): + """Gets the currency of this MultiCollateralItem. # noqa: E501 + + Currency # noqa: E501 + + :return: The currency of this MultiCollateralItem. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this MultiCollateralItem. + + Currency # noqa: E501 + + :param currency: The currency of this MultiCollateralItem. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def index_price(self): + """Gets the index_price of this MultiCollateralItem. # noqa: E501 + + Currency Index Price # noqa: E501 + + :return: The index_price of this MultiCollateralItem. # noqa: E501 + :rtype: str + """ + return self._index_price + + @index_price.setter + def index_price(self, index_price): + """Sets the index_price of this MultiCollateralItem. + + Currency Index Price # noqa: E501 + + :param index_price: The index_price of this MultiCollateralItem. # noqa: E501 + :type: str + """ + + self._index_price = index_price + + @property + def discount(self): + """Gets the discount of this MultiCollateralItem. # noqa: E501 + + Discount # noqa: E501 + + :return: The discount of this MultiCollateralItem. # noqa: E501 + :rtype: str + """ + return self._discount + + @discount.setter + def discount(self, discount): + """Sets the discount of this MultiCollateralItem. + + Discount # noqa: E501 + + :param discount: The discount of this MultiCollateralItem. # noqa: E501 + :type: str + """ + + self._discount = discount + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MultiCollateralItem): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, MultiCollateralItem): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/multi_collateral_order.py b/gate_api/models/multi_collateral_order.py new file mode 100644 index 0000000..24365fa --- /dev/null +++ b/gate_api/models/multi_collateral_order.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 MultiCollateralOrder(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'order_type': 'str', + 'fixed_type': 'str', + 'fixed_rate': 'str', + 'expire_time': 'int', + 'auto_renew': 'bool', + 'auto_repay': 'bool', + 'current_ltv': 'str', + 'status': 'str', + 'borrow_time': 'int', + 'total_left_repay_usdt': 'str', + 'total_left_collateral_usdt': 'str', + 'borrow_currencies': 'list[BorrowCurrencyInfo]', + 'collateral_currencies': 'list[CollateralCurrencyInfo]' + } + + attribute_map = { + 'order_id': 'order_id', + 'order_type': 'order_type', + 'fixed_type': 'fixed_type', + 'fixed_rate': 'fixed_rate', + 'expire_time': 'expire_time', + 'auto_renew': 'auto_renew', + 'auto_repay': 'auto_repay', + 'current_ltv': 'current_ltv', + 'status': 'status', + 'borrow_time': 'borrow_time', + 'total_left_repay_usdt': 'total_left_repay_usdt', + 'total_left_collateral_usdt': 'total_left_collateral_usdt', + 'borrow_currencies': 'borrow_currencies', + 'collateral_currencies': 'collateral_currencies' + } + + def __init__(self, order_id=None, order_type=None, fixed_type=None, fixed_rate=None, expire_time=None, auto_renew=None, auto_repay=None, current_ltv=None, status=None, borrow_time=None, total_left_repay_usdt=None, total_left_collateral_usdt=None, borrow_currencies=None, collateral_currencies=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, int, bool, bool, str, str, int, str, str, list[BorrowCurrencyInfo], list[CollateralCurrencyInfo], Configuration) -> None + """MultiCollateralOrder - a 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._order_type = None + self._fixed_type = None + self._fixed_rate = None + self._expire_time = None + self._auto_renew = None + self._auto_repay = None + self._current_ltv = None + self._status = None + self._borrow_time = None + self._total_left_repay_usdt = None + self._total_left_collateral_usdt = None + self._borrow_currencies = None + self._collateral_currencies = None + self.discriminator = None + + if order_id is not None: + self.order_id = order_id + if order_type is not None: + self.order_type = order_type + if fixed_type is not None: + self.fixed_type = fixed_type + if fixed_rate is not None: + self.fixed_rate = fixed_rate + if expire_time is not None: + self.expire_time = expire_time + if auto_renew is not None: + self.auto_renew = auto_renew + if auto_repay is not None: + self.auto_repay = auto_repay + if current_ltv is not None: + self.current_ltv = current_ltv + if status is not None: + self.status = status + if borrow_time is not None: + self.borrow_time = borrow_time + if total_left_repay_usdt is not None: + self.total_left_repay_usdt = total_left_repay_usdt + if total_left_collateral_usdt is not None: + self.total_left_collateral_usdt = total_left_collateral_usdt + if borrow_currencies is not None: + self.borrow_currencies = borrow_currencies + if collateral_currencies is not None: + self.collateral_currencies = collateral_currencies + + @property + def order_id(self): + """Gets the order_id of this MultiCollateralOrder. # noqa: E501 + + Order ID # noqa: E501 + + :return: The order_id of this MultiCollateralOrder. # noqa: E501 + :rtype: str + """ + return self._order_id + + @order_id.setter + def order_id(self, order_id): + """Sets the order_id of this MultiCollateralOrder. + + Order ID # noqa: E501 + + :param order_id: The order_id of this MultiCollateralOrder. # noqa: E501 + :type: str + """ + + self._order_id = order_id + + @property + def order_type(self): + """Gets the order_type of this MultiCollateralOrder. # noqa: E501 + + current - current, fixed - fixed # noqa: E501 + + :return: The order_type of this MultiCollateralOrder. # noqa: E501 + :rtype: str + """ + return self._order_type + + @order_type.setter + def order_type(self, order_type): + """Sets the order_type of this MultiCollateralOrder. + + current - current, fixed - fixed # noqa: E501 + + :param order_type: The order_type of this MultiCollateralOrder. # noqa: E501 + :type: str + """ + + self._order_type = order_type + + @property + def fixed_type(self): + """Gets the fixed_type of this MultiCollateralOrder. # noqa: E501 + + Fixed interest rate loan periods: 7d - 7 days, 30d - 30 days # noqa: E501 + + :return: The fixed_type of this MultiCollateralOrder. # noqa: E501 + :rtype: str + """ + return self._fixed_type + + @fixed_type.setter + def fixed_type(self, fixed_type): + """Sets the fixed_type of this MultiCollateralOrder. + + Fixed interest rate loan periods: 7d - 7 days, 30d - 30 days # noqa: E501 + + :param fixed_type: The fixed_type of this MultiCollateralOrder. # noqa: E501 + :type: str + """ + + self._fixed_type = fixed_type + + @property + def fixed_rate(self): + """Gets the fixed_rate of this MultiCollateralOrder. # noqa: E501 + + Fixed interest rate # noqa: E501 + + :return: The fixed_rate of this MultiCollateralOrder. # noqa: E501 + :rtype: str + """ + return self._fixed_rate + + @fixed_rate.setter + def fixed_rate(self, fixed_rate): + """Sets the fixed_rate of this MultiCollateralOrder. + + Fixed interest rate # noqa: E501 + + :param fixed_rate: The fixed_rate of this MultiCollateralOrder. # noqa: E501 + :type: str + """ + + self._fixed_rate = fixed_rate + + @property + def expire_time(self): + """Gets the expire_time of this MultiCollateralOrder. # noqa: E501 + + Expiration time, timestamp, unit in seconds # noqa: E501 + + :return: The expire_time of this MultiCollateralOrder. # noqa: E501 + :rtype: int + """ + return self._expire_time + + @expire_time.setter + def expire_time(self, expire_time): + """Sets the expire_time of this MultiCollateralOrder. + + Expiration time, timestamp, unit in seconds # noqa: E501 + + :param expire_time: The expire_time of this MultiCollateralOrder. # noqa: E501 + :type: int + """ + + self._expire_time = expire_time + + @property + def auto_renew(self): + """Gets the auto_renew of this MultiCollateralOrder. # noqa: E501 + + Fixed interest rate, auto-renewal # noqa: E501 + + :return: The auto_renew of this MultiCollateralOrder. # noqa: E501 + :rtype: bool + """ + return self._auto_renew + + @auto_renew.setter + def auto_renew(self, auto_renew): + """Sets the auto_renew of this MultiCollateralOrder. + + Fixed interest rate, auto-renewal # noqa: E501 + + :param auto_renew: The auto_renew of this MultiCollateralOrder. # noqa: E501 + :type: bool + """ + + self._auto_renew = auto_renew + + @property + def auto_repay(self): + """Gets the auto_repay of this MultiCollateralOrder. # noqa: E501 + + Fixed interest rate, auto-repayment # noqa: E501 + + :return: The auto_repay of this MultiCollateralOrder. # noqa: E501 + :rtype: bool + """ + return self._auto_repay + + @auto_repay.setter + def auto_repay(self, auto_repay): + """Sets the auto_repay of this MultiCollateralOrder. + + Fixed interest rate, auto-repayment # noqa: E501 + + :param auto_repay: The auto_repay of this MultiCollateralOrder. # noqa: E501 + :type: bool + """ + + self._auto_repay = auto_repay + + @property + def current_ltv(self): + """Gets the current_ltv of this MultiCollateralOrder. # noqa: E501 + + Current collateralization rate # noqa: E501 + + :return: The current_ltv of this MultiCollateralOrder. # noqa: E501 + :rtype: str + """ + return self._current_ltv + + @current_ltv.setter + def current_ltv(self, current_ltv): + """Sets the current_ltv of this MultiCollateralOrder. + + Current collateralization rate # noqa: E501 + + :param current_ltv: The current_ltv of this MultiCollateralOrder. # noqa: E501 + :type: str + """ + + self._current_ltv = current_ltv + + @property + def status(self): + """Gets the status of this MultiCollateralOrder. # 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 MultiCollateralOrder. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this MultiCollateralOrder. + + 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 MultiCollateralOrder. # noqa: E501 + :type: str + """ + + self._status = status + + @property + def borrow_time(self): + """Gets the borrow_time of this MultiCollateralOrder. # noqa: E501 + + Borrowing time, timestamp in seconds # noqa: E501 + + :return: The borrow_time of this MultiCollateralOrder. # noqa: E501 + :rtype: int + """ + return self._borrow_time + + @borrow_time.setter + def borrow_time(self, borrow_time): + """Sets the borrow_time of this MultiCollateralOrder. + + Borrowing time, timestamp in seconds # noqa: E501 + + :param borrow_time: The borrow_time of this MultiCollateralOrder. # noqa: E501 + :type: int + """ + + self._borrow_time = borrow_time + + @property + def total_left_repay_usdt(self): + """Gets the total_left_repay_usdt of this MultiCollateralOrder. # noqa: E501 + + Total outstanding value converted to USDT # noqa: E501 + + :return: The total_left_repay_usdt of this MultiCollateralOrder. # noqa: E501 + :rtype: str + """ + return self._total_left_repay_usdt + + @total_left_repay_usdt.setter + def total_left_repay_usdt(self, total_left_repay_usdt): + """Sets the total_left_repay_usdt of this MultiCollateralOrder. + + Total outstanding value converted to USDT # noqa: E501 + + :param total_left_repay_usdt: The total_left_repay_usdt of this MultiCollateralOrder. # noqa: E501 + :type: str + """ + + self._total_left_repay_usdt = total_left_repay_usdt + + @property + def total_left_collateral_usdt(self): + """Gets the total_left_collateral_usdt of this MultiCollateralOrder. # noqa: E501 + + Total collateral value converted to USDT # noqa: E501 + + :return: The total_left_collateral_usdt of this MultiCollateralOrder. # noqa: E501 + :rtype: str + """ + return self._total_left_collateral_usdt + + @total_left_collateral_usdt.setter + def total_left_collateral_usdt(self, total_left_collateral_usdt): + """Sets the total_left_collateral_usdt of this MultiCollateralOrder. + + Total collateral value converted to USDT # noqa: E501 + + :param total_left_collateral_usdt: The total_left_collateral_usdt of this MultiCollateralOrder. # noqa: E501 + :type: str + """ + + self._total_left_collateral_usdt = total_left_collateral_usdt + + @property + def borrow_currencies(self): + """Gets the borrow_currencies of this MultiCollateralOrder. # noqa: E501 + + Borrowing Currency List # noqa: E501 + + :return: The borrow_currencies of this MultiCollateralOrder. # noqa: E501 + :rtype: list[BorrowCurrencyInfo] + """ + return self._borrow_currencies + + @borrow_currencies.setter + def borrow_currencies(self, borrow_currencies): + """Sets the borrow_currencies of this MultiCollateralOrder. + + Borrowing Currency List # noqa: E501 + + :param borrow_currencies: The borrow_currencies of this MultiCollateralOrder. # noqa: E501 + :type: list[BorrowCurrencyInfo] + """ + + self._borrow_currencies = borrow_currencies + + @property + def collateral_currencies(self): + """Gets the collateral_currencies of this MultiCollateralOrder. # noqa: E501 + + Collateral Currency List # noqa: E501 + + :return: The collateral_currencies of this MultiCollateralOrder. # noqa: E501 + :rtype: list[CollateralCurrencyInfo] + """ + return self._collateral_currencies + + @collateral_currencies.setter + def collateral_currencies(self, collateral_currencies): + """Sets the collateral_currencies of this MultiCollateralOrder. + + Collateral Currency List # noqa: E501 + + :param collateral_currencies: The collateral_currencies of this MultiCollateralOrder. # noqa: E501 + :type: list[CollateralCurrencyInfo] + """ + + self._collateral_currencies = collateral_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, MultiCollateralOrder): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, MultiCollateralOrder): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/multi_collateral_record.py b/gate_api/models/multi_collateral_record.py new file mode 100644 index 0000000..a4bb4a3 --- /dev/null +++ b/gate_api/models/multi_collateral_record.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 MultiCollateralRecord(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'before_ltv': 'str', + 'after_ltv': 'str', + 'operate_time': 'int', + 'borrow_currencies': 'list[MultiCollateralRecordCurrency]', + 'collateral_currencies': 'list[MultiCollateralRecordCurrency]' + } + + attribute_map = { + 'order_id': 'order_id', + 'record_id': 'record_id', + 'before_ltv': 'before_ltv', + 'after_ltv': 'after_ltv', + 'operate_time': 'operate_time', + 'borrow_currencies': 'borrow_currencies', + 'collateral_currencies': 'collateral_currencies' + } + + def __init__(self, order_id=None, record_id=None, before_ltv=None, after_ltv=None, operate_time=None, borrow_currencies=None, collateral_currencies=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, str, str, int, list[MultiCollateralRecordCurrency], list[MultiCollateralRecordCurrency], Configuration) -> None + """MultiCollateralRecord - a 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._before_ltv = None + self._after_ltv = None + self._operate_time = None + self._borrow_currencies = None + self._collateral_currencies = 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 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 + if borrow_currencies is not None: + self.borrow_currencies = borrow_currencies + if collateral_currencies is not None: + self.collateral_currencies = collateral_currencies + + @property + def order_id(self): + """Gets the order_id of this MultiCollateralRecord. # noqa: E501 + + Order ID # noqa: E501 + + :return: The order_id of this MultiCollateralRecord. # noqa: E501 + :rtype: int + """ + return self._order_id + + @order_id.setter + def order_id(self, order_id): + """Sets the order_id of this MultiCollateralRecord. + + Order ID # noqa: E501 + + :param order_id: The order_id of this MultiCollateralRecord. # noqa: E501 + :type: int + """ + + self._order_id = order_id + + @property + def record_id(self): + """Gets the record_id of this MultiCollateralRecord. # noqa: E501 + + Collateral record ID # noqa: E501 + + :return: The record_id of this MultiCollateralRecord. # noqa: E501 + :rtype: int + """ + return self._record_id + + @record_id.setter + def record_id(self, record_id): + """Sets the record_id of this MultiCollateralRecord. + + Collateral record ID # noqa: E501 + + :param record_id: The record_id of this MultiCollateralRecord. # noqa: E501 + :type: int + """ + + self._record_id = record_id + + @property + def before_ltv(self): + """Gets the before_ltv of this MultiCollateralRecord. # noqa: E501 + + Collateral ratio before adjustment # noqa: E501 + + :return: The before_ltv of this MultiCollateralRecord. # noqa: E501 + :rtype: str + """ + return self._before_ltv + + @before_ltv.setter + def before_ltv(self, before_ltv): + """Sets the before_ltv of this MultiCollateralRecord. + + Collateral ratio before adjustment # noqa: E501 + + :param before_ltv: The before_ltv of this MultiCollateralRecord. # noqa: E501 + :type: str + """ + + self._before_ltv = before_ltv + + @property + def after_ltv(self): + """Gets the after_ltv of this MultiCollateralRecord. # noqa: E501 + + Collateral ratio before adjustment # noqa: E501 + + :return: The after_ltv of this MultiCollateralRecord. # noqa: E501 + :rtype: str + """ + return self._after_ltv + + @after_ltv.setter + def after_ltv(self, after_ltv): + """Sets the after_ltv of this MultiCollateralRecord. + + Collateral ratio before adjustment # noqa: E501 + + :param after_ltv: The after_ltv of this MultiCollateralRecord. # noqa: E501 + :type: str + """ + + self._after_ltv = after_ltv + + @property + def operate_time(self): + """Gets the operate_time of this MultiCollateralRecord. # noqa: E501 + + Operation time, timestamp in seconds # noqa: E501 + + :return: The operate_time of this MultiCollateralRecord. # noqa: E501 + :rtype: int + """ + return self._operate_time + + @operate_time.setter + def operate_time(self, operate_time): + """Sets the operate_time of this MultiCollateralRecord. + + Operation time, timestamp in seconds # noqa: E501 + + :param operate_time: The operate_time of this MultiCollateralRecord. # noqa: E501 + :type: int + """ + + self._operate_time = operate_time + + @property + def borrow_currencies(self): + """Gets the borrow_currencies of this MultiCollateralRecord. # noqa: E501 + + Borrowing Currency List # noqa: E501 + + :return: The borrow_currencies of this MultiCollateralRecord. # noqa: E501 + :rtype: list[MultiCollateralRecordCurrency] + """ + return self._borrow_currencies + + @borrow_currencies.setter + def borrow_currencies(self, borrow_currencies): + """Sets the borrow_currencies of this MultiCollateralRecord. + + Borrowing Currency List # noqa: E501 + + :param borrow_currencies: The borrow_currencies of this MultiCollateralRecord. # noqa: E501 + :type: list[MultiCollateralRecordCurrency] + """ + + self._borrow_currencies = borrow_currencies + + @property + def collateral_currencies(self): + """Gets the collateral_currencies of this MultiCollateralRecord. # noqa: E501 + + Collateral Currency List # noqa: E501 + + :return: The collateral_currencies of this MultiCollateralRecord. # noqa: E501 + :rtype: list[MultiCollateralRecordCurrency] + """ + return self._collateral_currencies + + @collateral_currencies.setter + def collateral_currencies(self, collateral_currencies): + """Sets the collateral_currencies of this MultiCollateralRecord. + + Collateral Currency List # noqa: E501 + + :param collateral_currencies: The collateral_currencies of this MultiCollateralRecord. # noqa: E501 + :type: list[MultiCollateralRecordCurrency] + """ + + self._collateral_currencies = collateral_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, MultiCollateralRecord): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, MultiCollateralRecord): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/multi_collateral_record_currency.py b/gate_api/models/multi_collateral_record_currency.py new file mode 100644 index 0000000..c585d49 --- /dev/null +++ b/gate_api/models/multi_collateral_record_currency.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 MultiCollateralRecordCurrency(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'index_price': 'str', + 'before_amount': 'str', + 'before_amount_usdt': 'str', + 'after_amount': 'str', + 'after_amount_usdt': 'str' + } + + attribute_map = { + 'currency': 'currency', + 'index_price': 'index_price', + 'before_amount': 'before_amount', + 'before_amount_usdt': 'before_amount_usdt', + 'after_amount': 'after_amount', + 'after_amount_usdt': 'after_amount_usdt' + } + + def __init__(self, currency=None, index_price=None, before_amount=None, before_amount_usdt=None, after_amount=None, after_amount_usdt=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, Configuration) -> None + """MultiCollateralRecordCurrency - a 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._index_price = None + self._before_amount = None + self._before_amount_usdt = None + self._after_amount = None + self._after_amount_usdt = None + self.discriminator = None + + if currency is not None: + self.currency = currency + if index_price is not None: + self.index_price = index_price + if before_amount is not None: + self.before_amount = before_amount + if before_amount_usdt is not None: + self.before_amount_usdt = before_amount_usdt + if after_amount is not None: + self.after_amount = after_amount + if after_amount_usdt is not None: + self.after_amount_usdt = after_amount_usdt + + @property + def currency(self): + """Gets the currency of this MultiCollateralRecordCurrency. # noqa: E501 + + Currency # noqa: E501 + + :return: The currency of this MultiCollateralRecordCurrency. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this MultiCollateralRecordCurrency. + + Currency # noqa: E501 + + :param currency: The currency of this MultiCollateralRecordCurrency. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def index_price(self): + """Gets the index_price of this MultiCollateralRecordCurrency. # noqa: E501 + + Currency Index Price # noqa: E501 + + :return: The index_price of this MultiCollateralRecordCurrency. # noqa: E501 + :rtype: str + """ + return self._index_price + + @index_price.setter + def index_price(self, index_price): + """Sets the index_price of this MultiCollateralRecordCurrency. + + Currency Index Price # noqa: E501 + + :param index_price: The index_price of this MultiCollateralRecordCurrency. # noqa: E501 + :type: str + """ + + self._index_price = index_price + + @property + def before_amount(self): + """Gets the before_amount of this MultiCollateralRecordCurrency. # noqa: E501 + + Amount before the operation # noqa: E501 + + :return: The before_amount of this MultiCollateralRecordCurrency. # noqa: E501 + :rtype: str + """ + return self._before_amount + + @before_amount.setter + def before_amount(self, before_amount): + """Sets the before_amount of this MultiCollateralRecordCurrency. + + Amount before the operation # noqa: E501 + + :param before_amount: The before_amount of this MultiCollateralRecordCurrency. # noqa: E501 + :type: str + """ + + self._before_amount = before_amount + + @property + def before_amount_usdt(self): + """Gets the before_amount_usdt of this MultiCollateralRecordCurrency. # noqa: E501 + + USDT Amount before the operation # noqa: E501 + + :return: The before_amount_usdt of this MultiCollateralRecordCurrency. # noqa: E501 + :rtype: str + """ + return self._before_amount_usdt + + @before_amount_usdt.setter + def before_amount_usdt(self, before_amount_usdt): + """Sets the before_amount_usdt of this MultiCollateralRecordCurrency. + + USDT Amount before the operation # noqa: E501 + + :param before_amount_usdt: The before_amount_usdt of this MultiCollateralRecordCurrency. # noqa: E501 + :type: str + """ + + self._before_amount_usdt = before_amount_usdt + + @property + def after_amount(self): + """Gets the after_amount of this MultiCollateralRecordCurrency. # noqa: E501 + + Amount after the operation # noqa: E501 + + :return: The after_amount of this MultiCollateralRecordCurrency. # noqa: E501 + :rtype: str + """ + return self._after_amount + + @after_amount.setter + def after_amount(self, after_amount): + """Sets the after_amount of this MultiCollateralRecordCurrency. + + Amount after the operation # noqa: E501 + + :param after_amount: The after_amount of this MultiCollateralRecordCurrency. # noqa: E501 + :type: str + """ + + self._after_amount = after_amount + + @property + def after_amount_usdt(self): + """Gets the after_amount_usdt of this MultiCollateralRecordCurrency. # noqa: E501 + + USDT Amount after the operation # noqa: E501 + + :return: The after_amount_usdt of this MultiCollateralRecordCurrency. # noqa: E501 + :rtype: str + """ + return self._after_amount_usdt + + @after_amount_usdt.setter + def after_amount_usdt(self, after_amount_usdt): + """Sets the after_amount_usdt of this MultiCollateralRecordCurrency. + + USDT Amount after the operation # noqa: E501 + + :param after_amount_usdt: The after_amount_usdt of this MultiCollateralRecordCurrency. # noqa: E501 + :type: str + """ + + self._after_amount_usdt = after_amount_usdt + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MultiCollateralRecordCurrency): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, MultiCollateralRecordCurrency): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/multi_loan_item.py b/gate_api/models/multi_loan_item.py new file mode 100644 index 0000000..02c2dd5 --- /dev/null +++ b/gate_api/models/multi_loan_item.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 MultiLoanItem(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'price': 'str' + } + + attribute_map = { + 'currency': 'currency', + 'price': 'price' + } + + def __init__(self, currency=None, price=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """MultiLoanItem - a 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._price = None + self.discriminator = None + + if currency is not None: + self.currency = currency + if price is not None: + self.price = price + + @property + def currency(self): + """Gets the currency of this MultiLoanItem. # noqa: E501 + + Currency # noqa: E501 + + :return: The currency of this MultiLoanItem. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this MultiLoanItem. + + Currency # noqa: E501 + + :param currency: The currency of this MultiLoanItem. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def price(self): + """Gets the price of this MultiLoanItem. # noqa: E501 + + Latest price of the currency # noqa: E501 + + :return: The price of this MultiLoanItem. # noqa: E501 + :rtype: str + """ + return self._price + + @price.setter + def price(self, price): + """Sets the price of this MultiLoanItem. + + Latest price of the currency # noqa: E501 + + :param price: The price of this MultiLoanItem. # 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, MultiLoanItem): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, MultiLoanItem): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/multi_loan_repay_item.py b/gate_api/models/multi_loan_repay_item.py new file mode 100644 index 0000000..40d09f8 --- /dev/null +++ b/gate_api/models/multi_loan_repay_item.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 MultiLoanRepayItem(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'amount': 'str', + 'repaid_all': 'bool' + } + + attribute_map = { + 'currency': 'currency', + 'amount': 'amount', + 'repaid_all': 'repaid_all' + } + + def __init__(self, currency=None, amount=None, repaid_all=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, bool, Configuration) -> None + """MultiLoanRepayItem - a 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._repaid_all = None + self.discriminator = None + + if currency is not None: + self.currency = currency + if amount is not None: + self.amount = amount + self.repaid_all = repaid_all + + @property + def currency(self): + """Gets the currency of this MultiLoanRepayItem. # noqa: E501 + + Repayment currency # noqa: E501 + + :return: The currency of this MultiLoanRepayItem. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this MultiLoanRepayItem. + + Repayment currency # noqa: E501 + + :param currency: The currency of this MultiLoanRepayItem. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def amount(self): + """Gets the amount of this MultiLoanRepayItem. # noqa: E501 + + Size # noqa: E501 + + :return: The amount of this MultiLoanRepayItem. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this MultiLoanRepayItem. + + Size # noqa: E501 + + :param amount: The amount of this MultiLoanRepayItem. # noqa: E501 + :type: str + """ + + self._amount = amount + + @property + def repaid_all(self): + """Gets the repaid_all of this MultiLoanRepayItem. # noqa: E501 + + Repayment method, set to true for full repayment, false for partial repayment # noqa: E501 + + :return: The repaid_all of this MultiLoanRepayItem. # noqa: E501 + :rtype: bool + """ + return self._repaid_all + + @repaid_all.setter + def repaid_all(self, repaid_all): + """Sets the repaid_all of this MultiLoanRepayItem. + + Repayment method, set to true for full repayment, false for partial repayment # noqa: E501 + + :param repaid_all: The repaid_all of this MultiLoanRepayItem. # noqa: E501 + :type: bool + """ + 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 + + self._repaid_all = repaid_all + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MultiLoanRepayItem): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, MultiLoanRepayItem): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/multi_repay_record.py b/gate_api/models/multi_repay_record.py new file mode 100644 index 0000000..82e18fc --- /dev/null +++ b/gate_api/models/multi_repay_record.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 MultiRepayRecord(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'init_ltv': 'str', + 'before_ltv': 'str', + 'after_ltv': 'str', + 'borrow_time': 'int', + 'repay_time': 'int', + 'borrow_currencies': 'list[RepayRecordCurrency]', + 'collateral_currencies': 'list[RepayRecordCurrency]', + 'repaid_currencies': 'list[RepayRecordRepaidCurrency]', + 'total_interest_list': 'list[RepayRecordTotalInterest]', + 'left_repay_interest_list': 'list[RepayRecordLeftInterest]' + } + + attribute_map = { + 'order_id': 'order_id', + 'record_id': 'record_id', + 'init_ltv': 'init_ltv', + 'before_ltv': 'before_ltv', + 'after_ltv': 'after_ltv', + 'borrow_time': 'borrow_time', + 'repay_time': 'repay_time', + 'borrow_currencies': 'borrow_currencies', + 'collateral_currencies': 'collateral_currencies', + 'repaid_currencies': 'repaid_currencies', + 'total_interest_list': 'total_interest_list', + 'left_repay_interest_list': 'left_repay_interest_list' + } + + def __init__(self, order_id=None, record_id=None, init_ltv=None, before_ltv=None, after_ltv=None, borrow_time=None, repay_time=None, borrow_currencies=None, collateral_currencies=None, repaid_currencies=None, total_interest_list=None, left_repay_interest_list=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, str, str, str, int, int, list[RepayRecordCurrency], list[RepayRecordCurrency], list[RepayRecordRepaidCurrency], list[RepayRecordTotalInterest], list[RepayRecordLeftInterest], Configuration) -> None + """MultiRepayRecord - a 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._init_ltv = None + self._before_ltv = None + self._after_ltv = None + self._borrow_time = None + self._repay_time = None + self._borrow_currencies = None + self._collateral_currencies = None + self._repaid_currencies = None + self._total_interest_list = None + self._left_repay_interest_list = 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 init_ltv is not None: + self.init_ltv = init_ltv + if before_ltv is not None: + self.before_ltv = before_ltv + if after_ltv is not None: + self.after_ltv = after_ltv + if borrow_time is not None: + self.borrow_time = borrow_time + if repay_time is not None: + self.repay_time = repay_time + if borrow_currencies is not None: + self.borrow_currencies = borrow_currencies + if collateral_currencies is not None: + self.collateral_currencies = collateral_currencies + if repaid_currencies is not None: + self.repaid_currencies = repaid_currencies + if total_interest_list is not None: + self.total_interest_list = total_interest_list + if left_repay_interest_list is not None: + self.left_repay_interest_list = left_repay_interest_list + + @property + def order_id(self): + """Gets the order_id of this MultiRepayRecord. # noqa: E501 + + Order ID # noqa: E501 + + :return: The order_id of this MultiRepayRecord. # noqa: E501 + :rtype: int + """ + return self._order_id + + @order_id.setter + def order_id(self, order_id): + """Sets the order_id of this MultiRepayRecord. + + Order ID # noqa: E501 + + :param order_id: The order_id of this MultiRepayRecord. # noqa: E501 + :type: int + """ + + self._order_id = order_id + + @property + def record_id(self): + """Gets the record_id of this MultiRepayRecord. # noqa: E501 + + Repayment record ID # noqa: E501 + + :return: The record_id of this MultiRepayRecord. # noqa: E501 + :rtype: int + """ + return self._record_id + + @record_id.setter + def record_id(self, record_id): + """Sets the record_id of this MultiRepayRecord. + + Repayment record ID # noqa: E501 + + :param record_id: The record_id of this MultiRepayRecord. # noqa: E501 + :type: int + """ + + self._record_id = record_id + + @property + def init_ltv(self): + """Gets the init_ltv of this MultiRepayRecord. # noqa: E501 + + Initial collateralization rate # noqa: E501 + + :return: The init_ltv of this MultiRepayRecord. # noqa: E501 + :rtype: str + """ + return self._init_ltv + + @init_ltv.setter + def init_ltv(self, init_ltv): + """Sets the init_ltv of this MultiRepayRecord. + + Initial collateralization rate # noqa: E501 + + :param init_ltv: The init_ltv of this MultiRepayRecord. # noqa: E501 + :type: str + """ + + self._init_ltv = init_ltv + + @property + def before_ltv(self): + """Gets the before_ltv of this MultiRepayRecord. # noqa: E501 + + Ltv before the operation # noqa: E501 + + :return: The before_ltv of this MultiRepayRecord. # noqa: E501 + :rtype: str + """ + return self._before_ltv + + @before_ltv.setter + def before_ltv(self, before_ltv): + """Sets the before_ltv of this MultiRepayRecord. + + Ltv before the operation # noqa: E501 + + :param before_ltv: The before_ltv of this MultiRepayRecord. # noqa: E501 + :type: str + """ + + self._before_ltv = before_ltv + + @property + def after_ltv(self): + """Gets the after_ltv of this MultiRepayRecord. # noqa: E501 + + Ltv after the operation # noqa: E501 + + :return: The after_ltv of this MultiRepayRecord. # noqa: E501 + :rtype: str + """ + return self._after_ltv + + @after_ltv.setter + def after_ltv(self, after_ltv): + """Sets the after_ltv of this MultiRepayRecord. + + Ltv after the operation # noqa: E501 + + :param after_ltv: The after_ltv of this MultiRepayRecord. # noqa: E501 + :type: str + """ + + self._after_ltv = after_ltv + + @property + def borrow_time(self): + """Gets the borrow_time of this MultiRepayRecord. # noqa: E501 + + Borrowing time, timestamp in seconds # noqa: E501 + + :return: The borrow_time of this MultiRepayRecord. # noqa: E501 + :rtype: int + """ + return self._borrow_time + + @borrow_time.setter + def borrow_time(self, borrow_time): + """Sets the borrow_time of this MultiRepayRecord. + + Borrowing time, timestamp in seconds # noqa: E501 + + :param borrow_time: The borrow_time of this MultiRepayRecord. # noqa: E501 + :type: int + """ + + self._borrow_time = borrow_time + + @property + def repay_time(self): + """Gets the repay_time of this MultiRepayRecord. # noqa: E501 + + Repayment time, timestamp in seconds # noqa: E501 + + :return: The repay_time of this MultiRepayRecord. # noqa: E501 + :rtype: int + """ + return self._repay_time + + @repay_time.setter + def repay_time(self, repay_time): + """Sets the repay_time of this MultiRepayRecord. + + Repayment time, timestamp in seconds # noqa: E501 + + :param repay_time: The repay_time of this MultiRepayRecord. # noqa: E501 + :type: int + """ + + self._repay_time = repay_time + + @property + def borrow_currencies(self): + """Gets the borrow_currencies of this MultiRepayRecord. # noqa: E501 + + List of borrowing information # noqa: E501 + + :return: The borrow_currencies of this MultiRepayRecord. # noqa: E501 + :rtype: list[RepayRecordCurrency] + """ + return self._borrow_currencies + + @borrow_currencies.setter + def borrow_currencies(self, borrow_currencies): + """Sets the borrow_currencies of this MultiRepayRecord. + + List of borrowing information # noqa: E501 + + :param borrow_currencies: The borrow_currencies of this MultiRepayRecord. # noqa: E501 + :type: list[RepayRecordCurrency] + """ + + self._borrow_currencies = borrow_currencies + + @property + def collateral_currencies(self): + """Gets the collateral_currencies of this MultiRepayRecord. # noqa: E501 + + List of collateral information # noqa: E501 + + :return: The collateral_currencies of this MultiRepayRecord. # noqa: E501 + :rtype: list[RepayRecordCurrency] + """ + return self._collateral_currencies + + @collateral_currencies.setter + def collateral_currencies(self, collateral_currencies): + """Sets the collateral_currencies of this MultiRepayRecord. + + List of collateral information # noqa: E501 + + :param collateral_currencies: The collateral_currencies of this MultiRepayRecord. # noqa: E501 + :type: list[RepayRecordCurrency] + """ + + self._collateral_currencies = collateral_currencies + + @property + def repaid_currencies(self): + """Gets the repaid_currencies of this MultiRepayRecord. # noqa: E501 + + Repay Currency List # noqa: E501 + + :return: The repaid_currencies of this MultiRepayRecord. # noqa: E501 + :rtype: list[RepayRecordRepaidCurrency] + """ + return self._repaid_currencies + + @repaid_currencies.setter + def repaid_currencies(self, repaid_currencies): + """Sets the repaid_currencies of this MultiRepayRecord. + + Repay Currency List # noqa: E501 + + :param repaid_currencies: The repaid_currencies of this MultiRepayRecord. # noqa: E501 + :type: list[RepayRecordRepaidCurrency] + """ + + self._repaid_currencies = repaid_currencies + + @property + def total_interest_list(self): + """Gets the total_interest_list of this MultiRepayRecord. # noqa: E501 + + Total Interest List # noqa: E501 + + :return: The total_interest_list of this MultiRepayRecord. # noqa: E501 + :rtype: list[RepayRecordTotalInterest] + """ + return self._total_interest_list + + @total_interest_list.setter + def total_interest_list(self, total_interest_list): + """Sets the total_interest_list of this MultiRepayRecord. + + Total Interest List # noqa: E501 + + :param total_interest_list: The total_interest_list of this MultiRepayRecord. # noqa: E501 + :type: list[RepayRecordTotalInterest] + """ + + self._total_interest_list = total_interest_list + + @property + def left_repay_interest_list(self): + """Gets the left_repay_interest_list of this MultiRepayRecord. # noqa: E501 + + List of remaining interest to be repaid # noqa: E501 + + :return: The left_repay_interest_list of this MultiRepayRecord. # noqa: E501 + :rtype: list[RepayRecordLeftInterest] + """ + return self._left_repay_interest_list + + @left_repay_interest_list.setter + def left_repay_interest_list(self, left_repay_interest_list): + """Sets the left_repay_interest_list of this MultiRepayRecord. + + List of remaining interest to be repaid # noqa: E501 + + :param left_repay_interest_list: The left_repay_interest_list of this MultiRepayRecord. # noqa: E501 + :type: list[RepayRecordLeftInterest] + """ + + self._left_repay_interest_list = left_repay_interest_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, MultiRepayRecord): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, MultiRepayRecord): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/multi_repay_resp.py b/gate_api/models/multi_repay_resp.py new file mode 100644 index 0000000..bb2f880 --- /dev/null +++ b/gate_api/models/multi_repay_resp.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 MultiRepayResp(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'repaid_currencies': 'list[RepayCurrencyRes]' + } + + attribute_map = { + 'order_id': 'order_id', + 'repaid_currencies': 'repaid_currencies' + } + + def __init__(self, order_id=None, repaid_currencies=None, local_vars_configuration=None): # noqa: E501 + # type: (int, list[RepayCurrencyRes], Configuration) -> None + """MultiRepayResp - a 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._repaid_currencies = None + self.discriminator = None + + if order_id is not None: + self.order_id = order_id + if repaid_currencies is not None: + self.repaid_currencies = repaid_currencies + + @property + def order_id(self): + """Gets the order_id of this MultiRepayResp. # noqa: E501 + + Order ID # noqa: E501 + + :return: The order_id of this MultiRepayResp. # noqa: E501 + :rtype: int + """ + return self._order_id + + @order_id.setter + def order_id(self, order_id): + """Sets the order_id of this MultiRepayResp. + + Order ID # noqa: E501 + + :param order_id: The order_id of this MultiRepayResp. # noqa: E501 + :type: int + """ + + self._order_id = order_id + + @property + def repaid_currencies(self): + """Gets the repaid_currencies of this MultiRepayResp. # noqa: E501 + + Repay Currency List # noqa: E501 + + :return: The repaid_currencies of this MultiRepayResp. # noqa: E501 + :rtype: list[RepayCurrencyRes] + """ + return self._repaid_currencies + + @repaid_currencies.setter + def repaid_currencies(self, repaid_currencies): + """Sets the repaid_currencies of this MultiRepayResp. + + Repay Currency List # noqa: E501 + + :param repaid_currencies: The repaid_currencies of this MultiRepayResp. # noqa: E501 + :type: list[RepayCurrencyRes] + """ + + self._repaid_currencies = repaid_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, MultiRepayResp): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, MultiRepayResp): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/my_futures_trade.py b/gate_api/models/my_futures_trade.py index e2d70f9..4066f32 100644 --- a/gate_api/models/my_futures_trade.py +++ b/gate_api/models/my_futures_trade.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -38,8 +38,12 @@ class MyFuturesTrade(object): 'contract': 'str', 'order_id': 'str', 'size': 'int', + 'close_size': 'int', 'price': 'str', 'role': 'str', + 'text': 'str', + 'fee': 'str', + 'point_fee': 'str' } attribute_map = { @@ -48,22 +52,16 @@ class MyFuturesTrade(object): 'contract': 'contract', 'order_id': 'order_id', 'size': 'size', + 'close_size': 'close_size', 'price': 'price', 'role': 'role', + 'text': 'text', + 'fee': 'fee', + 'point_fee': 'point_fee' } - def __init__( - self, - id=None, - create_time=None, - contract=None, - order_id=None, - size=None, - price=None, - role=None, - local_vars_configuration=None, - ): # noqa: E501 - # type: (int, float, str, str, int, str, str, Configuration) -> None + def __init__(self, id=None, create_time=None, contract=None, order_id=None, size=None, close_size=None, price=None, role=None, text=None, fee=None, point_fee=None, local_vars_configuration=None): # noqa: E501 + # type: (int, float, str, str, int, int, str, str, str, str, str, Configuration) -> None """MyFuturesTrade - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -74,8 +72,12 @@ def __init__( self._contract = None self._order_id = None self._size = None + self._close_size = None self._price = None self._role = None + self._text = None + self._fee = None + self._point_fee = None self.discriminator = None if id is not None: @@ -88,16 +90,24 @@ def __init__( self.order_id = order_id if size is not None: self.size = size + if close_size is not None: + self.close_size = close_size if price is not None: self.price = price if role is not None: self.role = role + if text is not None: + self.text = text + if fee is not None: + self.fee = fee + if point_fee is not None: + self.point_fee = point_fee @property def id(self): """Gets the id of this MyFuturesTrade. # noqa: E501 - Trade ID # noqa: E501 + Fill ID # noqa: E501 :return: The id of this MyFuturesTrade. # noqa: E501 :rtype: int @@ -108,7 +118,7 @@ def id(self): def id(self, id): """Sets the id of this MyFuturesTrade. - Trade ID # noqa: E501 + Fill ID # noqa: E501 :param id: The id of this MyFuturesTrade. # noqa: E501 :type: int @@ -120,7 +130,7 @@ def id(self, id): def create_time(self): """Gets the create_time of this MyFuturesTrade. # noqa: E501 - Trading time # noqa: E501 + Fill Time # noqa: E501 :return: The create_time of this MyFuturesTrade. # noqa: E501 :rtype: float @@ -131,7 +141,7 @@ def create_time(self): def create_time(self, create_time): """Sets the create_time of this MyFuturesTrade. - Trading time # noqa: E501 + Fill Time # noqa: E501 :param create_time: The create_time of this MyFuturesTrade. # noqa: E501 :type: float @@ -166,7 +176,7 @@ def contract(self, contract): def order_id(self): """Gets the order_id of this MyFuturesTrade. # noqa: E501 - Order ID related # noqa: E501 + Related order ID # noqa: E501 :return: The order_id of this MyFuturesTrade. # noqa: E501 :rtype: str @@ -177,7 +187,7 @@ def order_id(self): def order_id(self, order_id): """Sets the order_id of this MyFuturesTrade. - Order ID related # noqa: E501 + Related order ID # noqa: E501 :param order_id: The order_id of this MyFuturesTrade. # noqa: E501 :type: str @@ -208,11 +218,34 @@ def size(self, size): self._size = size + @property + def close_size(self): + """Gets the close_size of this MyFuturesTrade. # noqa: E501 + + Number of closed positions: close_size=0 && size>0 Open long position close_size=0 && size<0 Open short position close_size>0 && size>0 && size <= close_size Close short position close_size>0 && size>0 && size > close_size Close short position and open long position close_size<0 && size<0 && size >= close_size Close long position close_size<0 && size<0 && size < close_size Close long position and open short position # noqa: E501 + + :return: The close_size of this MyFuturesTrade. # noqa: E501 + :rtype: int + """ + return self._close_size + + @close_size.setter + def close_size(self, close_size): + """Sets the close_size of this MyFuturesTrade. + + Number of closed positions: close_size=0 && size>0 Open long position close_size=0 && size<0 Open short position close_size>0 && size>0 && size <= close_size Close short position close_size>0 && size>0 && size > close_size Close short position and open long position close_size<0 && size<0 && size >= close_size Close long position close_size<0 && size<0 && size < close_size Close long position and open short position # noqa: E501 + + :param close_size: The close_size of this MyFuturesTrade. # noqa: E501 + :type: int + """ + + self._close_size = close_size + @property def price(self): """Gets the price of this MyFuturesTrade. # noqa: E501 - Trading price # noqa: E501 + Fill Price # noqa: E501 :return: The price of this MyFuturesTrade. # noqa: E501 :rtype: str @@ -223,7 +256,7 @@ def price(self): def price(self, price): """Sets the price of this MyFuturesTrade. - Trading price # noqa: E501 + Fill Price # noqa: E501 :param price: The price of this MyFuturesTrade. # noqa: E501 :type: str @@ -235,7 +268,7 @@ def price(self, price): def role(self): """Gets the role of this MyFuturesTrade. # noqa: E501 - Trade role. Available values are `taker` and `maker` # noqa: E501 + Trade role. taker - taker, maker - maker # noqa: E501 :return: The role of this MyFuturesTrade. # noqa: E501 :rtype: str @@ -246,7 +279,7 @@ def role(self): def role(self, role): """Sets the role of this MyFuturesTrade. - Trade role. Available values are `taker` and `maker` # noqa: E501 + Trade role. taker - taker, maker - maker # noqa: E501 :param role: The role of this MyFuturesTrade. # noqa: E501 :type: str @@ -254,11 +287,81 @@ def role(self, role): allowed_values = ["taker", "maker"] # noqa: E501 if self.local_vars_configuration.client_side_validation and role not in allowed_values: # noqa: E501 raise ValueError( - "Invalid value for `role` ({0}), must be one of {1}".format(role, allowed_values) # noqa: E501 + "Invalid value for `role` ({0}), must be one of {1}" # noqa: E501 + .format(role, allowed_values) ) self._role = role + @property + def text(self): + """Gets the text of this MyFuturesTrade. # noqa: E501 + + Order custom information # noqa: E501 + + :return: The text of this MyFuturesTrade. # noqa: E501 + :rtype: str + """ + return self._text + + @text.setter + def text(self, text): + """Sets the text of this MyFuturesTrade. + + Order custom information # noqa: E501 + + :param text: The text of this MyFuturesTrade. # noqa: E501 + :type: str + """ + + self._text = text + + @property + def fee(self): + """Gets the fee of this MyFuturesTrade. # noqa: E501 + + Trade fee # noqa: E501 + + :return: The fee of this MyFuturesTrade. # noqa: E501 + :rtype: str + """ + return self._fee + + @fee.setter + def fee(self, fee): + """Sets the fee of this MyFuturesTrade. + + Trade fee # noqa: E501 + + :param fee: The fee of this MyFuturesTrade. # noqa: E501 + :type: str + """ + + self._fee = fee + + @property + def point_fee(self): + """Gets the point_fee of this MyFuturesTrade. # noqa: E501 + + Points used to deduct trade fee # noqa: E501 + + :return: The point_fee of this MyFuturesTrade. # noqa: E501 + :rtype: str + """ + return self._point_fee + + @point_fee.setter + def point_fee(self, point_fee): + """Sets the point_fee of this MyFuturesTrade. + + Points used to deduct trade fee # noqa: E501 + + :param point_fee: The point_fee of this MyFuturesTrade. # noqa: E501 + :type: str + """ + + self._point_fee = point_fee + def to_dict(self): """Returns the model properties as a dict""" result = {} @@ -266,16 +369,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/my_futures_trade_time_range.py b/gate_api/models/my_futures_trade_time_range.py new file mode 100644 index 0000000..81e915b --- /dev/null +++ b/gate_api/models/my_futures_trade_time_range.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 MyFuturesTradeTimeRange(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'trade_id': 'str', + 'create_time': 'float', + 'contract': 'str', + 'order_id': 'str', + 'size': 'int', + 'close_size': 'int', + 'price': 'str', + 'role': 'str', + 'text': 'str', + 'fee': 'str', + 'point_fee': 'str' + } + + attribute_map = { + 'trade_id': 'trade_id', + 'create_time': 'create_time', + 'contract': 'contract', + 'order_id': 'order_id', + 'size': 'size', + 'close_size': 'close_size', + 'price': 'price', + 'role': 'role', + 'text': 'text', + 'fee': 'fee', + 'point_fee': 'point_fee' + } + + def __init__(self, trade_id=None, create_time=None, contract=None, order_id=None, size=None, close_size=None, price=None, role=None, text=None, fee=None, point_fee=None, local_vars_configuration=None): # noqa: E501 + # type: (str, float, str, str, int, int, str, str, str, str, str, Configuration) -> None + """MyFuturesTradeTimeRange - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._trade_id = None + self._create_time = None + self._contract = None + self._order_id = None + self._size = None + self._close_size = None + self._price = None + self._role = None + self._text = None + self._fee = None + self._point_fee = None + self.discriminator = None + + if trade_id is not None: + self.trade_id = trade_id + if create_time is not None: + self.create_time = create_time + if contract is not None: + self.contract = contract + if order_id is not None: + self.order_id = order_id + if size is not None: + self.size = size + if close_size is not None: + self.close_size = close_size + if price is not None: + self.price = price + if role is not None: + self.role = role + if text is not None: + self.text = text + if fee is not None: + self.fee = fee + if point_fee is not None: + self.point_fee = point_fee + + @property + def trade_id(self): + """Gets the trade_id of this MyFuturesTradeTimeRange. # noqa: E501 + + Fill ID # noqa: E501 + + :return: The trade_id of this MyFuturesTradeTimeRange. # noqa: E501 + :rtype: str + """ + return self._trade_id + + @trade_id.setter + def trade_id(self, trade_id): + """Sets the trade_id of this MyFuturesTradeTimeRange. + + Fill ID # noqa: E501 + + :param trade_id: The trade_id of this MyFuturesTradeTimeRange. # noqa: E501 + :type: str + """ + + self._trade_id = trade_id + + @property + def create_time(self): + """Gets the create_time of this MyFuturesTradeTimeRange. # noqa: E501 + + Fill Time # noqa: E501 + + :return: The create_time of this MyFuturesTradeTimeRange. # noqa: E501 + :rtype: float + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this MyFuturesTradeTimeRange. + + Fill Time # noqa: E501 + + :param create_time: The create_time of this MyFuturesTradeTimeRange. # noqa: E501 + :type: float + """ + + self._create_time = create_time + + @property + def contract(self): + """Gets the contract of this MyFuturesTradeTimeRange. # noqa: E501 + + Futures contract # noqa: E501 + + :return: The contract of this MyFuturesTradeTimeRange. # noqa: E501 + :rtype: str + """ + return self._contract + + @contract.setter + def contract(self, contract): + """Sets the contract of this MyFuturesTradeTimeRange. + + Futures contract # noqa: E501 + + :param contract: The contract of this MyFuturesTradeTimeRange. # noqa: E501 + :type: str + """ + + self._contract = contract + + @property + def order_id(self): + """Gets the order_id of this MyFuturesTradeTimeRange. # noqa: E501 + + Related order ID # noqa: E501 + + :return: The order_id of this MyFuturesTradeTimeRange. # noqa: E501 + :rtype: str + """ + return self._order_id + + @order_id.setter + def order_id(self, order_id): + """Sets the order_id of this MyFuturesTradeTimeRange. + + Related order ID # noqa: E501 + + :param order_id: The order_id of this MyFuturesTradeTimeRange. # noqa: E501 + :type: str + """ + + self._order_id = order_id + + @property + def size(self): + """Gets the size of this MyFuturesTradeTimeRange. # noqa: E501 + + Trading size # noqa: E501 + + :return: The size of this MyFuturesTradeTimeRange. # noqa: E501 + :rtype: int + """ + return self._size + + @size.setter + def size(self, size): + """Sets the size of this MyFuturesTradeTimeRange. + + Trading size # noqa: E501 + + :param size: The size of this MyFuturesTradeTimeRange. # noqa: E501 + :type: int + """ + + self._size = size + + @property + def close_size(self): + """Gets the close_size of this MyFuturesTradeTimeRange. # noqa: E501 + + Number of closed positions: close_size=0 && size>0 Open long position close_size=0 && size<0 Open short position close_size>0 && size>0 && size <= close_size Close short position close_size>0 && size>0 && size > close_size Close short position and open long position close_size<0 && size<0 && size >= close_size Close long position close_size<0 && size<0 && size < close_size Close long position and open short position # noqa: E501 + + :return: The close_size of this MyFuturesTradeTimeRange. # noqa: E501 + :rtype: int + """ + return self._close_size + + @close_size.setter + def close_size(self, close_size): + """Sets the close_size of this MyFuturesTradeTimeRange. + + Number of closed positions: close_size=0 && size>0 Open long position close_size=0 && size<0 Open short position close_size>0 && size>0 && size <= close_size Close short position close_size>0 && size>0 && size > close_size Close short position and open long position close_size<0 && size<0 && size >= close_size Close long position close_size<0 && size<0 && size < close_size Close long position and open short position # noqa: E501 + + :param close_size: The close_size of this MyFuturesTradeTimeRange. # noqa: E501 + :type: int + """ + + self._close_size = close_size + + @property + def price(self): + """Gets the price of this MyFuturesTradeTimeRange. # noqa: E501 + + Fill Price # noqa: E501 + + :return: The price of this MyFuturesTradeTimeRange. # noqa: E501 + :rtype: str + """ + return self._price + + @price.setter + def price(self, price): + """Sets the price of this MyFuturesTradeTimeRange. + + Fill Price # noqa: E501 + + :param price: The price of this MyFuturesTradeTimeRange. # noqa: E501 + :type: str + """ + + self._price = price + + @property + def role(self): + """Gets the role of this MyFuturesTradeTimeRange. # noqa: E501 + + Trade role. taker - taker, maker - maker # noqa: E501 + + :return: The role of this MyFuturesTradeTimeRange. # noqa: E501 + :rtype: str + """ + return self._role + + @role.setter + def role(self, role): + """Sets the role of this MyFuturesTradeTimeRange. + + Trade role. taker - taker, maker - maker # noqa: E501 + + :param role: The role of this MyFuturesTradeTimeRange. # noqa: E501 + :type: str + """ + allowed_values = ["taker", "maker"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and role not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `role` ({0}), must be one of {1}" # noqa: E501 + .format(role, allowed_values) + ) + + self._role = role + + @property + def text(self): + """Gets the text of this MyFuturesTradeTimeRange. # noqa: E501 + + Order custom information # noqa: E501 + + :return: The text of this MyFuturesTradeTimeRange. # noqa: E501 + :rtype: str + """ + return self._text + + @text.setter + def text(self, text): + """Sets the text of this MyFuturesTradeTimeRange. + + Order custom information # noqa: E501 + + :param text: The text of this MyFuturesTradeTimeRange. # noqa: E501 + :type: str + """ + + self._text = text + + @property + def fee(self): + """Gets the fee of this MyFuturesTradeTimeRange. # noqa: E501 + + Trade fee # noqa: E501 + + :return: The fee of this MyFuturesTradeTimeRange. # noqa: E501 + :rtype: str + """ + return self._fee + + @fee.setter + def fee(self, fee): + """Sets the fee of this MyFuturesTradeTimeRange. + + Trade fee # noqa: E501 + + :param fee: The fee of this MyFuturesTradeTimeRange. # noqa: E501 + :type: str + """ + + self._fee = fee + + @property + def point_fee(self): + """Gets the point_fee of this MyFuturesTradeTimeRange. # noqa: E501 + + Points used to deduct trade fee # noqa: E501 + + :return: The point_fee of this MyFuturesTradeTimeRange. # noqa: E501 + :rtype: str + """ + return self._point_fee + + @point_fee.setter + def point_fee(self, point_fee): + """Sets the point_fee of this MyFuturesTradeTimeRange. + + Points used to deduct trade fee # noqa: E501 + + :param point_fee: The point_fee of this MyFuturesTradeTimeRange. # noqa: E501 + :type: str + """ + + self._point_fee = point_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, MyFuturesTradeTimeRange): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, MyFuturesTradeTimeRange): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/open_orders.py b/gate_api/models/open_orders.py index 0256f48..4d856f3 100644 --- a/gate_api/models/open_orders.py +++ b/gate_api/models/open_orders.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -32,9 +32,17 @@ class OpenOrders(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {'currency_pair': 'str', 'total': 'int', 'orders': 'list[Order]'} - - attribute_map = {'currency_pair': 'currency_pair', 'total': 'total', 'orders': 'orders'} + openapi_types = { + 'currency_pair': 'str', + 'total': 'int', + 'orders': 'list[Order]' + } + + attribute_map = { + 'currency_pair': 'currency_pair', + 'total': 'total', + 'orders': 'orders' + } def __init__(self, currency_pair=None, total=None, orders=None, local_vars_configuration=None): # noqa: E501 # type: (str, int, list[Order], Configuration) -> None @@ -82,7 +90,7 @@ def currency_pair(self, currency_pair): def total(self): """Gets the total of this OpenOrders. # noqa: E501 - Total open orders in this currency pair # noqa: E501 + Total number of open orders for this trading pair on the current page # noqa: E501 :return: The total of this OpenOrders. # noqa: E501 :rtype: int @@ -93,7 +101,7 @@ def total(self): def total(self, total): """Sets the total of this OpenOrders. - Total open orders in this currency pair # noqa: E501 + Total number of open orders for this trading pair on the current page # noqa: E501 :param total: The total of this OpenOrders. # noqa: E501 :type: int @@ -129,16 +137,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/options_account.py b/gate_api/models/options_account.py new file mode 100644 index 0000000..e05a45c --- /dev/null +++ b/gate_api/models/options_account.py @@ -0,0 +1,633 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OptionsAccount(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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': 'int', + 'total': 'str', + 'position_value': 'str', + 'equity': 'str', + 'short_enabled': 'bool', + 'mmp_enabled': 'bool', + 'liq_triggered': 'bool', + 'margin_mode': 'int', + 'unrealised_pnl': 'str', + 'init_margin': 'str', + 'maint_margin': 'str', + 'order_margin': 'str', + 'ask_order_margin': 'str', + 'bid_order_margin': 'str', + 'available': 'str', + 'point': 'str', + 'currency': 'str', + 'orders_limit': 'int', + 'position_notional_limit': 'int' + } + + attribute_map = { + 'user': 'user', + 'total': 'total', + 'position_value': 'position_value', + 'equity': 'equity', + 'short_enabled': 'short_enabled', + 'mmp_enabled': 'mmp_enabled', + 'liq_triggered': 'liq_triggered', + 'margin_mode': 'margin_mode', + 'unrealised_pnl': 'unrealised_pnl', + 'init_margin': 'init_margin', + 'maint_margin': 'maint_margin', + 'order_margin': 'order_margin', + 'ask_order_margin': 'ask_order_margin', + 'bid_order_margin': 'bid_order_margin', + 'available': 'available', + 'point': 'point', + 'currency': 'currency', + 'orders_limit': 'orders_limit', + 'position_notional_limit': 'position_notional_limit' + } + + def __init__(self, user=None, total=None, position_value=None, equity=None, short_enabled=None, mmp_enabled=None, liq_triggered=None, margin_mode=None, unrealised_pnl=None, init_margin=None, maint_margin=None, order_margin=None, ask_order_margin=None, bid_order_margin=None, available=None, point=None, currency=None, orders_limit=None, position_notional_limit=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, str, str, bool, bool, bool, int, str, str, str, str, str, str, str, str, str, int, int, Configuration) -> None + """OptionsAccount - a 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 = None + self._total = None + self._position_value = None + self._equity = None + self._short_enabled = None + self._mmp_enabled = None + self._liq_triggered = None + self._margin_mode = None + self._unrealised_pnl = None + self._init_margin = None + self._maint_margin = None + self._order_margin = None + self._ask_order_margin = None + self._bid_order_margin = None + self._available = None + self._point = None + self._currency = None + self._orders_limit = None + self._position_notional_limit = None + self.discriminator = None + + if user is not None: + self.user = user + if total is not None: + self.total = total + if position_value is not None: + self.position_value = position_value + if equity is not None: + self.equity = equity + if short_enabled is not None: + self.short_enabled = short_enabled + if mmp_enabled is not None: + self.mmp_enabled = mmp_enabled + if liq_triggered is not None: + self.liq_triggered = liq_triggered + if margin_mode is not None: + self.margin_mode = margin_mode + if unrealised_pnl is not None: + self.unrealised_pnl = unrealised_pnl + if init_margin is not None: + self.init_margin = init_margin + if maint_margin is not None: + self.maint_margin = maint_margin + if order_margin is not None: + self.order_margin = order_margin + if ask_order_margin is not None: + self.ask_order_margin = ask_order_margin + if bid_order_margin is not None: + self.bid_order_margin = bid_order_margin + if available is not None: + self.available = available + if point is not None: + self.point = point + if currency is not None: + self.currency = currency + if orders_limit is not None: + self.orders_limit = orders_limit + if position_notional_limit is not None: + self.position_notional_limit = position_notional_limit + + @property + def user(self): + """Gets the user of this OptionsAccount. # noqa: E501 + + User ID # noqa: E501 + + :return: The user of this OptionsAccount. # noqa: E501 + :rtype: int + """ + return self._user + + @user.setter + def user(self, user): + """Sets the user of this OptionsAccount. + + User ID # noqa: E501 + + :param user: The user of this OptionsAccount. # noqa: E501 + :type: int + """ + + self._user = user + + @property + def total(self): + """Gets the total of this OptionsAccount. # noqa: E501 + + Account Balance # noqa: E501 + + :return: The total of this OptionsAccount. # noqa: E501 + :rtype: str + """ + return self._total + + @total.setter + def total(self, total): + """Sets the total of this OptionsAccount. + + Account Balance # noqa: E501 + + :param total: The total of this OptionsAccount. # noqa: E501 + :type: str + """ + + self._total = total + + @property + def position_value(self): + """Gets the position_value of this OptionsAccount. # noqa: E501 + + Position value, long position value is positive, short position value is negative # noqa: E501 + + :return: The position_value of this OptionsAccount. # noqa: E501 + :rtype: str + """ + return self._position_value + + @position_value.setter + def position_value(self, position_value): + """Sets the position_value of this OptionsAccount. + + Position value, long position value is positive, short position value is negative # noqa: E501 + + :param position_value: The position_value of this OptionsAccount. # noqa: E501 + :type: str + """ + + self._position_value = position_value + + @property + def equity(self): + """Gets the equity of this OptionsAccount. # noqa: E501 + + Account equity, the sum of account balance and position value # noqa: E501 + + :return: The equity of this OptionsAccount. # noqa: E501 + :rtype: str + """ + return self._equity + + @equity.setter + def equity(self, equity): + """Sets the equity of this OptionsAccount. + + Account equity, the sum of account balance and position value # noqa: E501 + + :param equity: The equity of this OptionsAccount. # noqa: E501 + :type: str + """ + + self._equity = equity + + @property + def short_enabled(self): + """Gets the short_enabled of this OptionsAccount. # noqa: E501 + + If the account is allowed to short # noqa: E501 + + :return: The short_enabled of this OptionsAccount. # noqa: E501 + :rtype: bool + """ + return self._short_enabled + + @short_enabled.setter + def short_enabled(self, short_enabled): + """Sets the short_enabled of this OptionsAccount. + + If the account is allowed to short # noqa: E501 + + :param short_enabled: The short_enabled of this OptionsAccount. # noqa: E501 + :type: bool + """ + + self._short_enabled = short_enabled + + @property + def mmp_enabled(self): + """Gets the mmp_enabled of this OptionsAccount. # noqa: E501 + + Whether to enable MMP # noqa: E501 + + :return: The mmp_enabled of this OptionsAccount. # noqa: E501 + :rtype: bool + """ + return self._mmp_enabled + + @mmp_enabled.setter + def mmp_enabled(self, mmp_enabled): + """Sets the mmp_enabled of this OptionsAccount. + + Whether to enable MMP # noqa: E501 + + :param mmp_enabled: The mmp_enabled of this OptionsAccount. # noqa: E501 + :type: bool + """ + + self._mmp_enabled = mmp_enabled + + @property + def liq_triggered(self): + """Gets the liq_triggered of this OptionsAccount. # noqa: E501 + + Whether to trigger position liquidation # noqa: E501 + + :return: The liq_triggered of this OptionsAccount. # noqa: E501 + :rtype: bool + """ + return self._liq_triggered + + @liq_triggered.setter + def liq_triggered(self, liq_triggered): + """Sets the liq_triggered of this OptionsAccount. + + Whether to trigger position liquidation # noqa: E501 + + :param liq_triggered: The liq_triggered of this OptionsAccount. # noqa: E501 + :type: bool + """ + + self._liq_triggered = liq_triggered + + @property + def margin_mode(self): + """Gets the margin_mode of this OptionsAccount. # noqa: E501 + + | 保证金模式: - 0:经典现货保证金模式 - 1:跨币种保证金模式 - 2:组合保证金模式 # noqa: E501 + + :return: The margin_mode of this OptionsAccount. # noqa: E501 + :rtype: int + """ + return self._margin_mode + + @margin_mode.setter + def margin_mode(self, margin_mode): + """Sets the margin_mode of this OptionsAccount. + + | 保证金模式: - 0:经典现货保证金模式 - 1:跨币种保证金模式 - 2:组合保证金模式 # noqa: E501 + + :param margin_mode: The margin_mode of this OptionsAccount. # noqa: E501 + :type: int + """ + allowed_values = [0, 1, 2] # 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 + + @property + def unrealised_pnl(self): + """Gets the unrealised_pnl of this OptionsAccount. # noqa: E501 + + Unrealized PNL # noqa: E501 + + :return: The unrealised_pnl of this OptionsAccount. # noqa: E501 + :rtype: str + """ + return self._unrealised_pnl + + @unrealised_pnl.setter + def unrealised_pnl(self, unrealised_pnl): + """Sets the unrealised_pnl of this OptionsAccount. + + Unrealized PNL # noqa: E501 + + :param unrealised_pnl: The unrealised_pnl of this OptionsAccount. # noqa: E501 + :type: str + """ + + self._unrealised_pnl = unrealised_pnl + + @property + def init_margin(self): + """Gets the init_margin of this OptionsAccount. # noqa: E501 + + Initial position margin # noqa: E501 + + :return: The init_margin of this OptionsAccount. # noqa: E501 + :rtype: str + """ + return self._init_margin + + @init_margin.setter + def init_margin(self, init_margin): + """Sets the init_margin of this OptionsAccount. + + Initial position margin # noqa: E501 + + :param init_margin: The init_margin of this OptionsAccount. # noqa: E501 + :type: str + """ + + self._init_margin = init_margin + + @property + def maint_margin(self): + """Gets the maint_margin of this OptionsAccount. # noqa: E501 + + Position maintenance margin # noqa: E501 + + :return: The maint_margin of this OptionsAccount. # noqa: E501 + :rtype: str + """ + return self._maint_margin + + @maint_margin.setter + def maint_margin(self, maint_margin): + """Sets the maint_margin of this OptionsAccount. + + Position maintenance margin # noqa: E501 + + :param maint_margin: The maint_margin of this OptionsAccount. # noqa: E501 + :type: str + """ + + self._maint_margin = maint_margin + + @property + def order_margin(self): + """Gets the order_margin of this OptionsAccount. # noqa: E501 + + Order margin of unfinished orders # noqa: E501 + + :return: The order_margin of this OptionsAccount. # noqa: E501 + :rtype: str + """ + return self._order_margin + + @order_margin.setter + def order_margin(self, order_margin): + """Sets the order_margin of this OptionsAccount. + + Order margin of unfinished orders # noqa: E501 + + :param order_margin: The order_margin of this OptionsAccount. # noqa: E501 + :type: str + """ + + self._order_margin = order_margin + + @property + def ask_order_margin(self): + """Gets the ask_order_margin of this OptionsAccount. # noqa: E501 + + Margin for outstanding sell orders # noqa: E501 + + :return: The ask_order_margin of this OptionsAccount. # noqa: E501 + :rtype: str + """ + return self._ask_order_margin + + @ask_order_margin.setter + def ask_order_margin(self, ask_order_margin): + """Sets the ask_order_margin of this OptionsAccount. + + Margin for outstanding sell orders # noqa: E501 + + :param ask_order_margin: The ask_order_margin of this OptionsAccount. # noqa: E501 + :type: str + """ + + self._ask_order_margin = ask_order_margin + + @property + def bid_order_margin(self): + """Gets the bid_order_margin of this OptionsAccount. # noqa: E501 + + Margin for outstanding buy orders # noqa: E501 + + :return: The bid_order_margin of this OptionsAccount. # noqa: E501 + :rtype: str + """ + return self._bid_order_margin + + @bid_order_margin.setter + def bid_order_margin(self, bid_order_margin): + """Sets the bid_order_margin of this OptionsAccount. + + Margin for outstanding buy orders # noqa: E501 + + :param bid_order_margin: The bid_order_margin of this OptionsAccount. # noqa: E501 + :type: str + """ + + self._bid_order_margin = bid_order_margin + + @property + def available(self): + """Gets the available of this OptionsAccount. # noqa: E501 + + Available balance to transfer out or trade # noqa: E501 + + :return: The available of this OptionsAccount. # noqa: E501 + :rtype: str + """ + return self._available + + @available.setter + def available(self, available): + """Sets the available of this OptionsAccount. + + Available balance to transfer out or trade # noqa: E501 + + :param available: The available of this OptionsAccount. # noqa: E501 + :type: str + """ + + self._available = available + + @property + def point(self): + """Gets the point of this OptionsAccount. # noqa: E501 + + Point card amount # noqa: E501 + + :return: The point of this OptionsAccount. # noqa: E501 + :rtype: str + """ + return self._point + + @point.setter + def point(self, point): + """Sets the point of this OptionsAccount. + + Point card amount # noqa: E501 + + :param point: The point of this OptionsAccount. # noqa: E501 + :type: str + """ + + self._point = point + + @property + def currency(self): + """Gets the currency of this OptionsAccount. # noqa: E501 + + Settlement currency # noqa: E501 + + :return: The currency of this OptionsAccount. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this OptionsAccount. + + Settlement currency # noqa: E501 + + :param currency: The currency of this OptionsAccount. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def orders_limit(self): + """Gets the orders_limit of this OptionsAccount. # noqa: E501 + + Maximum number of outstanding orders # noqa: E501 + + :return: The orders_limit of this OptionsAccount. # noqa: E501 + :rtype: int + """ + return self._orders_limit + + @orders_limit.setter + def orders_limit(self, orders_limit): + """Sets the orders_limit of this OptionsAccount. + + Maximum number of outstanding orders # noqa: E501 + + :param orders_limit: The orders_limit of this OptionsAccount. # noqa: E501 + :type: int + """ + + self._orders_limit = orders_limit + + @property + def position_notional_limit(self): + """Gets the position_notional_limit of this OptionsAccount. # noqa: E501 + + Notional value upper limit, including the nominal value of positions and outstanding orders # noqa: E501 + + :return: The position_notional_limit of this OptionsAccount. # noqa: E501 + :rtype: int + """ + return self._position_notional_limit + + @position_notional_limit.setter + def position_notional_limit(self, position_notional_limit): + """Sets the position_notional_limit of this OptionsAccount. + + Notional value upper limit, including the nominal value of positions and outstanding orders # noqa: E501 + + :param position_notional_limit: The position_notional_limit of this OptionsAccount. # noqa: E501 + :type: int + """ + + self._position_notional_limit = position_notional_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, OptionsAccount): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OptionsAccount): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/options_account_book.py b/gate_api/models/options_account_book.py new file mode 100644 index 0000000..e2809e2 --- /dev/null +++ b/gate_api/models/options_account_book.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 OptionsAccountBook(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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': 'float', + 'change': 'str', + 'balance': 'str', + 'type': 'str', + 'text': 'str' + } + + attribute_map = { + 'time': 'time', + 'change': 'change', + 'balance': 'balance', + 'type': 'type', + 'text': 'text' + } + + def __init__(self, time=None, change=None, balance=None, type=None, text=None, local_vars_configuration=None): # noqa: E501 + # type: (float, str, str, str, str, Configuration) -> None + """OptionsAccountBook - a 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._change = None + self._balance = None + self._type = None + self._text = None + self.discriminator = None + + if time is not None: + self.time = time + if change is not None: + self.change = change + if balance is not None: + self.balance = balance + if type is not None: + self.type = type + if text is not None: + self.text = text + + @property + def time(self): + """Gets the time of this OptionsAccountBook. # noqa: E501 + + Change time # noqa: E501 + + :return: The time of this OptionsAccountBook. # noqa: E501 + :rtype: float + """ + return self._time + + @time.setter + def time(self, time): + """Sets the time of this OptionsAccountBook. + + Change time # noqa: E501 + + :param time: The time of this OptionsAccountBook. # noqa: E501 + :type: float + """ + + self._time = time + + @property + def change(self): + """Gets the change of this OptionsAccountBook. # noqa: E501 + + Amount changed (USDT) # noqa: E501 + + :return: The change of this OptionsAccountBook. # noqa: E501 + :rtype: str + """ + return self._change + + @change.setter + def change(self, change): + """Sets the change of this OptionsAccountBook. + + Amount changed (USDT) # noqa: E501 + + :param change: The change of this OptionsAccountBook. # noqa: E501 + :type: str + """ + + self._change = change + + @property + def balance(self): + """Gets the balance of this OptionsAccountBook. # noqa: E501 + + Account total balance after change (USDT) # noqa: E501 + + :return: The balance of this OptionsAccountBook. # noqa: E501 + :rtype: str + """ + return self._balance + + @balance.setter + def balance(self, balance): + """Sets the balance of this OptionsAccountBook. + + Account total balance after change (USDT) # noqa: E501 + + :param balance: The balance of this OptionsAccountBook. # noqa: E501 + :type: str + """ + + self._balance = balance + + @property + def type(self): + """Gets the type of this OptionsAccountBook. # noqa: E501 + + Changing Type: - dnw: Deposit & Withdraw - prem: Trading premium - fee: Trading fee - refr: Referrer rebate - point_dnw: point_fee: POINT Trading fee - point_refr: POINT Referrer rebate # noqa: E501 + + :return: The type of this OptionsAccountBook. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this OptionsAccountBook. + + Changing Type: - dnw: Deposit & Withdraw - prem: Trading premium - fee: Trading fee - refr: Referrer rebate - point_dnw: point_fee: POINT Trading fee - point_refr: POINT Referrer rebate # noqa: E501 + + :param type: The type of this OptionsAccountBook. # noqa: E501 + :type: str + """ + + self._type = type + + @property + def text(self): + """Gets the text of this OptionsAccountBook. # noqa: E501 + + Remark # noqa: E501 + + :return: The text of this OptionsAccountBook. # noqa: E501 + :rtype: str + """ + return self._text + + @text.setter + def text(self, text): + """Sets the text of this OptionsAccountBook. + + Remark # noqa: E501 + + :param text: The text of this OptionsAccountBook. # 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, OptionsAccountBook): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OptionsAccountBook): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/options_candlestick.py b/gate_api/models/options_candlestick.py new file mode 100644 index 0000000..a41ffe9 --- /dev/null +++ b/gate_api/models/options_candlestick.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 OptionsCandlestick(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 't': 'float', + 'v': 'int', + 'c': 'str', + 'h': 'str', + 'l': 'str', + 'o': 'str' + } + + attribute_map = { + 't': 't', + 'v': 'v', + 'c': 'c', + 'h': 'h', + 'l': 'l', + 'o': 'o' + } + + def __init__(self, t=None, v=None, c=None, h=None, l=None, o=None, local_vars_configuration=None): # noqa: E501 + # type: (float, int, str, str, str, str, Configuration) -> None + """OptionsCandlestick - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._t = None + self._v = None + self._c = None + self._h = None + self._l = None + self._o = None + self.discriminator = None + + if t is not None: + self.t = t + if v is not None: + self.v = v + 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 o is not None: + self.o = o + + @property + def t(self): + """Gets the t of this OptionsCandlestick. # noqa: E501 + + Unix timestamp in seconds # noqa: E501 + + :return: The t of this OptionsCandlestick. # noqa: E501 + :rtype: float + """ + return self._t + + @t.setter + def t(self, t): + """Sets the t of this OptionsCandlestick. + + Unix timestamp in seconds # noqa: E501 + + :param t: The t of this OptionsCandlestick. # noqa: E501 + :type: float + """ + + self._t = t + + @property + def v(self): + """Gets the v of this OptionsCandlestick. # noqa: E501 + + size volume (contract size). Only returned if `contract` is not prefixed # noqa: E501 + + :return: The v of this OptionsCandlestick. # noqa: E501 + :rtype: int + """ + return self._v + + @v.setter + def v(self, v): + """Sets the v of this OptionsCandlestick. + + size volume (contract size). Only returned if `contract` is not prefixed # noqa: E501 + + :param v: The v of this OptionsCandlestick. # noqa: E501 + :type: int + """ + + self._v = v + + @property + def c(self): + """Gets the c of this OptionsCandlestick. # noqa: E501 + + Close price (quote currency, unit: underlying corresponding option price) # noqa: E501 + + :return: The c of this OptionsCandlestick. # noqa: E501 + :rtype: str + """ + return self._c + + @c.setter + def c(self, c): + """Sets the c of this OptionsCandlestick. + + Close price (quote currency, unit: underlying corresponding option price) # noqa: E501 + + :param c: The c of this OptionsCandlestick. # noqa: E501 + :type: str + """ + + self._c = c + + @property + def h(self): + """Gets the h of this OptionsCandlestick. # noqa: E501 + + Highest price (quote currency, unit: underlying corresponding option price) # noqa: E501 + + :return: The h of this OptionsCandlestick. # noqa: E501 + :rtype: str + """ + return self._h + + @h.setter + def h(self, h): + """Sets the h of this OptionsCandlestick. + + Highest price (quote currency, unit: underlying corresponding option price) # noqa: E501 + + :param h: The h of this OptionsCandlestick. # noqa: E501 + :type: str + """ + + self._h = h + + @property + def l(self): + """Gets the l of this OptionsCandlestick. # noqa: E501 + + Lowest price (quote currency, unit: underlying corresponding option price) # noqa: E501 + + :return: The l of this OptionsCandlestick. # noqa: E501 + :rtype: str + """ + return self._l + + @l.setter + def l(self, l): + """Sets the l of this OptionsCandlestick. + + Lowest price (quote currency, unit: underlying corresponding option price) # noqa: E501 + + :param l: The l of this OptionsCandlestick. # noqa: E501 + :type: str + """ + + self._l = l + + @property + def o(self): + """Gets the o of this OptionsCandlestick. # noqa: E501 + + Open price (quote currency, unit: underlying corresponding option price) # noqa: E501 + + :return: The o of this OptionsCandlestick. # noqa: E501 + :rtype: str + """ + return self._o + + @o.setter + def o(self, o): + """Sets the o of this OptionsCandlestick. + + Open price (quote currency, unit: underlying corresponding option price) # noqa: E501 + + :param o: The o of this OptionsCandlestick. # noqa: E501 + :type: str + """ + + self._o = o + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OptionsCandlestick): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OptionsCandlestick): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/options_contract.py b/gate_api/models/options_contract.py new file mode 100644 index 0000000..2aec77e --- /dev/null +++ b/gate_api/models/options_contract.py @@ -0,0 +1,795 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OptionsContract(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'tag': 'str', + 'create_time': 'float', + 'expiration_time': 'float', + 'is_call': 'bool', + 'multiplier': 'str', + 'underlying': 'str', + 'underlying_price': 'str', + 'last_price': 'str', + 'mark_price': 'str', + 'index_price': 'str', + 'maker_fee_rate': 'str', + 'taker_fee_rate': 'str', + 'order_price_round': 'str', + 'mark_price_round': 'str', + 'order_size_min': 'int', + 'order_size_max': 'int', + 'order_price_deviate': 'str', + 'ref_discount_rate': 'str', + 'ref_rebate_rate': 'str', + 'orderbook_id': 'int', + 'trade_id': 'int', + 'trade_size': 'int', + 'position_size': 'int', + 'orders_limit': 'int' + } + + attribute_map = { + 'name': 'name', + 'tag': 'tag', + 'create_time': 'create_time', + 'expiration_time': 'expiration_time', + 'is_call': 'is_call', + 'multiplier': 'multiplier', + 'underlying': 'underlying', + 'underlying_price': 'underlying_price', + 'last_price': 'last_price', + 'mark_price': 'mark_price', + 'index_price': 'index_price', + 'maker_fee_rate': 'maker_fee_rate', + 'taker_fee_rate': 'taker_fee_rate', + 'order_price_round': 'order_price_round', + 'mark_price_round': 'mark_price_round', + 'order_size_min': 'order_size_min', + 'order_size_max': 'order_size_max', + 'order_price_deviate': 'order_price_deviate', + 'ref_discount_rate': 'ref_discount_rate', + 'ref_rebate_rate': 'ref_rebate_rate', + 'orderbook_id': 'orderbook_id', + 'trade_id': 'trade_id', + 'trade_size': 'trade_size', + 'position_size': 'position_size', + 'orders_limit': 'orders_limit' + } + + def __init__(self, name=None, tag=None, create_time=None, expiration_time=None, is_call=None, multiplier=None, underlying=None, underlying_price=None, last_price=None, mark_price=None, index_price=None, maker_fee_rate=None, taker_fee_rate=None, order_price_round=None, mark_price_round=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, orders_limit=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, float, float, bool, str, str, str, str, str, str, str, str, str, str, int, int, str, str, str, int, int, int, int, int, Configuration) -> None + """OptionsContract - a 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._tag = None + self._create_time = None + self._expiration_time = None + self._is_call = None + self._multiplier = None + self._underlying = None + self._underlying_price = None + self._last_price = None + self._mark_price = None + self._index_price = None + self._maker_fee_rate = None + self._taker_fee_rate = None + self._order_price_round = None + self._mark_price_round = None + self._order_size_min = None + self._order_size_max = None + self._order_price_deviate = None + self._ref_discount_rate = None + self._ref_rebate_rate = None + self._orderbook_id = None + self._trade_id = None + self._trade_size = None + self._position_size = None + self._orders_limit = None + self.discriminator = None + + if name is not None: + self.name = name + if tag is not None: + self.tag = tag + if create_time is not None: + self.create_time = create_time + if expiration_time is not None: + self.expiration_time = expiration_time + if is_call is not None: + self.is_call = is_call + if multiplier is not None: + self.multiplier = multiplier + if underlying is not None: + self.underlying = underlying + if underlying_price is not None: + self.underlying_price = underlying_price + if last_price is not None: + self.last_price = last_price + if mark_price is not None: + self.mark_price = mark_price + if index_price is not None: + self.index_price = index_price + if maker_fee_rate is not None: + self.maker_fee_rate = maker_fee_rate + if taker_fee_rate is not None: + self.taker_fee_rate = taker_fee_rate + if order_price_round is not None: + self.order_price_round = order_price_round + if mark_price_round is not None: + self.mark_price_round = mark_price_round + if order_size_min is not None: + self.order_size_min = order_size_min + if order_size_max is not None: + self.order_size_max = order_size_max + if order_price_deviate is not None: + self.order_price_deviate = order_price_deviate + if ref_discount_rate is not None: + self.ref_discount_rate = ref_discount_rate + if ref_rebate_rate is not None: + self.ref_rebate_rate = ref_rebate_rate + if orderbook_id is not None: + self.orderbook_id = orderbook_id + if trade_id is not None: + self.trade_id = trade_id + if trade_size is not None: + self.trade_size = trade_size + if position_size is not None: + self.position_size = position_size + if orders_limit is not None: + self.orders_limit = orders_limit + + @property + def name(self): + """Gets the name of this OptionsContract. # noqa: E501 + + Options contract name # noqa: E501 + + :return: The name of this OptionsContract. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this OptionsContract. + + Options contract name # noqa: E501 + + :param name: The name of this OptionsContract. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def tag(self): + """Gets the tag of this OptionsContract. # noqa: E501 + + Tag # noqa: E501 + + :return: The tag of this OptionsContract. # noqa: E501 + :rtype: str + """ + return self._tag + + @tag.setter + def tag(self, tag): + """Sets the tag of this OptionsContract. + + Tag # noqa: E501 + + :param tag: The tag of this OptionsContract. # noqa: E501 + :type: str + """ + + self._tag = tag + + @property + def create_time(self): + """Gets the create_time of this OptionsContract. # noqa: E501 + + Created time # noqa: E501 + + :return: The create_time of this OptionsContract. # noqa: E501 + :rtype: float + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this OptionsContract. + + Created time # noqa: E501 + + :param create_time: The create_time of this OptionsContract. # noqa: E501 + :type: float + """ + + self._create_time = create_time + + @property + def expiration_time(self): + """Gets the expiration_time of this OptionsContract. # noqa: E501 + + Expiration time # noqa: E501 + + :return: The expiration_time of this OptionsContract. # noqa: E501 + :rtype: float + """ + return self._expiration_time + + @expiration_time.setter + def expiration_time(self, expiration_time): + """Sets the expiration_time of this OptionsContract. + + Expiration time # noqa: E501 + + :param expiration_time: The expiration_time of this OptionsContract. # noqa: E501 + :type: float + """ + + self._expiration_time = expiration_time + + @property + def is_call(self): + """Gets the is_call of this OptionsContract. # noqa: E501 + + `true` means call options, `false` means put options # noqa: E501 + + :return: The is_call of this OptionsContract. # noqa: E501 + :rtype: bool + """ + return self._is_call + + @is_call.setter + def is_call(self, is_call): + """Sets the is_call of this OptionsContract. + + `true` means call options, `false` means put options # noqa: E501 + + :param is_call: The is_call of this OptionsContract. # noqa: E501 + :type: bool + """ + + self._is_call = is_call + + @property + def multiplier(self): + """Gets the multiplier of this OptionsContract. # noqa: E501 + + Multiplier used in converting from invoicing to settlement currency # noqa: E501 + + :return: The multiplier of this OptionsContract. # noqa: E501 + :rtype: str + """ + return self._multiplier + + @multiplier.setter + def multiplier(self, multiplier): + """Sets the multiplier of this OptionsContract. + + Multiplier used in converting from invoicing to settlement currency # noqa: E501 + + :param multiplier: The multiplier of this OptionsContract. # noqa: E501 + :type: str + """ + + self._multiplier = multiplier + + @property + def underlying(self): + """Gets the underlying of this OptionsContract. # noqa: E501 + + Underlying # noqa: E501 + + :return: The underlying of this OptionsContract. # noqa: E501 + :rtype: str + """ + return self._underlying + + @underlying.setter + def underlying(self, underlying): + """Sets the underlying of this OptionsContract. + + Underlying # noqa: E501 + + :param underlying: The underlying of this OptionsContract. # noqa: E501 + :type: str + """ + + self._underlying = underlying + + @property + def underlying_price(self): + """Gets the underlying_price of this OptionsContract. # noqa: E501 + + Underlying price (quote currency) # noqa: E501 + + :return: The underlying_price of this OptionsContract. # noqa: E501 + :rtype: str + """ + return self._underlying_price + + @underlying_price.setter + def underlying_price(self, underlying_price): + """Sets the underlying_price of this OptionsContract. + + Underlying price (quote currency) # noqa: E501 + + :param underlying_price: The underlying_price of this OptionsContract. # noqa: E501 + :type: str + """ + + self._underlying_price = underlying_price + + @property + def last_price(self): + """Gets the last_price of this OptionsContract. # noqa: E501 + + Last trading price # noqa: E501 + + :return: The last_price of this OptionsContract. # noqa: E501 + :rtype: str + """ + return self._last_price + + @last_price.setter + def last_price(self, last_price): + """Sets the last_price of this OptionsContract. + + Last trading price # noqa: E501 + + :param last_price: The last_price of this OptionsContract. # noqa: E501 + :type: str + """ + + self._last_price = last_price + + @property + def mark_price(self): + """Gets the mark_price of this OptionsContract. # noqa: E501 + + Current mark price (quote currency) # noqa: E501 + + :return: The mark_price of this OptionsContract. # noqa: E501 + :rtype: str + """ + return self._mark_price + + @mark_price.setter + def mark_price(self, mark_price): + """Sets the mark_price of this OptionsContract. + + Current mark price (quote currency) # noqa: E501 + + :param mark_price: The mark_price of this OptionsContract. # noqa: E501 + :type: str + """ + + self._mark_price = mark_price + + @property + def index_price(self): + """Gets the index_price of this OptionsContract. # noqa: E501 + + Current index price (quote currency) # noqa: E501 + + :return: The index_price of this OptionsContract. # noqa: E501 + :rtype: str + """ + return self._index_price + + @index_price.setter + def index_price(self, index_price): + """Sets the index_price of this OptionsContract. + + Current index price (quote currency) # noqa: E501 + + :param index_price: The index_price of this OptionsContract. # noqa: E501 + :type: str + """ + + self._index_price = index_price + + @property + def maker_fee_rate(self): + """Gets the maker_fee_rate of this OptionsContract. # noqa: E501 + + Maker fee rate, negative values indicate rebates # noqa: E501 + + :return: The maker_fee_rate of this OptionsContract. # 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 OptionsContract. + + Maker fee rate, negative values indicate rebates # noqa: E501 + + :param maker_fee_rate: The maker_fee_rate of this OptionsContract. # noqa: E501 + :type: str + """ + + self._maker_fee_rate = maker_fee_rate + + @property + def taker_fee_rate(self): + """Gets the taker_fee_rate of this OptionsContract. # noqa: E501 + + Taker fee rate # noqa: E501 + + :return: The taker_fee_rate of this OptionsContract. # 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 OptionsContract. + + Taker fee rate # noqa: E501 + + :param taker_fee_rate: The taker_fee_rate of this OptionsContract. # noqa: E501 + :type: str + """ + + self._taker_fee_rate = taker_fee_rate + + @property + def order_price_round(self): + """Gets the order_price_round of this OptionsContract. # noqa: E501 + + Minimum order price increment # noqa: E501 + + :return: The order_price_round of this OptionsContract. # noqa: E501 + :rtype: str + """ + return self._order_price_round + + @order_price_round.setter + def order_price_round(self, order_price_round): + """Sets the order_price_round of this OptionsContract. + + Minimum order price increment # noqa: E501 + + :param order_price_round: The order_price_round of this OptionsContract. # noqa: E501 + :type: str + """ + + self._order_price_round = order_price_round + + @property + def mark_price_round(self): + """Gets the mark_price_round of this OptionsContract. # noqa: E501 + + Minimum mark price increment # noqa: E501 + + :return: The mark_price_round of this OptionsContract. # noqa: E501 + :rtype: str + """ + return self._mark_price_round + + @mark_price_round.setter + def mark_price_round(self, mark_price_round): + """Sets the mark_price_round of this OptionsContract. + + Minimum mark price increment # noqa: E501 + + :param mark_price_round: The mark_price_round of this OptionsContract. # noqa: E501 + :type: str + """ + + self._mark_price_round = mark_price_round + + @property + def order_size_min(self): + """Gets the order_size_min of this OptionsContract. # noqa: E501 + + Minimum order size allowed by the contract # noqa: E501 + + :return: The order_size_min of this OptionsContract. # noqa: E501 + :rtype: int + """ + return self._order_size_min + + @order_size_min.setter + 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 + + :param order_size_min: The order_size_min of this OptionsContract. # noqa: E501 + :type: int + """ + + self._order_size_min = order_size_min + + @property + def order_size_max(self): + """Gets the order_size_max of this OptionsContract. # noqa: E501 + + Maximum order size allowed by the contract # noqa: E501 + + :return: The order_size_max of this OptionsContract. # noqa: E501 + :rtype: int + """ + return self._order_size_max + + @order_size_max.setter + 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 + + :param order_size_max: The order_size_max of this OptionsContract. # noqa: E501 + :type: int + """ + + self._order_size_max = order_size_max + + @property + def order_price_deviate(self): + """Gets the order_price_deviate of this OptionsContract. # noqa: E501 + + The positive and negative offset allowed between the order price and the current mark price, that `order_price` must meet the following conditions: order_price is within the range of mark_price +/- order_price_deviate * underlying_price and does not distinguish between buy and sell orders # noqa: E501 + + :return: The order_price_deviate of this OptionsContract. # noqa: E501 + :rtype: str + """ + return self._order_price_deviate + + @order_price_deviate.setter + def order_price_deviate(self, order_price_deviate): + """Sets the order_price_deviate of this OptionsContract. + + The positive and negative offset allowed between the order price and the current mark price, that `order_price` must meet the following conditions: order_price is within the range of mark_price +/- order_price_deviate * underlying_price and does not distinguish between buy and sell orders # noqa: E501 + + :param order_price_deviate: The order_price_deviate of this OptionsContract. # noqa: E501 + :type: str + """ + + self._order_price_deviate = order_price_deviate + + @property + def ref_discount_rate(self): + """Gets the ref_discount_rate of this OptionsContract. # noqa: E501 + + Trading fee discount for referred users # noqa: E501 + + :return: The ref_discount_rate of this OptionsContract. # noqa: E501 + :rtype: str + """ + return self._ref_discount_rate + + @ref_discount_rate.setter + def ref_discount_rate(self, ref_discount_rate): + """Sets the ref_discount_rate of this OptionsContract. + + Trading fee discount for referred users # noqa: E501 + + :param ref_discount_rate: The ref_discount_rate of this OptionsContract. # noqa: E501 + :type: str + """ + + self._ref_discount_rate = ref_discount_rate + + @property + def ref_rebate_rate(self): + """Gets the ref_rebate_rate of this OptionsContract. # noqa: E501 + + Commission rate for referrers # noqa: E501 + + :return: The ref_rebate_rate of this OptionsContract. # noqa: E501 + :rtype: str + """ + return self._ref_rebate_rate + + @ref_rebate_rate.setter + def ref_rebate_rate(self, ref_rebate_rate): + """Sets the ref_rebate_rate of this OptionsContract. + + Commission rate for referrers # noqa: E501 + + :param ref_rebate_rate: The ref_rebate_rate of this OptionsContract. # noqa: E501 + :type: str + """ + + self._ref_rebate_rate = ref_rebate_rate + + @property + def orderbook_id(self): + """Gets the orderbook_id of this OptionsContract. # noqa: E501 + + Orderbook update ID # noqa: E501 + + :return: The orderbook_id of this OptionsContract. # noqa: E501 + :rtype: int + """ + return self._orderbook_id + + @orderbook_id.setter + def orderbook_id(self, orderbook_id): + """Sets the orderbook_id of this OptionsContract. + + Orderbook update ID # noqa: E501 + + :param orderbook_id: The orderbook_id of this OptionsContract. # noqa: E501 + :type: int + """ + + self._orderbook_id = orderbook_id + + @property + def trade_id(self): + """Gets the trade_id of this OptionsContract. # noqa: E501 + + Current trade ID # noqa: E501 + + :return: The trade_id of this OptionsContract. # noqa: E501 + :rtype: int + """ + return self._trade_id + + @trade_id.setter + def trade_id(self, trade_id): + """Sets the trade_id of this OptionsContract. + + Current trade ID # noqa: E501 + + :param trade_id: The trade_id of this OptionsContract. # noqa: E501 + :type: int + """ + + self._trade_id = trade_id + + @property + def trade_size(self): + """Gets the trade_size of this OptionsContract. # noqa: E501 + + Historical cumulative trading volume # noqa: E501 + + :return: The trade_size of this OptionsContract. # noqa: E501 + :rtype: int + """ + return self._trade_size + + @trade_size.setter + def trade_size(self, trade_size): + """Sets the trade_size of this OptionsContract. + + Historical cumulative trading volume # noqa: E501 + + :param trade_size: The trade_size of this OptionsContract. # noqa: E501 + :type: int + """ + + self._trade_size = trade_size + + @property + def position_size(self): + """Gets the position_size of this OptionsContract. # noqa: E501 + + Current total long position size # noqa: E501 + + :return: The position_size of this OptionsContract. # noqa: E501 + :rtype: int + """ + return self._position_size + + @position_size.setter + def position_size(self, position_size): + """Sets the position_size of this OptionsContract. + + Current total long position size # noqa: E501 + + :param position_size: The position_size of this OptionsContract. # noqa: E501 + :type: int + """ + + self._position_size = position_size + + @property + def orders_limit(self): + """Gets the orders_limit of this OptionsContract. # noqa: E501 + + Maximum number of pending orders # noqa: E501 + + :return: The orders_limit of this OptionsContract. # noqa: E501 + :rtype: int + """ + return self._orders_limit + + @orders_limit.setter + def orders_limit(self, orders_limit): + """Sets the orders_limit of this OptionsContract. + + Maximum number of pending orders # noqa: E501 + + :param orders_limit: The orders_limit of this OptionsContract. # noqa: E501 + :type: int + """ + + self._orders_limit = orders_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, OptionsContract): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OptionsContract): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/options_mmp.py b/gate_api/models/options_mmp.py new file mode 100644 index 0000000..5594392 --- /dev/null +++ b/gate_api/models/options_mmp.py @@ -0,0 +1,296 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OptionsMMP(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'underlying': 'str', + 'window': 'int', + 'frozen_period': 'int', + 'qty_limit': 'str', + 'delta_limit': 'str', + 'trigger_time_ms': 'int', + 'frozen_until_ms': 'int' + } + + attribute_map = { + 'underlying': 'underlying', + 'window': 'window', + 'frozen_period': 'frozen_period', + 'qty_limit': 'qty_limit', + 'delta_limit': 'delta_limit', + 'trigger_time_ms': 'trigger_time_ms', + 'frozen_until_ms': 'frozen_until_ms' + } + + def __init__(self, underlying=None, window=None, frozen_period=None, qty_limit=None, delta_limit=None, trigger_time_ms=None, frozen_until_ms=None, local_vars_configuration=None): # noqa: E501 + # type: (str, int, int, str, str, int, int, Configuration) -> None + """OptionsMMP - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._underlying = None + self._window = None + self._frozen_period = None + self._qty_limit = None + self._delta_limit = None + self._trigger_time_ms = None + self._frozen_until_ms = None + self.discriminator = None + + self.underlying = underlying + self.window = window + self.frozen_period = frozen_period + self.qty_limit = qty_limit + self.delta_limit = delta_limit + if trigger_time_ms is not None: + self.trigger_time_ms = trigger_time_ms + if frozen_until_ms is not None: + self.frozen_until_ms = frozen_until_ms + + @property + def underlying(self): + """Gets the underlying of this OptionsMMP. # noqa: E501 + + Underlying # noqa: E501 + + :return: The underlying of this OptionsMMP. # noqa: E501 + :rtype: str + """ + return self._underlying + + @underlying.setter + def underlying(self, underlying): + """Sets the underlying of this OptionsMMP. + + Underlying # noqa: E501 + + :param underlying: The underlying of this OptionsMMP. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and underlying is None: # noqa: E501 + raise ValueError("Invalid value for `underlying`, must not be `None`") # noqa: E501 + + self._underlying = underlying + + @property + def window(self): + """Gets the window of this OptionsMMP. # noqa: E501 + + Time window (milliseconds), between 1-5000, 0 means disable MMP # noqa: E501 + + :return: The window of this OptionsMMP. # noqa: E501 + :rtype: int + """ + return self._window + + @window.setter + def window(self, window): + """Sets the window of this OptionsMMP. + + Time window (milliseconds), between 1-5000, 0 means disable MMP # noqa: E501 + + :param window: The window of this OptionsMMP. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and window is None: # noqa: E501 + raise ValueError("Invalid value for `window`, must not be `None`") # noqa: E501 + + self._window = window + + @property + def frozen_period(self): + """Gets the frozen_period of this OptionsMMP. # noqa: E501 + + Freeze duration (milliseconds), 0 means always frozen, need to call reset API to unfreeze # noqa: E501 + + :return: The frozen_period of this OptionsMMP. # noqa: E501 + :rtype: int + """ + return self._frozen_period + + @frozen_period.setter + def frozen_period(self, frozen_period): + """Sets the frozen_period of this OptionsMMP. + + Freeze duration (milliseconds), 0 means always frozen, need to call reset API to unfreeze # noqa: E501 + + :param frozen_period: The frozen_period of this OptionsMMP. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and frozen_period is None: # noqa: E501 + raise ValueError("Invalid value for `frozen_period`, must not be `None`") # noqa: E501 + + self._frozen_period = frozen_period + + @property + def qty_limit(self): + """Gets the qty_limit of this OptionsMMP. # noqa: E501 + + Trading volume upper limit (positive number, up to 2 decimal places) # noqa: E501 + + :return: The qty_limit of this OptionsMMP. # noqa: E501 + :rtype: str + """ + return self._qty_limit + + @qty_limit.setter + def qty_limit(self, qty_limit): + """Sets the qty_limit of this OptionsMMP. + + Trading volume upper limit (positive number, up to 2 decimal places) # noqa: E501 + + :param qty_limit: The qty_limit of this OptionsMMP. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and qty_limit is None: # noqa: E501 + raise ValueError("Invalid value for `qty_limit`, must not be `None`") # noqa: E501 + + self._qty_limit = qty_limit + + @property + def delta_limit(self): + """Gets the delta_limit of this OptionsMMP. # noqa: E501 + + Upper limit of net delta value (positive number, up to 2 decimal places) # noqa: E501 + + :return: The delta_limit of this OptionsMMP. # noqa: E501 + :rtype: str + """ + return self._delta_limit + + @delta_limit.setter + def delta_limit(self, delta_limit): + """Sets the delta_limit of this OptionsMMP. + + Upper limit of net delta value (positive number, up to 2 decimal places) # noqa: E501 + + :param delta_limit: The delta_limit of this OptionsMMP. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and delta_limit is None: # noqa: E501 + raise ValueError("Invalid value for `delta_limit`, must not be `None`") # noqa: E501 + + self._delta_limit = delta_limit + + @property + def trigger_time_ms(self): + """Gets the trigger_time_ms of this OptionsMMP. # noqa: E501 + + Trigger freeze time (milliseconds), 0 means no freeze is triggered # noqa: E501 + + :return: The trigger_time_ms of this OptionsMMP. # noqa: E501 + :rtype: int + """ + return self._trigger_time_ms + + @trigger_time_ms.setter + def trigger_time_ms(self, trigger_time_ms): + """Sets the trigger_time_ms of this OptionsMMP. + + Trigger freeze time (milliseconds), 0 means no freeze is triggered # noqa: E501 + + :param trigger_time_ms: The trigger_time_ms of this OptionsMMP. # noqa: E501 + :type: int + """ + + self._trigger_time_ms = trigger_time_ms + + @property + def frozen_until_ms(self): + """Gets the frozen_until_ms of this OptionsMMP. # noqa: E501 + + Unfreeze time (milliseconds). If the freeze duration is not configured, there will be no unfreeze time after the freeze is triggered # noqa: E501 + + :return: The frozen_until_ms of this OptionsMMP. # noqa: E501 + :rtype: int + """ + return self._frozen_until_ms + + @frozen_until_ms.setter + def frozen_until_ms(self, frozen_until_ms): + """Sets the frozen_until_ms of this OptionsMMP. + + Unfreeze time (milliseconds). If the freeze duration is not configured, there will be no unfreeze time after the freeze is triggered # noqa: E501 + + :param frozen_until_ms: The frozen_until_ms of this OptionsMMP. # noqa: E501 + :type: int + """ + + self._frozen_until_ms = frozen_until_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, OptionsMMP): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OptionsMMP): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/options_mmp_reset.py b/gate_api/models/options_mmp_reset.py new file mode 100644 index 0000000..78658ba --- /dev/null +++ b/gate_api/models/options_mmp_reset.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 OptionsMMPReset(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'underlying': 'str', + 'window': 'int', + 'frozen_period': 'int', + 'qty_limit': 'str', + 'delta_limit': 'str', + 'trigger_time_ms': 'int', + 'frozen_until_ms': 'int' + } + + attribute_map = { + 'underlying': 'underlying', + 'window': 'window', + 'frozen_period': 'frozen_period', + 'qty_limit': 'qty_limit', + 'delta_limit': 'delta_limit', + 'trigger_time_ms': 'trigger_time_ms', + 'frozen_until_ms': 'frozen_until_ms' + } + + def __init__(self, underlying=None, window=None, frozen_period=None, qty_limit=None, delta_limit=None, trigger_time_ms=None, frozen_until_ms=None, local_vars_configuration=None): # noqa: E501 + # type: (str, int, int, str, str, int, int, Configuration) -> None + """OptionsMMPReset - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._underlying = None + self._window = None + self._frozen_period = None + self._qty_limit = None + self._delta_limit = None + self._trigger_time_ms = None + self._frozen_until_ms = None + self.discriminator = None + + self.underlying = underlying + if window is not None: + self.window = window + if frozen_period is not None: + self.frozen_period = frozen_period + if qty_limit is not None: + self.qty_limit = qty_limit + if delta_limit is not None: + self.delta_limit = delta_limit + if trigger_time_ms is not None: + self.trigger_time_ms = trigger_time_ms + if frozen_until_ms is not None: + self.frozen_until_ms = frozen_until_ms + + @property + def underlying(self): + """Gets the underlying of this OptionsMMPReset. # noqa: E501 + + Underlying # noqa: E501 + + :return: The underlying of this OptionsMMPReset. # noqa: E501 + :rtype: str + """ + return self._underlying + + @underlying.setter + def underlying(self, underlying): + """Sets the underlying of this OptionsMMPReset. + + Underlying # noqa: E501 + + :param underlying: The underlying of this OptionsMMPReset. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and underlying is None: # noqa: E501 + raise ValueError("Invalid value for `underlying`, must not be `None`") # noqa: E501 + + self._underlying = underlying + + @property + def window(self): + """Gets the window of this OptionsMMPReset. # noqa: E501 + + Time window (milliseconds), between 1-5000, 0 means disable MMP # noqa: E501 + + :return: The window of this OptionsMMPReset. # noqa: E501 + :rtype: int + """ + return self._window + + @window.setter + def window(self, window): + """Sets the window of this OptionsMMPReset. + + Time window (milliseconds), between 1-5000, 0 means disable MMP # noqa: E501 + + :param window: The window of this OptionsMMPReset. # noqa: E501 + :type: int + """ + + self._window = window + + @property + def frozen_period(self): + """Gets the frozen_period of this OptionsMMPReset. # noqa: E501 + + Freeze duration (milliseconds), 0 means always frozen, need to call reset API to unfreeze # noqa: E501 + + :return: The frozen_period of this OptionsMMPReset. # noqa: E501 + :rtype: int + """ + return self._frozen_period + + @frozen_period.setter + def frozen_period(self, frozen_period): + """Sets the frozen_period of this OptionsMMPReset. + + Freeze duration (milliseconds), 0 means always frozen, need to call reset API to unfreeze # noqa: E501 + + :param frozen_period: The frozen_period of this OptionsMMPReset. # noqa: E501 + :type: int + """ + + self._frozen_period = frozen_period + + @property + def qty_limit(self): + """Gets the qty_limit of this OptionsMMPReset. # noqa: E501 + + Trading volume upper limit (positive number, up to 2 decimal places) # noqa: E501 + + :return: The qty_limit of this OptionsMMPReset. # noqa: E501 + :rtype: str + """ + return self._qty_limit + + @qty_limit.setter + def qty_limit(self, qty_limit): + """Sets the qty_limit of this OptionsMMPReset. + + Trading volume upper limit (positive number, up to 2 decimal places) # noqa: E501 + + :param qty_limit: The qty_limit of this OptionsMMPReset. # noqa: E501 + :type: str + """ + + self._qty_limit = qty_limit + + @property + def delta_limit(self): + """Gets the delta_limit of this OptionsMMPReset. # noqa: E501 + + Upper limit of net delta value (positive number, up to 2 decimal places) # noqa: E501 + + :return: The delta_limit of this OptionsMMPReset. # noqa: E501 + :rtype: str + """ + return self._delta_limit + + @delta_limit.setter + def delta_limit(self, delta_limit): + """Sets the delta_limit of this OptionsMMPReset. + + Upper limit of net delta value (positive number, up to 2 decimal places) # noqa: E501 + + :param delta_limit: The delta_limit of this OptionsMMPReset. # noqa: E501 + :type: str + """ + + self._delta_limit = delta_limit + + @property + def trigger_time_ms(self): + """Gets the trigger_time_ms of this OptionsMMPReset. # noqa: E501 + + Trigger freeze time (milliseconds), 0 means no freeze is triggered # noqa: E501 + + :return: The trigger_time_ms of this OptionsMMPReset. # noqa: E501 + :rtype: int + """ + return self._trigger_time_ms + + @trigger_time_ms.setter + def trigger_time_ms(self, trigger_time_ms): + """Sets the trigger_time_ms of this OptionsMMPReset. + + Trigger freeze time (milliseconds), 0 means no freeze is triggered # noqa: E501 + + :param trigger_time_ms: The trigger_time_ms of this OptionsMMPReset. # noqa: E501 + :type: int + """ + + self._trigger_time_ms = trigger_time_ms + + @property + def frozen_until_ms(self): + """Gets the frozen_until_ms of this OptionsMMPReset. # noqa: E501 + + Unfreeze time (milliseconds). If the freeze duration is not configured, there will be no unfreeze time after the freeze is triggered # noqa: E501 + + :return: The frozen_until_ms of this OptionsMMPReset. # noqa: E501 + :rtype: int + """ + return self._frozen_until_ms + + @frozen_until_ms.setter + def frozen_until_ms(self, frozen_until_ms): + """Sets the frozen_until_ms of this OptionsMMPReset. + + Unfreeze time (milliseconds). If the freeze duration is not configured, there will be no unfreeze time after the freeze is triggered # noqa: E501 + + :param frozen_until_ms: The frozen_until_ms of this OptionsMMPReset. # noqa: E501 + :type: int + """ + + self._frozen_until_ms = frozen_until_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, OptionsMMPReset): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OptionsMMPReset): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/options_my_settlements.py b/gate_api/models/options_my_settlements.py new file mode 100644 index 0000000..24db92e --- /dev/null +++ b/gate_api/models/options_my_settlements.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 OptionsMySettlements(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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': 'float', + 'underlying': 'str', + 'contract': 'str', + 'strike_price': 'str', + 'settle_price': 'str', + 'size': 'int', + 'settle_profit': 'str', + 'fee': 'str', + 'realised_pnl': 'str' + } + + attribute_map = { + 'time': 'time', + 'underlying': 'underlying', + 'contract': 'contract', + 'strike_price': 'strike_price', + 'settle_price': 'settle_price', + 'size': 'size', + 'settle_profit': 'settle_profit', + 'fee': 'fee', + 'realised_pnl': 'realised_pnl' + } + + def __init__(self, time=None, underlying=None, contract=None, strike_price=None, settle_price=None, size=None, settle_profit=None, fee=None, realised_pnl=None, local_vars_configuration=None): # noqa: E501 + # type: (float, str, str, str, str, int, str, str, str, Configuration) -> None + """OptionsMySettlements - a 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._underlying = None + self._contract = None + self._strike_price = None + self._settle_price = None + self._size = None + self._settle_profit = None + self._fee = None + self._realised_pnl = None + self.discriminator = None + + if time is not None: + self.time = time + if underlying is not None: + self.underlying = underlying + if contract is not None: + self.contract = contract + if strike_price is not None: + self.strike_price = strike_price + if settle_price is not None: + self.settle_price = settle_price + if size is not None: + self.size = size + if settle_profit is not None: + self.settle_profit = settle_profit + if fee is not None: + self.fee = fee + if realised_pnl is not None: + self.realised_pnl = realised_pnl + + @property + def time(self): + """Gets the time of this OptionsMySettlements. # noqa: E501 + + Settlement time # noqa: E501 + + :return: The time of this OptionsMySettlements. # noqa: E501 + :rtype: float + """ + return self._time + + @time.setter + def time(self, time): + """Sets the time of this OptionsMySettlements. + + Settlement time # noqa: E501 + + :param time: The time of this OptionsMySettlements. # noqa: E501 + :type: float + """ + + self._time = time + + @property + def underlying(self): + """Gets the underlying of this OptionsMySettlements. # noqa: E501 + + Underlying # noqa: E501 + + :return: The underlying of this OptionsMySettlements. # noqa: E501 + :rtype: str + """ + return self._underlying + + @underlying.setter + def underlying(self, underlying): + """Sets the underlying of this OptionsMySettlements. + + Underlying # noqa: E501 + + :param underlying: The underlying of this OptionsMySettlements. # noqa: E501 + :type: str + """ + + self._underlying = underlying + + @property + def contract(self): + """Gets the contract of this OptionsMySettlements. # noqa: E501 + + Options contract name # noqa: E501 + + :return: The contract of this OptionsMySettlements. # noqa: E501 + :rtype: str + """ + return self._contract + + @contract.setter + def contract(self, contract): + """Sets the contract of this OptionsMySettlements. + + Options contract name # noqa: E501 + + :param contract: The contract of this OptionsMySettlements. # noqa: E501 + :type: str + """ + + self._contract = contract + + @property + def strike_price(self): + """Gets the strike_price of this OptionsMySettlements. # noqa: E501 + + Strike price (quote currency) # noqa: E501 + + :return: The strike_price of this OptionsMySettlements. # noqa: E501 + :rtype: str + """ + return self._strike_price + + @strike_price.setter + def strike_price(self, strike_price): + """Sets the strike_price of this OptionsMySettlements. + + Strike price (quote currency) # noqa: E501 + + :param strike_price: The strike_price of this OptionsMySettlements. # noqa: E501 + :type: str + """ + + self._strike_price = strike_price + + @property + def settle_price(self): + """Gets the settle_price of this OptionsMySettlements. # noqa: E501 + + Settlement price (quote currency) # noqa: E501 + + :return: The settle_price of this OptionsMySettlements. # noqa: E501 + :rtype: str + """ + return self._settle_price + + @settle_price.setter + def settle_price(self, settle_price): + """Sets the settle_price of this OptionsMySettlements. + + Settlement price (quote currency) # noqa: E501 + + :param settle_price: The settle_price of this OptionsMySettlements. # noqa: E501 + :type: str + """ + + self._settle_price = settle_price + + @property + def size(self): + """Gets the size of this OptionsMySettlements. # noqa: E501 + + Settlement size # noqa: E501 + + :return: The size of this OptionsMySettlements. # noqa: E501 + :rtype: int + """ + return self._size + + @size.setter + def size(self, size): + """Sets the size of this OptionsMySettlements. + + Settlement size # noqa: E501 + + :param size: The size of this OptionsMySettlements. # noqa: E501 + :type: int + """ + + self._size = size + + @property + def settle_profit(self): + """Gets the settle_profit of this OptionsMySettlements. # noqa: E501 + + Settlement profit (quote currency) # noqa: E501 + + :return: The settle_profit of this OptionsMySettlements. # noqa: E501 + :rtype: str + """ + return self._settle_profit + + @settle_profit.setter + def settle_profit(self, settle_profit): + """Sets the settle_profit of this OptionsMySettlements. + + Settlement profit (quote currency) # noqa: E501 + + :param settle_profit: The settle_profit of this OptionsMySettlements. # noqa: E501 + :type: str + """ + + self._settle_profit = settle_profit + + @property + def fee(self): + """Gets the fee of this OptionsMySettlements. # noqa: E501 + + Settlement fee (quote currency) # noqa: E501 + + :return: The fee of this OptionsMySettlements. # noqa: E501 + :rtype: str + """ + return self._fee + + @fee.setter + def fee(self, fee): + """Sets the fee of this OptionsMySettlements. + + Settlement fee (quote currency) # noqa: E501 + + :param fee: The fee of this OptionsMySettlements. # noqa: E501 + :type: str + """ + + self._fee = fee + + @property + def realised_pnl(self): + """Gets the realised_pnl of this OptionsMySettlements. # noqa: E501 + + Accumulated profit and loss from opening positions, including premium, fees, settlement profit, etc. (quote currency) # noqa: E501 + + :return: The realised_pnl of this OptionsMySettlements. # noqa: E501 + :rtype: str + """ + return self._realised_pnl + + @realised_pnl.setter + def realised_pnl(self, realised_pnl): + """Sets the realised_pnl of this OptionsMySettlements. + + Accumulated profit and loss from opening positions, including premium, fees, settlement profit, etc. (quote currency) # noqa: E501 + + :param realised_pnl: The realised_pnl of this OptionsMySettlements. # noqa: E501 + :type: str + """ + + self._realised_pnl = realised_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, OptionsMySettlements): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OptionsMySettlements): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/options_my_trade.py b/gate_api/models/options_my_trade.py new file mode 100644 index 0000000..55435f0 --- /dev/null +++ b/gate_api/models/options_my_trade.py @@ -0,0 +1,325 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OptionsMyTrade(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'create_time': 'float', + 'contract': 'str', + 'order_id': 'int', + 'size': 'int', + 'price': 'str', + 'underlying_price': 'str', + 'role': 'str' + } + + attribute_map = { + 'id': 'id', + 'create_time': 'create_time', + 'contract': 'contract', + 'order_id': 'order_id', + 'size': 'size', + 'price': 'price', + 'underlying_price': 'underlying_price', + 'role': 'role' + } + + def __init__(self, id=None, create_time=None, contract=None, order_id=None, size=None, price=None, underlying_price=None, role=None, local_vars_configuration=None): # noqa: E501 + # type: (int, float, str, int, int, str, str, str, Configuration) -> None + """OptionsMyTrade - a 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._create_time = None + self._contract = None + self._order_id = None + self._size = None + self._price = None + self._underlying_price = None + self._role = None + self.discriminator = None + + if id is not None: + self.id = id + if create_time is not None: + self.create_time = create_time + if contract is not None: + self.contract = contract + if order_id is not None: + self.order_id = order_id + if size is not None: + self.size = size + if price is not None: + self.price = price + if underlying_price is not None: + self.underlying_price = underlying_price + if role is not None: + self.role = role + + @property + def id(self): + """Gets the id of this OptionsMyTrade. # noqa: E501 + + Fill ID # noqa: E501 + + :return: The id of this OptionsMyTrade. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this OptionsMyTrade. + + Fill ID # noqa: E501 + + :param id: The id of this OptionsMyTrade. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def create_time(self): + """Gets the create_time of this OptionsMyTrade. # noqa: E501 + + Fill Time # noqa: E501 + + :return: The create_time of this OptionsMyTrade. # noqa: E501 + :rtype: float + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this OptionsMyTrade. + + Fill Time # noqa: E501 + + :param create_time: The create_time of this OptionsMyTrade. # noqa: E501 + :type: float + """ + + self._create_time = create_time + + @property + def contract(self): + """Gets the contract of this OptionsMyTrade. # noqa: E501 + + Options contract name # noqa: E501 + + :return: The contract of this OptionsMyTrade. # noqa: E501 + :rtype: str + """ + return self._contract + + @contract.setter + def contract(self, contract): + """Sets the contract of this OptionsMyTrade. + + Options contract name # noqa: E501 + + :param contract: The contract of this OptionsMyTrade. # noqa: E501 + :type: str + """ + + self._contract = contract + + @property + def order_id(self): + """Gets the order_id of this OptionsMyTrade. # noqa: E501 + + Related order ID # noqa: E501 + + :return: The order_id of this OptionsMyTrade. # noqa: E501 + :rtype: int + """ + return self._order_id + + @order_id.setter + def order_id(self, order_id): + """Sets the order_id of this OptionsMyTrade. + + Related order ID # noqa: E501 + + :param order_id: The order_id of this OptionsMyTrade. # noqa: E501 + :type: int + """ + + self._order_id = order_id + + @property + def size(self): + """Gets the size of this OptionsMyTrade. # noqa: E501 + + Trading size # noqa: E501 + + :return: The size of this OptionsMyTrade. # noqa: E501 + :rtype: int + """ + return self._size + + @size.setter + def size(self, size): + """Sets the size of this OptionsMyTrade. + + Trading size # noqa: E501 + + :param size: The size of this OptionsMyTrade. # noqa: E501 + :type: int + """ + + self._size = size + + @property + def price(self): + """Gets the price of this OptionsMyTrade. # noqa: E501 + + Trade price (quote currency) # noqa: E501 + + :return: The price of this OptionsMyTrade. # noqa: E501 + :rtype: str + """ + return self._price + + @price.setter + def price(self, price): + """Sets the price of this OptionsMyTrade. + + Trade price (quote currency) # noqa: E501 + + :param price: The price of this OptionsMyTrade. # noqa: E501 + :type: str + """ + + self._price = price + + @property + def underlying_price(self): + """Gets the underlying_price of this OptionsMyTrade. # noqa: E501 + + Underlying price (quote currency) # noqa: E501 + + :return: The underlying_price of this OptionsMyTrade. # noqa: E501 + :rtype: str + """ + return self._underlying_price + + @underlying_price.setter + def underlying_price(self, underlying_price): + """Sets the underlying_price of this OptionsMyTrade. + + Underlying price (quote currency) # noqa: E501 + + :param underlying_price: The underlying_price of this OptionsMyTrade. # noqa: E501 + :type: str + """ + + self._underlying_price = underlying_price + + @property + def role(self): + """Gets the role of this OptionsMyTrade. # noqa: E501 + + Trade role. taker - taker, maker - maker # noqa: E501 + + :return: The role of this OptionsMyTrade. # noqa: E501 + :rtype: str + """ + return self._role + + @role.setter + def role(self, role): + """Sets the role of this OptionsMyTrade. + + Trade role. taker - taker, maker - maker # noqa: E501 + + :param role: The role of this OptionsMyTrade. # noqa: E501 + :type: str + """ + allowed_values = ["taker", "maker"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and role not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `role` ({0}), must be one of {1}" # noqa: E501 + .format(role, allowed_values) + ) + + self._role = role + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OptionsMyTrade): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OptionsMyTrade): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/options_order.py b/gate_api/models/options_order.py new file mode 100644 index 0000000..1f28133 --- /dev/null +++ b/gate_api/models/options_order.py @@ -0,0 +1,815 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OptionsOrder(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'finish_time': 'float', + 'finish_as': 'str', + 'status': 'str', + 'contract': 'str', + 'size': 'int', + 'iceberg': 'int', + 'price': 'str', + 'close': 'bool', + 'is_close': 'bool', + 'reduce_only': 'bool', + 'is_reduce_only': 'bool', + 'is_liq': 'bool', + 'mmp': 'bool', + 'is_mmp': 'bool', + 'tif': 'str', + 'left': 'int', + 'fill_price': 'str', + 'text': 'str', + 'tkfr': 'str', + 'mkfr': 'str', + 'refu': 'int', + 'refr': 'str' + } + + attribute_map = { + 'id': 'id', + 'user': 'user', + 'create_time': 'create_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', + 'mmp': 'mmp', + 'is_mmp': 'is_mmp', + 'tif': 'tif', + 'left': 'left', + 'fill_price': 'fill_price', + 'text': 'text', + 'tkfr': 'tkfr', + 'mkfr': 'mkfr', + 'refu': 'refu', + 'refr': 'refr' + } + + def __init__(self, id=None, user=None, create_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, mmp=False, is_mmp=None, tif='gtc', left=None, fill_price=None, text=None, tkfr=None, mkfr=None, refu=None, refr=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, float, float, str, str, str, int, int, str, bool, bool, bool, bool, bool, bool, bool, str, int, str, str, str, str, int, str, Configuration) -> None + """OptionsOrder - a 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._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._mmp = None + self._is_mmp = None + self._tif = None + self._left = None + self._fill_price = None + self._text = None + self._tkfr = None + self._mkfr = None + self._refu = None + self._refr = 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 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 + if price is not None: + 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 mmp is not None: + self.mmp = mmp + if is_mmp is not None: + self.is_mmp = is_mmp + 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 refr is not None: + self.refr = refr + + @property + def id(self): + """Gets the id of this OptionsOrder. # noqa: E501 + + Options order ID # noqa: E501 + + :return: The id of this OptionsOrder. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this OptionsOrder. + + Options order ID # noqa: E501 + + :param id: The id of this OptionsOrder. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def user(self): + """Gets the user of this OptionsOrder. # noqa: E501 + + User ID # noqa: E501 + + :return: The user of this OptionsOrder. # noqa: E501 + :rtype: int + """ + return self._user + + @user.setter + def user(self, user): + """Sets the user of this OptionsOrder. + + User ID # noqa: E501 + + :param user: The user of this OptionsOrder. # noqa: E501 + :type: int + """ + + self._user = user + + @property + def create_time(self): + """Gets the create_time of this OptionsOrder. # noqa: E501 + + Creation time of order # noqa: E501 + + :return: The create_time of this OptionsOrder. # noqa: E501 + :rtype: float + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this OptionsOrder. + + Creation time of order # noqa: E501 + + :param create_time: The create_time of this OptionsOrder. # noqa: E501 + :type: float + """ + + self._create_time = create_time + + @property + def finish_time(self): + """Gets the finish_time of this OptionsOrder. # noqa: E501 + + Order finished time. Not returned if order is open # noqa: E501 + + :return: The finish_time of this OptionsOrder. # noqa: E501 + :rtype: float + """ + return self._finish_time + + @finish_time.setter + def finish_time(self, finish_time): + """Sets the finish_time of this OptionsOrder. + + Order finished time. Not returned if order is open # noqa: E501 + + :param finish_time: The finish_time of this OptionsOrder. # noqa: E501 + :type: float + """ + + self._finish_time = finish_time + + @property + def finish_as(self): + """Gets the finish_as of this OptionsOrder. # noqa: E501 + + Order finish reason: - filled: Fully filled - cancelled: User cancelled - liquidated: Cancelled due to liquidation - ioc: Not immediately fully filled due to IOC time-in-force setting - auto_deleveraged: Cancelled due to auto-deleveraging - reduce_only: Cancelled due to position increase while reduce-only is set - position_closed: Cancelled because the position was closed - reduce_out: Only reduce positions by excluding hard-to-fill orders - mmp_cancelled: Cancelled by MMP # noqa: E501 + + :return: The finish_as of this OptionsOrder. # noqa: E501 + :rtype: str + """ + return self._finish_as + + @finish_as.setter + def finish_as(self, finish_as): + """Sets the finish_as of this OptionsOrder. + + Order finish reason: - filled: Fully filled - cancelled: User cancelled - liquidated: Cancelled due to liquidation - ioc: Not immediately fully filled due to IOC time-in-force setting - auto_deleveraged: Cancelled due to auto-deleveraging - reduce_only: Cancelled due to position increase while reduce-only is set - position_closed: Cancelled because the position was closed - reduce_out: Only reduce positions by excluding hard-to-fill orders - mmp_cancelled: Cancelled by MMP # noqa: E501 + + :param finish_as: The finish_as of this OptionsOrder. # noqa: E501 + :type: str + """ + allowed_values = ["filled", "cancelled", "liquidated", "ioc", "auto_deleveraged", "reduce_only", "position_closed", "reduce_out", "mmp_cancelled"] # 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 OptionsOrder. # noqa: E501 + + Order status - `open`: Pending - `finished`: Completed # noqa: E501 + + :return: The status of this OptionsOrder. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this OptionsOrder. + + Order status - `open`: Pending - `finished`: Completed # noqa: E501 + + :param status: The status of this OptionsOrder. # 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 OptionsOrder. # noqa: E501 + + Options identifier # noqa: E501 + + :return: The contract of this OptionsOrder. # noqa: E501 + :rtype: str + """ + return self._contract + + @contract.setter + def contract(self, contract): + """Sets the contract of this OptionsOrder. + + Options identifier # noqa: E501 + + :param contract: The contract of this OptionsOrder. # 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 OptionsOrder. # 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 OptionsOrder. # noqa: E501 + :rtype: int + """ + return self._size + + @size.setter + def size(self, size): + """Sets the size of this OptionsOrder. + + Required. Trading quantity. Positive for buy, negative for sell. Set to 0 for close position orders. # noqa: E501 + + :param size: The size of this OptionsOrder. # 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 + + @property + def iceberg(self): + """Gets the iceberg of this OptionsOrder. # 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 OptionsOrder. # noqa: E501 + :rtype: int + """ + return self._iceberg + + @iceberg.setter + def iceberg(self, iceberg): + """Sets the iceberg of this OptionsOrder. + + 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 OptionsOrder. # noqa: E501 + :type: int + """ + + self._iceberg = iceberg + + @property + def price(self): + """Gets the price of this OptionsOrder. # noqa: E501 + + Order price. Price of 0 with `tif` set as `ioc` represents market order (quote currency) # noqa: E501 + + :return: The price of this OptionsOrder. # noqa: E501 + :rtype: str + """ + return self._price + + @price.setter + def price(self, price): + """Sets the price of this OptionsOrder. + + Order price. Price of 0 with `tif` set as `ioc` represents market order (quote currency) # noqa: E501 + + :param price: The price of this OptionsOrder. # noqa: E501 + :type: str + """ + + self._price = price + + @property + def close(self): + """Gets the close of this OptionsOrder. # noqa: E501 + + Set as `true` to close the position, with `size` set to 0 # noqa: E501 + + :return: The close of this OptionsOrder. # noqa: E501 + :rtype: bool + """ + return self._close + + @close.setter + def close(self, close): + """Sets the close of this OptionsOrder. + + Set as `true` to close the position, with `size` set to 0 # noqa: E501 + + :param close: The close of this OptionsOrder. # noqa: E501 + :type: bool + """ + + self._close = close + + @property + def is_close(self): + """Gets the is_close of this OptionsOrder. # noqa: E501 + + Is the order to close position # noqa: E501 + + :return: The is_close of this OptionsOrder. # noqa: E501 + :rtype: bool + """ + return self._is_close + + @is_close.setter + def is_close(self, is_close): + """Sets the is_close of this OptionsOrder. + + Is the order to close position # noqa: E501 + + :param is_close: The is_close of this OptionsOrder. # noqa: E501 + :type: bool + """ + + self._is_close = is_close + + @property + def reduce_only(self): + """Gets the reduce_only of this OptionsOrder. # noqa: E501 + + Set as `true` to be reduce-only order # noqa: E501 + + :return: The reduce_only of this OptionsOrder. # noqa: E501 + :rtype: bool + """ + return self._reduce_only + + @reduce_only.setter + def reduce_only(self, reduce_only): + """Sets the reduce_only of this OptionsOrder. + + Set as `true` to be reduce-only order # noqa: E501 + + :param reduce_only: The reduce_only of this OptionsOrder. # noqa: E501 + :type: bool + """ + + self._reduce_only = reduce_only + + @property + def is_reduce_only(self): + """Gets the is_reduce_only of this OptionsOrder. # noqa: E501 + + Is the order reduce-only # noqa: E501 + + :return: The is_reduce_only of this OptionsOrder. # 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 OptionsOrder. + + Is the order reduce-only # noqa: E501 + + :param is_reduce_only: The is_reduce_only of this OptionsOrder. # noqa: E501 + :type: bool + """ + + self._is_reduce_only = is_reduce_only + + @property + def is_liq(self): + """Gets the is_liq of this OptionsOrder. # noqa: E501 + + Is the order for liquidation # noqa: E501 + + :return: The is_liq of this OptionsOrder. # noqa: E501 + :rtype: bool + """ + return self._is_liq + + @is_liq.setter + def is_liq(self, is_liq): + """Sets the is_liq of this OptionsOrder. + + Is the order for liquidation # noqa: E501 + + :param is_liq: The is_liq of this OptionsOrder. # noqa: E501 + :type: bool + """ + + self._is_liq = is_liq + + @property + def mmp(self): + """Gets the mmp of this OptionsOrder. # noqa: E501 + + When set to true, it is an MMP order # noqa: E501 + + :return: The mmp of this OptionsOrder. # noqa: E501 + :rtype: bool + """ + return self._mmp + + @mmp.setter + def mmp(self, mmp): + """Sets the mmp of this OptionsOrder. + + When set to true, it is an MMP order # noqa: E501 + + :param mmp: The mmp of this OptionsOrder. # noqa: E501 + :type: bool + """ + + self._mmp = mmp + + @property + def is_mmp(self): + """Gets the is_mmp of this OptionsOrder. # noqa: E501 + + Whether it is an MMP order. Corresponds to `mmp` in the request # noqa: E501 + + :return: The is_mmp of this OptionsOrder. # noqa: E501 + :rtype: bool + """ + return self._is_mmp + + @is_mmp.setter + def is_mmp(self, is_mmp): + """Sets the is_mmp of this OptionsOrder. + + Whether it is an MMP order. Corresponds to `mmp` in the request # noqa: E501 + + :param is_mmp: The is_mmp of this OptionsOrder. # noqa: E501 + :type: bool + """ + + self._is_mmp = is_mmp + + @property + def tif(self): + """Gets the tif of this OptionsOrder. # noqa: E501 + + Time in force strategy. Market orders currently only support IOC mode - gtc: Good Till Cancelled - ioc: Immediate Or Cancelled, execute immediately or cancel, taker only - poc: Pending Or Cancelled, passive order, maker only # noqa: E501 + + :return: The tif of this OptionsOrder. # noqa: E501 + :rtype: str + """ + return self._tif + + @tif.setter + def tif(self, tif): + """Sets the tif of this OptionsOrder. + + Time in force strategy. Market orders currently only support IOC mode - gtc: Good Till Cancelled - ioc: Immediate Or Cancelled, execute immediately or cancel, taker only - poc: Pending Or Cancelled, passive order, maker only # noqa: E501 + + :param tif: The tif of this OptionsOrder. # noqa: E501 + :type: str + """ + allowed_values = ["gtc", "ioc", "poc"] # 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 OptionsOrder. # noqa: E501 + + Unfilled quantity # noqa: E501 + + :return: The left of this OptionsOrder. # noqa: E501 + :rtype: int + """ + return self._left + + @left.setter + def left(self, left): + """Sets the left of this OptionsOrder. + + Unfilled quantity # noqa: E501 + + :param left: The left of this OptionsOrder. # noqa: E501 + :type: int + """ + + self._left = left + + @property + def fill_price(self): + """Gets the fill_price of this OptionsOrder. # noqa: E501 + + Fill price # noqa: E501 + + :return: The fill_price of this OptionsOrder. # noqa: E501 + :rtype: str + """ + return self._fill_price + + @fill_price.setter + def fill_price(self, fill_price): + """Sets the fill_price of this OptionsOrder. + + Fill price # noqa: E501 + + :param fill_price: The fill_price of this OptionsOrder. # noqa: E501 + :type: str + """ + + self._fill_price = fill_price + + @property + def text(self): + """Gets the text of this OptionsOrder. # 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: - web: from web - api: from API - app: from mobile phones - auto_deleveraging: from ADL - liquidation: from liquidation - insurance: from insurance # noqa: E501 + + :return: The text of this OptionsOrder. # noqa: E501 + :rtype: str + """ + return self._text + + @text.setter + def text(self, text): + """Sets the text of this OptionsOrder. + + 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: - web: from web - api: from API - app: from mobile phones - auto_deleveraging: from ADL - liquidation: from liquidation - insurance: from insurance # noqa: E501 + + :param text: The text of this OptionsOrder. # noqa: E501 + :type: str + """ + + self._text = text + + @property + def tkfr(self): + """Gets the tkfr of this OptionsOrder. # noqa: E501 + + Taker fee # noqa: E501 + + :return: The tkfr of this OptionsOrder. # noqa: E501 + :rtype: str + """ + return self._tkfr + + @tkfr.setter + def tkfr(self, tkfr): + """Sets the tkfr of this OptionsOrder. + + Taker fee # noqa: E501 + + :param tkfr: The tkfr of this OptionsOrder. # noqa: E501 + :type: str + """ + + self._tkfr = tkfr + + @property + def mkfr(self): + """Gets the mkfr of this OptionsOrder. # noqa: E501 + + Maker fee # noqa: E501 + + :return: The mkfr of this OptionsOrder. # noqa: E501 + :rtype: str + """ + return self._mkfr + + @mkfr.setter + def mkfr(self, mkfr): + """Sets the mkfr of this OptionsOrder. + + Maker fee # noqa: E501 + + :param mkfr: The mkfr of this OptionsOrder. # noqa: E501 + :type: str + """ + + self._mkfr = mkfr + + @property + def refu(self): + """Gets the refu of this OptionsOrder. # noqa: E501 + + Referrer user ID # noqa: E501 + + :return: The refu of this OptionsOrder. # noqa: E501 + :rtype: int + """ + return self._refu + + @refu.setter + def refu(self, refu): + """Sets the refu of this OptionsOrder. + + Referrer user ID # noqa: E501 + + :param refu: The refu of this OptionsOrder. # noqa: E501 + :type: int + """ + + self._refu = refu + + @property + def refr(self): + """Gets the refr of this OptionsOrder. # noqa: E501 + + Referrer rebate # noqa: E501 + + :return: The refr of this OptionsOrder. # noqa: E501 + :rtype: str + """ + return self._refr + + @refr.setter + def refr(self, refr): + """Sets the refr of this OptionsOrder. + + Referrer rebate # noqa: E501 + + :param refr: The refr of this OptionsOrder. # noqa: E501 + :type: str + """ + + self._refr = refr + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OptionsOrder): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OptionsOrder): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/options_position.py b/gate_api/models/options_position.py new file mode 100644 index 0000000..b20a575 --- /dev/null +++ b/gate_api/models/options_position.py @@ -0,0 +1,540 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OptionsPosition(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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': 'int', + 'underlying': 'str', + 'underlying_price': 'str', + 'contract': 'str', + 'size': 'int', + 'entry_price': 'str', + 'mark_price': 'str', + 'mark_iv': 'str', + 'realised_pnl': 'str', + 'unrealised_pnl': 'str', + 'pending_orders': 'int', + 'close_order': 'OptionsPositionCloseOrder', + 'delta': 'str', + 'gamma': 'str', + 'vega': 'str', + 'theta': 'str' + } + + attribute_map = { + 'user': 'user', + 'underlying': 'underlying', + 'underlying_price': 'underlying_price', + 'contract': 'contract', + 'size': 'size', + 'entry_price': 'entry_price', + 'mark_price': 'mark_price', + 'mark_iv': 'mark_iv', + 'realised_pnl': 'realised_pnl', + 'unrealised_pnl': 'unrealised_pnl', + 'pending_orders': 'pending_orders', + 'close_order': 'close_order', + 'delta': 'delta', + 'gamma': 'gamma', + 'vega': 'vega', + 'theta': 'theta' + } + + def __init__(self, user=None, underlying=None, underlying_price=None, contract=None, size=None, entry_price=None, mark_price=None, mark_iv=None, realised_pnl=None, unrealised_pnl=None, pending_orders=None, close_order=None, delta=None, gamma=None, vega=None, theta=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, str, str, int, str, str, str, str, str, int, OptionsPositionCloseOrder, str, str, str, str, Configuration) -> None + """OptionsPosition - a 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 = None + self._underlying = None + self._underlying_price = None + self._contract = None + self._size = None + self._entry_price = None + self._mark_price = None + self._mark_iv = None + self._realised_pnl = None + self._unrealised_pnl = None + self._pending_orders = None + self._close_order = None + self._delta = None + self._gamma = None + self._vega = None + self._theta = None + self.discriminator = None + + if user is not None: + self.user = user + if underlying is not None: + self.underlying = underlying + if underlying_price is not None: + self.underlying_price = underlying_price + if contract is not None: + self.contract = contract + if size is not None: + self.size = size + if entry_price is not None: + self.entry_price = entry_price + if mark_price is not None: + self.mark_price = mark_price + if mark_iv is not None: + self.mark_iv = mark_iv + if realised_pnl is not None: + self.realised_pnl = realised_pnl + if unrealised_pnl is not None: + self.unrealised_pnl = unrealised_pnl + if pending_orders is not None: + self.pending_orders = pending_orders + self.close_order = close_order + if delta is not None: + self.delta = delta + if gamma is not None: + self.gamma = gamma + if vega is not None: + self.vega = vega + if theta is not None: + self.theta = theta + + @property + def user(self): + """Gets the user of this OptionsPosition. # noqa: E501 + + User ID # noqa: E501 + + :return: The user of this OptionsPosition. # noqa: E501 + :rtype: int + """ + return self._user + + @user.setter + def user(self, user): + """Sets the user of this OptionsPosition. + + User ID # noqa: E501 + + :param user: The user of this OptionsPosition. # noqa: E501 + :type: int + """ + + self._user = user + + @property + def underlying(self): + """Gets the underlying of this OptionsPosition. # noqa: E501 + + Underlying # noqa: E501 + + :return: The underlying of this OptionsPosition. # noqa: E501 + :rtype: str + """ + return self._underlying + + @underlying.setter + def underlying(self, underlying): + """Sets the underlying of this OptionsPosition. + + Underlying # noqa: E501 + + :param underlying: The underlying of this OptionsPosition. # noqa: E501 + :type: str + """ + + self._underlying = underlying + + @property + def underlying_price(self): + """Gets the underlying_price of this OptionsPosition. # noqa: E501 + + Underlying price (quote currency) # noqa: E501 + + :return: The underlying_price of this OptionsPosition. # noqa: E501 + :rtype: str + """ + return self._underlying_price + + @underlying_price.setter + def underlying_price(self, underlying_price): + """Sets the underlying_price of this OptionsPosition. + + Underlying price (quote currency) # noqa: E501 + + :param underlying_price: The underlying_price of this OptionsPosition. # noqa: E501 + :type: str + """ + + self._underlying_price = underlying_price + + @property + def contract(self): + """Gets the contract of this OptionsPosition. # noqa: E501 + + Options contract name # noqa: E501 + + :return: The contract of this OptionsPosition. # noqa: E501 + :rtype: str + """ + return self._contract + + @contract.setter + def contract(self, contract): + """Sets the contract of this OptionsPosition. + + Options contract name # noqa: E501 + + :param contract: The contract of this OptionsPosition. # noqa: E501 + :type: str + """ + + self._contract = contract + + @property + def size(self): + """Gets the size of this OptionsPosition. # noqa: E501 + + Position size (contract quantity) # noqa: E501 + + :return: The size of this OptionsPosition. # noqa: E501 + :rtype: int + """ + return self._size + + @size.setter + def size(self, size): + """Sets the size of this OptionsPosition. + + Position size (contract quantity) # noqa: E501 + + :param size: The size of this OptionsPosition. # noqa: E501 + :type: int + """ + + self._size = size + + @property + def entry_price(self): + """Gets the entry_price of this OptionsPosition. # noqa: E501 + + Entry size (quote currency) # noqa: E501 + + :return: The entry_price of this OptionsPosition. # noqa: E501 + :rtype: str + """ + return self._entry_price + + @entry_price.setter + def entry_price(self, entry_price): + """Sets the entry_price of this OptionsPosition. + + Entry size (quote currency) # noqa: E501 + + :param entry_price: The entry_price of this OptionsPosition. # noqa: E501 + :type: str + """ + + self._entry_price = entry_price + + @property + def mark_price(self): + """Gets the mark_price of this OptionsPosition. # noqa: E501 + + Current mark price (quote currency) # noqa: E501 + + :return: The mark_price of this OptionsPosition. # noqa: E501 + :rtype: str + """ + return self._mark_price + + @mark_price.setter + def mark_price(self, mark_price): + """Sets the mark_price of this OptionsPosition. + + Current mark price (quote currency) # noqa: E501 + + :param mark_price: The mark_price of this OptionsPosition. # noqa: E501 + :type: str + """ + + self._mark_price = mark_price + + @property + def mark_iv(self): + """Gets the mark_iv of this OptionsPosition. # noqa: E501 + + Implied volatility # noqa: E501 + + :return: The mark_iv of this OptionsPosition. # noqa: E501 + :rtype: str + """ + return self._mark_iv + + @mark_iv.setter + def mark_iv(self, mark_iv): + """Sets the mark_iv of this OptionsPosition. + + Implied volatility # noqa: E501 + + :param mark_iv: The mark_iv of this OptionsPosition. # noqa: E501 + :type: str + """ + + self._mark_iv = mark_iv + + @property + def realised_pnl(self): + """Gets the realised_pnl of this OptionsPosition. # noqa: E501 + + Realized PnL # noqa: E501 + + :return: The realised_pnl of this OptionsPosition. # noqa: E501 + :rtype: str + """ + return self._realised_pnl + + @realised_pnl.setter + def realised_pnl(self, realised_pnl): + """Sets the realised_pnl of this OptionsPosition. + + Realized PnL # noqa: E501 + + :param realised_pnl: The realised_pnl of this OptionsPosition. # noqa: E501 + :type: str + """ + + self._realised_pnl = realised_pnl + + @property + def unrealised_pnl(self): + """Gets the unrealised_pnl of this OptionsPosition. # noqa: E501 + + Unrealized PNL # noqa: E501 + + :return: The unrealised_pnl of this OptionsPosition. # noqa: E501 + :rtype: str + """ + return self._unrealised_pnl + + @unrealised_pnl.setter + def unrealised_pnl(self, unrealised_pnl): + """Sets the unrealised_pnl of this OptionsPosition. + + Unrealized PNL # noqa: E501 + + :param unrealised_pnl: The unrealised_pnl of this OptionsPosition. # noqa: E501 + :type: str + """ + + self._unrealised_pnl = unrealised_pnl + + @property + def pending_orders(self): + """Gets the pending_orders of this OptionsPosition. # noqa: E501 + + Current pending order quantity # noqa: E501 + + :return: The pending_orders of this OptionsPosition. # noqa: E501 + :rtype: int + """ + return self._pending_orders + + @pending_orders.setter + def pending_orders(self, pending_orders): + """Sets the pending_orders of this OptionsPosition. + + Current pending order quantity # noqa: E501 + + :param pending_orders: The pending_orders of this OptionsPosition. # noqa: E501 + :type: int + """ + + self._pending_orders = pending_orders + + @property + def close_order(self): + """Gets the close_order of this OptionsPosition. # noqa: E501 + + + :return: The close_order of this OptionsPosition. # noqa: E501 + :rtype: OptionsPositionCloseOrder + """ + return self._close_order + + @close_order.setter + def close_order(self, close_order): + """Sets the close_order of this OptionsPosition. + + + :param close_order: The close_order of this OptionsPosition. # noqa: E501 + :type: OptionsPositionCloseOrder + """ + + self._close_order = close_order + + @property + def delta(self): + """Gets the delta of this OptionsPosition. # noqa: E501 + + Greek letter delta # noqa: E501 + + :return: The delta of this OptionsPosition. # noqa: E501 + :rtype: str + """ + return self._delta + + @delta.setter + def delta(self, delta): + """Sets the delta of this OptionsPosition. + + Greek letter delta # noqa: E501 + + :param delta: The delta of this OptionsPosition. # noqa: E501 + :type: str + """ + + self._delta = delta + + @property + def gamma(self): + """Gets the gamma of this OptionsPosition. # noqa: E501 + + Greek letter gamma # noqa: E501 + + :return: The gamma of this OptionsPosition. # noqa: E501 + :rtype: str + """ + return self._gamma + + @gamma.setter + def gamma(self, gamma): + """Sets the gamma of this OptionsPosition. + + Greek letter gamma # noqa: E501 + + :param gamma: The gamma of this OptionsPosition. # noqa: E501 + :type: str + """ + + self._gamma = gamma + + @property + def vega(self): + """Gets the vega of this OptionsPosition. # noqa: E501 + + Greek letter vega # noqa: E501 + + :return: The vega of this OptionsPosition. # noqa: E501 + :rtype: str + """ + return self._vega + + @vega.setter + def vega(self, vega): + """Sets the vega of this OptionsPosition. + + Greek letter vega # noqa: E501 + + :param vega: The vega of this OptionsPosition. # noqa: E501 + :type: str + """ + + self._vega = vega + + @property + def theta(self): + """Gets the theta of this OptionsPosition. # noqa: E501 + + Greek letter theta # noqa: E501 + + :return: The theta of this OptionsPosition. # noqa: E501 + :rtype: str + """ + return self._theta + + @theta.setter + def theta(self, theta): + """Sets the theta of this OptionsPosition. + + Greek letter theta # noqa: E501 + + :param theta: The theta of this OptionsPosition. # noqa: E501 + :type: str + """ + + self._theta = theta + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OptionsPosition): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OptionsPosition): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/options_position_close.py b/gate_api/models/options_position_close.py new file mode 100644 index 0000000..2cc0fbb --- /dev/null +++ b/gate_api/models/options_position_close.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 OptionsPositionClose(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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': 'float', + 'contract': 'str', + 'side': 'str', + 'pnl': 'str', + 'text': 'str', + 'settle_size': 'str' + } + + attribute_map = { + 'time': 'time', + 'contract': 'contract', + 'side': 'side', + 'pnl': 'pnl', + 'text': 'text', + 'settle_size': 'settle_size' + } + + def __init__(self, time=None, contract=None, side=None, pnl=None, text=None, settle_size=None, local_vars_configuration=None): # noqa: E501 + # type: (float, str, str, str, str, str, Configuration) -> None + """OptionsPositionClose - a 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._contract = None + self._side = None + self._pnl = None + self._text = None + self._settle_size = None + self.discriminator = None + + if time is not None: + self.time = time + if contract is not None: + self.contract = contract + if side is not None: + self.side = side + if pnl is not None: + self.pnl = pnl + if text is not None: + self.text = text + if settle_size is not None: + self.settle_size = settle_size + + @property + def time(self): + """Gets the time of this OptionsPositionClose. # noqa: E501 + + Position close time # noqa: E501 + + :return: The time of this OptionsPositionClose. # noqa: E501 + :rtype: float + """ + return self._time + + @time.setter + def time(self, time): + """Sets the time of this OptionsPositionClose. + + Position close time # noqa: E501 + + :param time: The time of this OptionsPositionClose. # noqa: E501 + :type: float + """ + + self._time = time + + @property + def contract(self): + """Gets the contract of this OptionsPositionClose. # noqa: E501 + + Options contract name # noqa: E501 + + :return: The contract of this OptionsPositionClose. # noqa: E501 + :rtype: str + """ + return self._contract + + @contract.setter + def contract(self, contract): + """Sets the contract of this OptionsPositionClose. + + Options contract name # noqa: E501 + + :param contract: The contract of this OptionsPositionClose. # noqa: E501 + :type: str + """ + + self._contract = contract + + @property + def side(self): + """Gets the side of this OptionsPositionClose. # noqa: E501 + + Position side - `long`: Long position - `short`: Short position # noqa: E501 + + :return: The side of this OptionsPositionClose. # noqa: E501 + :rtype: str + """ + return self._side + + @side.setter + def side(self, side): + """Sets the side of this OptionsPositionClose. + + Position side - `long`: Long position - `short`: Short position # noqa: E501 + + :param side: The side of this OptionsPositionClose. # noqa: E501 + :type: str + """ + allowed_values = ["long", "short"] # 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 pnl(self): + """Gets the pnl of this OptionsPositionClose. # noqa: E501 + + PnL # noqa: E501 + + :return: The pnl of this OptionsPositionClose. # noqa: E501 + :rtype: str + """ + return self._pnl + + @pnl.setter + def pnl(self, pnl): + """Sets the pnl of this OptionsPositionClose. + + PnL # noqa: E501 + + :param pnl: The pnl of this OptionsPositionClose. # noqa: E501 + :type: str + """ + + self._pnl = pnl + + @property + def text(self): + """Gets the text of this OptionsPositionClose. # noqa: E501 + + Source of close order. See `order.text` field for specific values # noqa: E501 + + :return: The text of this OptionsPositionClose. # noqa: E501 + :rtype: str + """ + return self._text + + @text.setter + def text(self, text): + """Sets the text of this OptionsPositionClose. + + Source of close order. See `order.text` field for specific values # noqa: E501 + + :param text: The text of this OptionsPositionClose. # noqa: E501 + :type: str + """ + + self._text = text + + @property + def settle_size(self): + """Gets the settle_size of this OptionsPositionClose. # noqa: E501 + + Settlement size # noqa: E501 + + :return: The settle_size of this OptionsPositionClose. # noqa: E501 + :rtype: str + """ + return self._settle_size + + @settle_size.setter + def settle_size(self, settle_size): + """Sets the settle_size of this OptionsPositionClose. + + Settlement size # noqa: E501 + + :param settle_size: The settle_size of this OptionsPositionClose. # noqa: E501 + :type: str + """ + + self._settle_size = settle_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, OptionsPositionClose): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OptionsPositionClose): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/options_position_close_order.py b/gate_api/models/options_position_close_order.py new file mode 100644 index 0000000..31449b1 --- /dev/null +++ b/gate_api/models/options_position_close_order.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 OptionsPositionCloseOrder(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'price': 'str', + 'is_liq': 'bool' + } + + attribute_map = { + 'id': 'id', + 'price': 'price', + 'is_liq': 'is_liq' + } + + def __init__(self, id=None, price=None, is_liq=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, bool, Configuration) -> None + """OptionsPositionCloseOrder - a 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._price = None + self._is_liq = None + self.discriminator = None + + if id is not None: + self.id = id + if price is not None: + self.price = price + if is_liq is not None: + self.is_liq = is_liq + + @property + def id(self): + """Gets the id of this OptionsPositionCloseOrder. # noqa: E501 + + Order ID # noqa: E501 + + :return: The id of this OptionsPositionCloseOrder. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this OptionsPositionCloseOrder. + + Order ID # noqa: E501 + + :param id: The id of this OptionsPositionCloseOrder. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def price(self): + """Gets the price of this OptionsPositionCloseOrder. # noqa: E501 + + Order price (quote currency) # noqa: E501 + + :return: The price of this OptionsPositionCloseOrder. # noqa: E501 + :rtype: str + """ + return self._price + + @price.setter + def price(self, price): + """Sets the price of this OptionsPositionCloseOrder. + + Order price (quote currency) # noqa: E501 + + :param price: The price of this OptionsPositionCloseOrder. # noqa: E501 + :type: str + """ + + self._price = price + + @property + def is_liq(self): + """Gets the is_liq of this OptionsPositionCloseOrder. # noqa: E501 + + Whether the close order is from liquidation # noqa: E501 + + :return: The is_liq of this OptionsPositionCloseOrder. # noqa: E501 + :rtype: bool + """ + return self._is_liq + + @is_liq.setter + def is_liq(self, is_liq): + """Sets the is_liq of this OptionsPositionCloseOrder. + + Whether the close order is from liquidation # noqa: E501 + + :param is_liq: The is_liq of this OptionsPositionCloseOrder. # noqa: E501 + :type: bool + """ + + self._is_liq = is_liq + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OptionsPositionCloseOrder): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OptionsPositionCloseOrder): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/options_settlement.py b/gate_api/models/options_settlement.py new file mode 100644 index 0000000..d199ae4 --- /dev/null +++ b/gate_api/models/options_settlement.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 OptionsSettlement(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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': 'float', + 'contract': 'str', + 'profit': 'str', + 'fee': 'str', + 'strike_price': 'str', + 'settle_price': 'str' + } + + attribute_map = { + 'time': 'time', + 'contract': 'contract', + 'profit': 'profit', + 'fee': 'fee', + 'strike_price': 'strike_price', + 'settle_price': 'settle_price' + } + + def __init__(self, time=None, contract=None, profit=None, fee=None, strike_price=None, settle_price=None, local_vars_configuration=None): # noqa: E501 + # type: (float, str, str, str, str, str, Configuration) -> None + """OptionsSettlement - a 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._contract = None + self._profit = None + self._fee = None + self._strike_price = None + self._settle_price = None + self.discriminator = None + + if time is not None: + self.time = time + if contract is not None: + self.contract = contract + if profit is not None: + self.profit = profit + if fee is not None: + self.fee = fee + if strike_price is not None: + self.strike_price = strike_price + if settle_price is not None: + self.settle_price = settle_price + + @property + def time(self): + """Gets the time of this OptionsSettlement. # noqa: E501 + + Last configuration update time # noqa: E501 + + :return: The time of this OptionsSettlement. # noqa: E501 + :rtype: float + """ + return self._time + + @time.setter + def time(self, time): + """Sets the time of this OptionsSettlement. + + Last configuration update time # noqa: E501 + + :param time: The time of this OptionsSettlement. # noqa: E501 + :type: float + """ + + self._time = time + + @property + def contract(self): + """Gets the contract of this OptionsSettlement. # noqa: E501 + + Options contract name # noqa: E501 + + :return: The contract of this OptionsSettlement. # noqa: E501 + :rtype: str + """ + return self._contract + + @contract.setter + def contract(self, contract): + """Sets the contract of this OptionsSettlement. + + Options contract name # noqa: E501 + + :param contract: The contract of this OptionsSettlement. # noqa: E501 + :type: str + """ + + self._contract = contract + + @property + def profit(self): + """Gets the profit of this OptionsSettlement. # noqa: E501 + + Settlement profit per contract (quote currency) # noqa: E501 + + :return: The profit of this OptionsSettlement. # noqa: E501 + :rtype: str + """ + return self._profit + + @profit.setter + def profit(self, profit): + """Sets the profit of this OptionsSettlement. + + Settlement profit per contract (quote currency) # noqa: E501 + + :param profit: The profit of this OptionsSettlement. # noqa: E501 + :type: str + """ + + self._profit = profit + + @property + def fee(self): + """Gets the fee of this OptionsSettlement. # noqa: E501 + + Settlement fee per contract (quote currency) # noqa: E501 + + :return: The fee of this OptionsSettlement. # noqa: E501 + :rtype: str + """ + return self._fee + + @fee.setter + def fee(self, fee): + """Sets the fee of this OptionsSettlement. + + Settlement fee per contract (quote currency) # noqa: E501 + + :param fee: The fee of this OptionsSettlement. # noqa: E501 + :type: str + """ + + self._fee = fee + + @property + def strike_price(self): + """Gets the strike_price of this OptionsSettlement. # noqa: E501 + + Strike price (quote currency) # noqa: E501 + + :return: The strike_price of this OptionsSettlement. # noqa: E501 + :rtype: str + """ + return self._strike_price + + @strike_price.setter + def strike_price(self, strike_price): + """Sets the strike_price of this OptionsSettlement. + + Strike price (quote currency) # noqa: E501 + + :param strike_price: The strike_price of this OptionsSettlement. # noqa: E501 + :type: str + """ + + self._strike_price = strike_price + + @property + def settle_price(self): + """Gets the settle_price of this OptionsSettlement. # noqa: E501 + + Settlement price (quote currency) # noqa: E501 + + :return: The settle_price of this OptionsSettlement. # noqa: E501 + :rtype: str + """ + return self._settle_price + + @settle_price.setter + def settle_price(self, settle_price): + """Sets the settle_price of this OptionsSettlement. + + Settlement price (quote currency) # noqa: E501 + + :param settle_price: The settle_price of this OptionsSettlement. # noqa: E501 + :type: str + """ + + self._settle_price = settle_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, OptionsSettlement): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OptionsSettlement): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/options_ticker.py b/gate_api/models/options_ticker.py new file mode 100644 index 0000000..8a645f8 --- /dev/null +++ b/gate_api/models/options_ticker.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 OptionsTicker(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'last_price': 'str', + 'mark_price': 'str', + 'index_price': 'str', + 'ask1_size': 'int', + 'ask1_price': 'str', + 'bid1_size': 'int', + 'bid1_price': 'str', + 'position_size': 'int', + 'mark_iv': 'str', + 'bid_iv': 'str', + 'ask_iv': 'str', + 'leverage': 'str', + 'delta': 'str', + 'gamma': 'str', + 'vega': 'str', + 'theta': 'str', + 'rho': 'str' + } + + attribute_map = { + 'name': 'name', + 'last_price': 'last_price', + 'mark_price': 'mark_price', + 'index_price': 'index_price', + 'ask1_size': 'ask1_size', + 'ask1_price': 'ask1_price', + 'bid1_size': 'bid1_size', + 'bid1_price': 'bid1_price', + 'position_size': 'position_size', + 'mark_iv': 'mark_iv', + 'bid_iv': 'bid_iv', + 'ask_iv': 'ask_iv', + 'leverage': 'leverage', + 'delta': 'delta', + 'gamma': 'gamma', + 'vega': 'vega', + 'theta': 'theta', + 'rho': 'rho' + } + + def __init__(self, name=None, last_price=None, mark_price=None, index_price=None, ask1_size=None, ask1_price=None, bid1_size=None, bid1_price=None, position_size=None, mark_iv=None, bid_iv=None, ask_iv=None, leverage=None, delta=None, gamma=None, vega=None, theta=None, rho=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, int, str, int, str, int, str, str, str, str, str, str, str, str, str, Configuration) -> None + """OptionsTicker - a 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._last_price = None + self._mark_price = None + self._index_price = None + self._ask1_size = None + self._ask1_price = None + self._bid1_size = None + self._bid1_price = None + self._position_size = None + self._mark_iv = None + self._bid_iv = None + self._ask_iv = None + self._leverage = None + self._delta = None + self._gamma = None + self._vega = None + self._theta = None + self._rho = None + self.discriminator = None + + if name is not None: + self.name = name + if last_price is not None: + self.last_price = last_price + if mark_price is not None: + self.mark_price = mark_price + if index_price is not None: + self.index_price = index_price + if ask1_size is not None: + self.ask1_size = ask1_size + if ask1_price is not None: + self.ask1_price = ask1_price + if bid1_size is not None: + self.bid1_size = bid1_size + if bid1_price is not None: + self.bid1_price = bid1_price + if position_size is not None: + self.position_size = position_size + if mark_iv is not None: + self.mark_iv = mark_iv + if bid_iv is not None: + self.bid_iv = bid_iv + if ask_iv is not None: + self.ask_iv = ask_iv + if leverage is not None: + self.leverage = leverage + if delta is not None: + self.delta = delta + if gamma is not None: + self.gamma = gamma + if vega is not None: + self.vega = vega + if theta is not None: + self.theta = theta + if rho is not None: + self.rho = rho + + @property + def name(self): + """Gets the name of this OptionsTicker. # noqa: E501 + + Options contract name # noqa: E501 + + :return: The name of this OptionsTicker. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this OptionsTicker. + + Options contract name # noqa: E501 + + :param name: The name of this OptionsTicker. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def last_price(self): + """Gets the last_price of this OptionsTicker. # noqa: E501 + + Last trade price (quote currency) # noqa: E501 + + :return: The last_price of this OptionsTicker. # noqa: E501 + :rtype: str + """ + return self._last_price + + @last_price.setter + def last_price(self, last_price): + """Sets the last_price of this OptionsTicker. + + Last trade price (quote currency) # noqa: E501 + + :param last_price: The last_price of this OptionsTicker. # noqa: E501 + :type: str + """ + + self._last_price = last_price + + @property + def mark_price(self): + """Gets the mark_price of this OptionsTicker. # noqa: E501 + + Current mark price (quote currency) # noqa: E501 + + :return: The mark_price of this OptionsTicker. # noqa: E501 + :rtype: str + """ + return self._mark_price + + @mark_price.setter + def mark_price(self, mark_price): + """Sets the mark_price of this OptionsTicker. + + Current mark price (quote currency) # noqa: E501 + + :param mark_price: The mark_price of this OptionsTicker. # noqa: E501 + :type: str + """ + + self._mark_price = mark_price + + @property + def index_price(self): + """Gets the index_price of this OptionsTicker. # noqa: E501 + + Current index price (quote currency) # noqa: E501 + + :return: The index_price of this OptionsTicker. # noqa: E501 + :rtype: str + """ + return self._index_price + + @index_price.setter + def index_price(self, index_price): + """Sets the index_price of this OptionsTicker. + + Current index price (quote currency) # noqa: E501 + + :param index_price: The index_price of this OptionsTicker. # noqa: E501 + :type: str + """ + + self._index_price = index_price + + @property + def ask1_size(self): + """Gets the ask1_size of this OptionsTicker. # noqa: E501 + + Best ask size # noqa: E501 + + :return: The ask1_size of this OptionsTicker. # noqa: E501 + :rtype: int + """ + return self._ask1_size + + @ask1_size.setter + def ask1_size(self, ask1_size): + """Sets the ask1_size of this OptionsTicker. + + Best ask size # noqa: E501 + + :param ask1_size: The ask1_size of this OptionsTicker. # noqa: E501 + :type: int + """ + + self._ask1_size = ask1_size + + @property + def ask1_price(self): + """Gets the ask1_price of this OptionsTicker. # noqa: E501 + + Best ask price # noqa: E501 + + :return: The ask1_price of this OptionsTicker. # noqa: E501 + :rtype: str + """ + return self._ask1_price + + @ask1_price.setter + def ask1_price(self, ask1_price): + """Sets the ask1_price of this OptionsTicker. + + Best ask price # noqa: E501 + + :param ask1_price: The ask1_price of this OptionsTicker. # noqa: E501 + :type: str + """ + + self._ask1_price = ask1_price + + @property + def bid1_size(self): + """Gets the bid1_size of this OptionsTicker. # noqa: E501 + + Best bid size # noqa: E501 + + :return: The bid1_size of this OptionsTicker. # noqa: E501 + :rtype: int + """ + return self._bid1_size + + @bid1_size.setter + def bid1_size(self, bid1_size): + """Sets the bid1_size of this OptionsTicker. + + Best bid size # noqa: E501 + + :param bid1_size: The bid1_size of this OptionsTicker. # noqa: E501 + :type: int + """ + + self._bid1_size = bid1_size + + @property + def bid1_price(self): + """Gets the bid1_price of this OptionsTicker. # noqa: E501 + + Best bid price # noqa: E501 + + :return: The bid1_price of this OptionsTicker. # noqa: E501 + :rtype: str + """ + return self._bid1_price + + @bid1_price.setter + def bid1_price(self, bid1_price): + """Sets the bid1_price of this OptionsTicker. + + Best bid price # noqa: E501 + + :param bid1_price: The bid1_price of this OptionsTicker. # noqa: E501 + :type: str + """ + + self._bid1_price = bid1_price + + @property + def position_size(self): + """Gets the position_size of this OptionsTicker. # noqa: E501 + + Current total long position size # noqa: E501 + + :return: The position_size of this OptionsTicker. # noqa: E501 + :rtype: int + """ + return self._position_size + + @position_size.setter + def position_size(self, position_size): + """Sets the position_size of this OptionsTicker. + + Current total long position size # noqa: E501 + + :param position_size: The position_size of this OptionsTicker. # noqa: E501 + :type: int + """ + + self._position_size = position_size + + @property + def mark_iv(self): + """Gets the mark_iv of this OptionsTicker. # noqa: E501 + + Implied volatility # noqa: E501 + + :return: The mark_iv of this OptionsTicker. # noqa: E501 + :rtype: str + """ + return self._mark_iv + + @mark_iv.setter + def mark_iv(self, mark_iv): + """Sets the mark_iv of this OptionsTicker. + + Implied volatility # noqa: E501 + + :param mark_iv: The mark_iv of this OptionsTicker. # noqa: E501 + :type: str + """ + + self._mark_iv = mark_iv + + @property + def bid_iv(self): + """Gets the bid_iv of this OptionsTicker. # noqa: E501 + + Bid side implied volatility # noqa: E501 + + :return: The bid_iv of this OptionsTicker. # noqa: E501 + :rtype: str + """ + return self._bid_iv + + @bid_iv.setter + def bid_iv(self, bid_iv): + """Sets the bid_iv of this OptionsTicker. + + Bid side implied volatility # noqa: E501 + + :param bid_iv: The bid_iv of this OptionsTicker. # noqa: E501 + :type: str + """ + + self._bid_iv = bid_iv + + @property + def ask_iv(self): + """Gets the ask_iv of this OptionsTicker. # noqa: E501 + + Ask side implied volatility # noqa: E501 + + :return: The ask_iv of this OptionsTicker. # noqa: E501 + :rtype: str + """ + return self._ask_iv + + @ask_iv.setter + def ask_iv(self, ask_iv): + """Sets the ask_iv of this OptionsTicker. + + Ask side implied volatility # noqa: E501 + + :param ask_iv: The ask_iv of this OptionsTicker. # noqa: E501 + :type: str + """ + + self._ask_iv = ask_iv + + @property + def leverage(self): + """Gets the leverage of this OptionsTicker. # noqa: E501 + + Current leverage. Formula: underlying_price / mark_price * delta # noqa: E501 + + :return: The leverage of this OptionsTicker. # noqa: E501 + :rtype: str + """ + return self._leverage + + @leverage.setter + def leverage(self, leverage): + """Sets the leverage of this OptionsTicker. + + Current leverage. Formula: underlying_price / mark_price * delta # noqa: E501 + + :param leverage: The leverage of this OptionsTicker. # noqa: E501 + :type: str + """ + + self._leverage = leverage + + @property + def delta(self): + """Gets the delta of this OptionsTicker. # noqa: E501 + + Greek letter delta # noqa: E501 + + :return: The delta of this OptionsTicker. # noqa: E501 + :rtype: str + """ + return self._delta + + @delta.setter + def delta(self, delta): + """Sets the delta of this OptionsTicker. + + Greek letter delta # noqa: E501 + + :param delta: The delta of this OptionsTicker. # noqa: E501 + :type: str + """ + + self._delta = delta + + @property + def gamma(self): + """Gets the gamma of this OptionsTicker. # noqa: E501 + + Greek letter gamma # noqa: E501 + + :return: The gamma of this OptionsTicker. # noqa: E501 + :rtype: str + """ + return self._gamma + + @gamma.setter + def gamma(self, gamma): + """Sets the gamma of this OptionsTicker. + + Greek letter gamma # noqa: E501 + + :param gamma: The gamma of this OptionsTicker. # noqa: E501 + :type: str + """ + + self._gamma = gamma + + @property + def vega(self): + """Gets the vega of this OptionsTicker. # noqa: E501 + + Greek letter vega # noqa: E501 + + :return: The vega of this OptionsTicker. # noqa: E501 + :rtype: str + """ + return self._vega + + @vega.setter + def vega(self, vega): + """Sets the vega of this OptionsTicker. + + Greek letter vega # noqa: E501 + + :param vega: The vega of this OptionsTicker. # noqa: E501 + :type: str + """ + + self._vega = vega + + @property + def theta(self): + """Gets the theta of this OptionsTicker. # noqa: E501 + + Greek letter theta # noqa: E501 + + :return: The theta of this OptionsTicker. # noqa: E501 + :rtype: str + """ + return self._theta + + @theta.setter + def theta(self, theta): + """Sets the theta of this OptionsTicker. + + Greek letter theta # noqa: E501 + + :param theta: The theta of this OptionsTicker. # noqa: E501 + :type: str + """ + + self._theta = theta + + @property + def rho(self): + """Gets the rho of this OptionsTicker. # noqa: E501 + + Rho # noqa: E501 + + :return: The rho of this OptionsTicker. # noqa: E501 + :rtype: str + """ + return self._rho + + @rho.setter + def rho(self, rho): + """Sets the rho of this OptionsTicker. + + Rho # noqa: E501 + + :param rho: The rho of this OptionsTicker. # noqa: E501 + :type: str + """ + + self._rho = rho + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OptionsTicker): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OptionsTicker): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/options_underlying.py b/gate_api/models/options_underlying.py new file mode 100644 index 0000000..89abb3f --- /dev/null +++ b/gate_api/models/options_underlying.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 OptionsUnderlying(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'index_price': 'str' + } + + attribute_map = { + 'name': 'name', + 'index_price': 'index_price' + } + + def __init__(self, name=None, index_price=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """OptionsUnderlying - a 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._index_price = None + self.discriminator = None + + if name is not None: + self.name = name + if index_price is not None: + self.index_price = index_price + + @property + def name(self): + """Gets the name of this OptionsUnderlying. # noqa: E501 + + Underlying name # noqa: E501 + + :return: The name of this OptionsUnderlying. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this OptionsUnderlying. + + Underlying name # noqa: E501 + + :param name: The name of this OptionsUnderlying. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def index_price(self): + """Gets the index_price of this OptionsUnderlying. # noqa: E501 + + Spot index price (quote currency) # noqa: E501 + + :return: The index_price of this OptionsUnderlying. # noqa: E501 + :rtype: str + """ + return self._index_price + + @index_price.setter + def index_price(self, index_price): + """Sets the index_price of this OptionsUnderlying. + + Spot index price (quote currency) # noqa: E501 + + :param index_price: The index_price of this OptionsUnderlying. # noqa: E501 + :type: str + """ + + self._index_price = index_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, OptionsUnderlying): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OptionsUnderlying): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/options_underlying_ticker.py b/gate_api/models/options_underlying_ticker.py new file mode 100644 index 0000000..8ce402e --- /dev/null +++ b/gate_api/models/options_underlying_ticker.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 OptionsUnderlyingTicker(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'trade_put': 'int', + 'trade_call': 'int', + 'index_price': 'str' + } + + attribute_map = { + 'trade_put': 'trade_put', + 'trade_call': 'trade_call', + 'index_price': 'index_price' + } + + def __init__(self, trade_put=None, trade_call=None, index_price=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, str, Configuration) -> None + """OptionsUnderlyingTicker - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._trade_put = None + self._trade_call = None + self._index_price = None + self.discriminator = None + + if trade_put is not None: + self.trade_put = trade_put + if trade_call is not None: + self.trade_call = trade_call + if index_price is not None: + self.index_price = index_price + + @property + def trade_put(self): + """Gets the trade_put of this OptionsUnderlyingTicker. # noqa: E501 + + Total put options trades amount in last 24h # noqa: E501 + + :return: The trade_put of this OptionsUnderlyingTicker. # noqa: E501 + :rtype: int + """ + return self._trade_put + + @trade_put.setter + def trade_put(self, trade_put): + """Sets the trade_put of this OptionsUnderlyingTicker. + + Total put options trades amount in last 24h # noqa: E501 + + :param trade_put: The trade_put of this OptionsUnderlyingTicker. # noqa: E501 + :type: int + """ + + self._trade_put = trade_put + + @property + def trade_call(self): + """Gets the trade_call of this OptionsUnderlyingTicker. # noqa: E501 + + Total call options trades amount in last 24h # noqa: E501 + + :return: The trade_call of this OptionsUnderlyingTicker. # noqa: E501 + :rtype: int + """ + return self._trade_call + + @trade_call.setter + def trade_call(self, trade_call): + """Sets the trade_call of this OptionsUnderlyingTicker. + + Total call options trades amount in last 24h # noqa: E501 + + :param trade_call: The trade_call of this OptionsUnderlyingTicker. # noqa: E501 + :type: int + """ + + self._trade_call = trade_call + + @property + def index_price(self): + """Gets the index_price of this OptionsUnderlyingTicker. # noqa: E501 + + Index price (quote currency) # noqa: E501 + + :return: The index_price of this OptionsUnderlyingTicker. # noqa: E501 + :rtype: str + """ + return self._index_price + + @index_price.setter + def index_price(self, index_price): + """Sets the index_price of this OptionsUnderlyingTicker. + + Index price (quote currency) # noqa: E501 + + :param index_price: The index_price of this OptionsUnderlyingTicker. # noqa: E501 + :type: str + """ + + self._index_price = index_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, OptionsUnderlyingTicker): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OptionsUnderlyingTicker): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/order.py b/gate_api/models/order.py index 3793ee8..7555321 100644 --- a/gate_api/models/order.py +++ b/gate_api/models/order.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -35,6 +35,7 @@ class Order(object): openapi_types = { 'id': 'str', 'text': 'str', + 'amend_text': 'str', 'create_time': 'str', 'update_time': 'str', 'create_time_ms': 'int', @@ -51,20 +52,29 @@ class Order(object): 'auto_borrow': 'bool', 'auto_repay': 'bool', 'left': 'str', + 'filled_amount': 'str', 'fill_price': 'str', 'filled_total': 'str', + 'avg_deal_price': 'str', 'fee': 'str', 'fee_currency': 'str', 'point_fee': 'str', 'gt_fee': 'str', + 'gt_maker_fee': 'str', + 'gt_taker_fee': 'str', 'gt_discount': 'bool', 'rebated_fee': 'str', 'rebated_fee_currency': 'str', + 'stp_id': 'int', + 'stp_act': 'str', + 'finish_as': 'str', + 'action_mode': 'str' } attribute_map = { 'id': 'id', 'text': 'text', + 'amend_text': 'amend_text', 'create_time': 'create_time', 'update_time': 'update_time', 'create_time_ms': 'create_time_ms', @@ -81,49 +91,27 @@ class Order(object): 'auto_borrow': 'auto_borrow', 'auto_repay': 'auto_repay', 'left': 'left', + 'filled_amount': 'filled_amount', 'fill_price': 'fill_price', 'filled_total': 'filled_total', + 'avg_deal_price': 'avg_deal_price', 'fee': 'fee', 'fee_currency': 'fee_currency', 'point_fee': 'point_fee', 'gt_fee': 'gt_fee', + 'gt_maker_fee': 'gt_maker_fee', + 'gt_taker_fee': 'gt_taker_fee', 'gt_discount': 'gt_discount', 'rebated_fee': 'rebated_fee', 'rebated_fee_currency': 'rebated_fee_currency', + 'stp_id': 'stp_id', + 'stp_act': 'stp_act', + 'finish_as': 'finish_as', + 'action_mode': 'action_mode' } - def __init__( - self, - id=None, - 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, - fill_price=None, - filled_total=None, - fee=None, - fee_currency=None, - point_fee=None, - gt_fee=None, - gt_discount=None, - rebated_fee=None, - rebated_fee_currency=None, - local_vars_configuration=None, - ): # noqa: E501 - # type: (str, str, str, str, int, int, str, str, str, str, str, str, str, str, str, bool, bool, str, str, str, str, str, str, str, bool, 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, 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, Configuration) -> None """Order - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -131,6 +119,7 @@ def __init__( self._id = None self._text = None + self._amend_text = None self._create_time = None self._update_time = None self._create_time_ms = None @@ -147,21 +136,31 @@ def __init__( self._auto_borrow = None self._auto_repay = None self._left = None + self._filled_amount = None self._fill_price = None self._filled_total = None + self._avg_deal_price = None self._fee = None self._fee_currency = None self._point_fee = None self._gt_fee = None + self._gt_maker_fee = None + self._gt_taker_fee = None self._gt_discount = None self._rebated_fee = None self._rebated_fee_currency = None + self._stp_id = None + self._stp_act = None + self._finish_as = None + self._action_mode = None self.discriminator = None if id is not None: self.id = id if text is not None: self.text = text + if amend_text is not None: + self.amend_text = amend_text if create_time is not None: self.create_time = create_time if update_time is not None: @@ -179,7 +178,8 @@ def __init__( self.account = account self.side = side self.amount = amount - self.price = price + if price is not None: + self.price = price if time_in_force is not None: self.time_in_force = time_in_force if iceberg is not None: @@ -190,10 +190,14 @@ def __init__( self.auto_repay = auto_repay if left is not None: self.left = left + if filled_amount is not None: + self.filled_amount = filled_amount if fill_price is not None: self.fill_price = fill_price if filled_total is not None: self.filled_total = filled_total + if avg_deal_price is not None: + self.avg_deal_price = avg_deal_price if fee is not None: self.fee = fee if fee_currency is not None: @@ -202,12 +206,24 @@ def __init__( self.point_fee = point_fee if gt_fee is not None: self.gt_fee = gt_fee + if gt_maker_fee is not None: + self.gt_maker_fee = gt_maker_fee + if gt_taker_fee is not None: + self.gt_taker_fee = gt_taker_fee if gt_discount is not None: self.gt_discount = gt_discount if rebated_fee is not None: self.rebated_fee = rebated_fee if rebated_fee_currency is not None: self.rebated_fee_currency = rebated_fee_currency + if stp_id is not None: + self.stp_id = stp_id + if stp_act is not None: + self.stp_act = stp_act + if finish_as is not None: + self.finish_as = finish_as + if action_mode is not None: + self.action_mode = action_mode @property def id(self): @@ -236,7 +252,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(.) # 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 Order. # noqa: E501 :rtype: str @@ -247,7 +263,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(.) # 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 Order. # noqa: E501 :type: str @@ -255,6 +271,29 @@ def text(self, text): self._text = text + @property + def amend_text(self): + """Gets the amend_text of this Order. # noqa: E501 + + The custom data that the user remarked when amending the order # noqa: E501 + + :return: The amend_text of this Order. # noqa: E501 + :rtype: str + """ + return self._amend_text + + @amend_text.setter + def amend_text(self, amend_text): + """Sets the amend_text of this Order. + + The custom data that the user remarked when amending the order # noqa: E501 + + :param amend_text: The amend_text of this Order. # noqa: E501 + :type: str + """ + + self._amend_text = amend_text + @property def create_time(self): """Gets the create_time of this Order. # noqa: E501 @@ -370,7 +409,8 @@ def status(self, status): allowed_values = ["open", "closed", "cancelled"] # 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}".format(status, allowed_values) # noqa: E501 + "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 + .format(status, allowed_values) ) self._status = status @@ -404,7 +444,7 @@ def currency_pair(self, currency_pair): def type(self): """Gets the type of this Order. # noqa: E501 - Order type. limit - limit order # noqa: E501 + Order Type - limit : Limit Order - market : Market Order # noqa: E501 :return: The type of this Order. # noqa: E501 :rtype: str @@ -415,15 +455,16 @@ def type(self): def type(self, type): """Sets the type of this Order. - Order type. limit - limit order # noqa: E501 + Order Type - limit : Limit Order - market : Market Order # noqa: E501 :param type: The type of this Order. # noqa: E501 :type: str """ - allowed_values = ["limit"] # noqa: E501 + 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}".format(type, allowed_values) # noqa: E501 + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) ) self._type = type @@ -432,7 +473,7 @@ def type(self, type): def account(self): """Gets the account of this Order. # noqa: E501 - Account type. spot - use spot account; margin - use margin account; cross_margin - use cross margin account # noqa: E501 + Account type, spot - spot account, margin - leveraged account, unified - unified account # noqa: E501 :return: The account of this Order. # noqa: E501 :rtype: str @@ -443,16 +484,11 @@ def account(self): def account(self, account): """Sets the account of this Order. - Account type. spot - use spot account; margin - use margin account; cross_margin - use cross margin account # noqa: E501 + Account type, spot - spot account, margin - leveraged account, unified - unified account # noqa: E501 :param account: The account of this Order. # noqa: E501 :type: str """ - allowed_values = ["spot", "margin", "cross_margin"] # noqa: E501 - if self.local_vars_configuration.client_side_validation and account not in allowed_values: # noqa: E501 - raise ValueError( - "Invalid value for `account` ({0}), must be one of {1}".format(account, allowed_values) # noqa: E501 - ) self._account = account @@ -460,7 +496,7 @@ def account(self, account): def side(self): """Gets the side of this Order. # noqa: E501 - Order side # noqa: E501 + Buy or sell order # noqa: E501 :return: The side of this Order. # noqa: E501 :rtype: str @@ -471,7 +507,7 @@ def side(self): def side(self, side): """Sets the side of this Order. - Order side # noqa: E501 + Buy or sell order # noqa: E501 :param side: The side of this Order. # noqa: E501 :type: str @@ -481,7 +517,8 @@ def side(self, side): 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}".format(side, allowed_values) # noqa: E501 + "Invalid value for `side` ({0}), must be one of {1}" # noqa: E501 + .format(side, allowed_values) ) self._side = side @@ -490,7 +527,7 @@ def side(self, side): def amount(self): """Gets the amount of this Order. # noqa: E501 - Trade amount # 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 :return: The amount of this Order. # noqa: E501 :rtype: str @@ -501,7 +538,7 @@ def amount(self): def amount(self, amount): """Sets the amount of this Order. - Trade amount # 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 :param amount: The amount of this Order. # noqa: E501 :type: str @@ -515,7 +552,7 @@ def amount(self, amount): def price(self): """Gets the price of this Order. # noqa: E501 - Order price # noqa: E501 + Trading price, required when `type`=`limit` # noqa: E501 :return: The price of this Order. # noqa: E501 :rtype: str @@ -526,13 +563,11 @@ def price(self): def price(self, price): """Sets the price of this Order. - Order price # noqa: E501 + Trading price, required when `type`=`limit` # noqa: E501 :param price: The price of this Order. # 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 @@ -540,7 +575,7 @@ def price(self, price): def time_in_force(self): """Gets the time_in_force of this Order. # noqa: E501 - Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee # 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 Only `ioc` and `fok` are supported when `type`=`market` # noqa: E501 :return: The time_in_force of this Order. # noqa: E501 :rtype: str @@ -551,17 +586,16 @@ def time_in_force(self): def time_in_force(self, time_in_force): """Sets the time_in_force of this Order. - Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee # 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 Only `ioc` and `fok` are supported when `type`=`market` # noqa: E501 :param time_in_force: The time_in_force of this Order. # noqa: E501 :type: str """ - allowed_values = ["gtc", "ioc", "poc"] # noqa: E501 + allowed_values = ["gtc", "ioc", "poc", "fok"] # 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}".format( # noqa: E501 - time_in_force, allowed_values - ) + "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 @@ -570,7 +604,7 @@ def time_in_force(self, time_in_force): def iceberg(self): """Gets the iceberg of this Order. # noqa: E501 - Amount to display for the iceberg order. Null or 0 for normal orders. Set to -1 to hide the order completely # noqa: E501 + Amount to display for the iceberg order. Null or 0 for normal orders. Hiding all amount is not supported # noqa: E501 :return: The iceberg of this Order. # noqa: E501 :rtype: str @@ -581,7 +615,7 @@ def iceberg(self): def iceberg(self, iceberg): """Sets the iceberg of this Order. - Amount to display for the iceberg order. Null or 0 for normal orders. Set to -1 to hide the order completely # noqa: E501 + Amount to display for the iceberg order. Null or 0 for normal orders. Hiding all amount is not supported # noqa: E501 :param iceberg: The iceberg of this Order. # noqa: E501 :type: str @@ -593,7 +627,7 @@ def iceberg(self, iceberg): def auto_borrow(self): """Gets the auto_borrow of this Order. # noqa: E501 - Used in margin or cross margin trading to allow automatic loan of insufficient amount if balance is not enough. # noqa: E501 + Used in margin or cross margin trading to allow automatic loan of insufficient amount if balance is not enough # noqa: E501 :return: The auto_borrow of this Order. # noqa: E501 :rtype: bool @@ -604,7 +638,7 @@ def auto_borrow(self): def auto_borrow(self, auto_borrow): """Sets the auto_borrow of this Order. - Used in margin or cross margin trading to allow automatic loan of insufficient amount if balance is not enough. # noqa: E501 + Used in margin or cross margin trading to allow automatic loan of insufficient amount if balance is not enough # noqa: E501 :param auto_borrow: The auto_borrow of this Order. # noqa: E501 :type: bool @@ -616,7 +650,7 @@ def auto_borrow(self, auto_borrow): def auto_repay(self): """Gets the auto_repay of this Order. # noqa: E501 - Enable or disable automatic repayment for automatic borrow loan generated by cross margin order. Default is disabled. Note that: 1. This field is only effective for cross margin orders. Margin account does not support setting auto repayment for orders. 2. `auto_borrow` and `auto_repay` cannot be both set to true in one order. # noqa: E501 + Enable or disable automatic repayment for automatic borrow loan generated by cross margin order. Default is disabled. Note that: 1. This field is only effective for cross margin orders. Margin account does not support setting auto repayment for orders. 2. `auto_borrow` and `auto_repay` can be both set to true in one order # noqa: E501 :return: The auto_repay of this Order. # noqa: E501 :rtype: bool @@ -627,7 +661,7 @@ def auto_repay(self): def auto_repay(self, auto_repay): """Sets the auto_repay of this Order. - Enable or disable automatic repayment for automatic borrow loan generated by cross margin order. Default is disabled. Note that: 1. This field is only effective for cross margin orders. Margin account does not support setting auto repayment for orders. 2. `auto_borrow` and `auto_repay` cannot be both set to true in one order. # noqa: E501 + Enable or disable automatic repayment for automatic borrow loan generated by cross margin order. Default is disabled. Note that: 1. This field is only effective for cross margin orders. Margin account does not support setting auto repayment for orders. 2. `auto_borrow` and `auto_repay` can be both set to true in one order # noqa: E501 :param auto_repay: The auto_repay of this Order. # noqa: E501 :type: bool @@ -658,6 +692,29 @@ def left(self, left): self._left = left + @property + def filled_amount(self): + """Gets the filled_amount of this Order. # noqa: E501 + + Amount filled # noqa: E501 + + :return: The filled_amount of this Order. # noqa: E501 + :rtype: str + """ + return self._filled_amount + + @filled_amount.setter + def filled_amount(self, filled_amount): + """Sets the filled_amount of this Order. + + Amount filled # noqa: E501 + + :param filled_amount: The filled_amount of this Order. # noqa: E501 + :type: str + """ + + self._filled_amount = filled_amount + @property def fill_price(self): """Gets the fill_price of this Order. # noqa: E501 @@ -704,6 +761,29 @@ def filled_total(self, filled_total): self._filled_total = filled_total + @property + def avg_deal_price(self): + """Gets the avg_deal_price of this Order. # noqa: E501 + + Average fill price # noqa: E501 + + :return: The avg_deal_price of this Order. # noqa: E501 + :rtype: str + """ + return self._avg_deal_price + + @avg_deal_price.setter + def avg_deal_price(self, avg_deal_price): + """Sets the avg_deal_price of this Order. + + Average fill price # noqa: E501 + + :param avg_deal_price: The avg_deal_price of this Order. # noqa: E501 + :type: str + """ + + self._avg_deal_price = avg_deal_price + @property def fee(self): """Gets the fee of this Order. # noqa: E501 @@ -796,11 +876,57 @@ def gt_fee(self, gt_fee): self._gt_fee = gt_fee + @property + def gt_maker_fee(self): + """Gets the gt_maker_fee of this Order. # noqa: E501 + + GT amount used to deduct maker fee # noqa: E501 + + :return: The gt_maker_fee of this Order. # noqa: E501 + :rtype: str + """ + return self._gt_maker_fee + + @gt_maker_fee.setter + def gt_maker_fee(self, gt_maker_fee): + """Sets the gt_maker_fee of this Order. + + GT amount used to deduct maker fee # noqa: E501 + + :param gt_maker_fee: The gt_maker_fee of this Order. # noqa: E501 + :type: str + """ + + self._gt_maker_fee = gt_maker_fee + + @property + def gt_taker_fee(self): + """Gets the gt_taker_fee of this Order. # noqa: E501 + + GT amount used to deduct taker fee # noqa: E501 + + :return: The gt_taker_fee of this Order. # noqa: E501 + :rtype: str + """ + return self._gt_taker_fee + + @gt_taker_fee.setter + def gt_taker_fee(self, gt_taker_fee): + """Sets the gt_taker_fee of this Order. + + GT amount used to deduct taker fee # noqa: E501 + + :param gt_taker_fee: The gt_taker_fee of this Order. # noqa: E501 + :type: str + """ + + self._gt_taker_fee = gt_taker_fee + @property def gt_discount(self): """Gets the gt_discount of this Order. # noqa: E501 - Whether GT fee discount is used # noqa: E501 + Whether GT fee deduction is enabled # noqa: E501 :return: The gt_discount of this Order. # noqa: E501 :rtype: bool @@ -811,7 +937,7 @@ def gt_discount(self): def gt_discount(self, gt_discount): """Sets the gt_discount of this Order. - Whether GT fee discount is used # noqa: E501 + Whether GT fee deduction is enabled # noqa: E501 :param gt_discount: The gt_discount of this Order. # noqa: E501 :type: bool @@ -865,6 +991,110 @@ def rebated_fee_currency(self, rebated_fee_currency): self._rebated_fee_currency = rebated_fee_currency + @property + def stp_id(self): + """Gets the stp_id of this Order. # 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 Order. # noqa: E501 + :rtype: int + """ + return self._stp_id + + @stp_id.setter + def stp_id(self, stp_id): + """Sets the stp_id of this Order. + + 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 Order. # noqa: E501 + :type: int + """ + + self._stp_id = stp_id + + @property + def stp_act(self): + """Gets the stp_act of this Order. # 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 Order. # noqa: E501 + :rtype: str + """ + return self._stp_act + + @stp_act.setter + def stp_act(self, stp_act): + """Sets the stp_act of this Order. + + 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 Order. # noqa: E501 + :type: str + """ + allowed_values = ["cn", "co", "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 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 + + :return: The finish_as of this Order. # noqa: E501 + :rtype: str + """ + return self._finish_as + + @finish_as.setter + 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 + + :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 + 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 action_mode(self): + """Gets the action_mode of this Order. # noqa: E501 + + 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) # noqa: E501 + + :return: The action_mode of this Order. # noqa: E501 + :rtype: str + """ + return self._action_mode + + @action_mode.setter + def action_mode(self, action_mode): + """Sets the action_mode of this Order. + + 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) # noqa: E501 + + :param action_mode: The action_mode of this Order. # noqa: E501 + :type: str + """ + + self._action_mode = action_mode + def to_dict(self): """Returns the model properties as a dict""" result = {} @@ -872,16 +1102,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/order_book.py b/gate_api/models/order_book.py index d6862bd..a469fe7 100644 --- a/gate_api/models/order_book.py +++ b/gate_api/models/order_book.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -37,14 +37,18 @@ class OrderBook(object): 'current': 'int', 'update': 'int', 'asks': 'list[list[str]]', - 'bids': 'list[list[str]]', + 'bids': 'list[list[str]]' } - attribute_map = {'id': 'id', 'current': 'current', 'update': 'update', 'asks': 'asks', 'bids': 'bids'} + attribute_map = { + 'id': 'id', + 'current': 'current', + 'update': 'update', + 'asks': 'asks', + 'bids': 'bids' + } - def __init__( - self, id=None, current=None, update=None, asks=None, bids=None, local_vars_configuration=None - ): # noqa: E501 + def __init__(self, id=None, current=None, update=None, asks=None, bids=None, local_vars_configuration=None): # noqa: E501 # type: (int, int, int, list[list[str]], list[list[str]], Configuration) -> None """OrderBook - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: @@ -140,7 +144,7 @@ def update(self, update): def asks(self): """Gets the asks of this OrderBook. # noqa: E501 - Asks order depth # noqa: E501 + Ask Depth # noqa: E501 :return: The asks of this OrderBook. # noqa: E501 :rtype: list[list[str]] @@ -151,7 +155,7 @@ def asks(self): def asks(self, asks): """Sets the asks of this OrderBook. - Asks order depth # noqa: E501 + Ask Depth # noqa: E501 :param asks: The asks of this OrderBook. # noqa: E501 :type: list[list[str]] @@ -165,7 +169,7 @@ def asks(self, asks): def bids(self): """Gets the bids of this OrderBook. # noqa: E501 - Bids order depth # noqa: E501 + Bid Depth # noqa: E501 :return: The bids of this OrderBook. # noqa: E501 :rtype: list[list[str]] @@ -176,7 +180,7 @@ def bids(self): def bids(self, bids): """Sets the bids of this OrderBook. - Bids order depth # noqa: E501 + Bid Depth # noqa: E501 :param bids: The bids of this OrderBook. # noqa: E501 :type: list[list[str]] @@ -193,16 +197,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/order_cancel.py b/gate_api/models/order_cancel.py new file mode 100644 index 0000000..ba1457e --- /dev/null +++ b/gate_api/models/order_cancel.py @@ -0,0 +1,1226 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OrderCancel(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'amend_text': 'str', + 'succeeded': 'bool', + 'label': 'str', + 'message': 'str', + 'create_time': 'str', + 'update_time': 'str', + 'create_time_ms': 'int', + 'update_time_ms': 'int', + 'status': 'str', + 'currency_pair': 'str', + 'type': 'str', + 'account': 'str', + 'side': 'str', + 'amount': 'str', + 'price': 'str', + 'time_in_force': 'str', + 'iceberg': 'str', + 'auto_borrow': 'bool', + 'auto_repay': 'bool', + 'left': 'str', + 'filled_amount': 'str', + 'fill_price': 'str', + 'filled_total': 'str', + 'avg_deal_price': 'str', + 'fee': 'str', + 'fee_currency': 'str', + 'point_fee': 'str', + 'gt_fee': 'str', + 'gt_maker_fee': 'str', + 'gt_taker_fee': 'str', + 'gt_discount': 'bool', + 'rebated_fee': 'str', + 'rebated_fee_currency': 'str', + 'stp_id': 'int', + 'stp_act': 'str', + 'finish_as': 'str', + 'action_mode': 'str' + } + + attribute_map = { + 'id': 'id', + 'text': 'text', + 'amend_text': 'amend_text', + 'succeeded': 'succeeded', + 'label': 'label', + 'message': 'message', + 'create_time': 'create_time', + 'update_time': 'update_time', + 'create_time_ms': 'create_time_ms', + 'update_time_ms': 'update_time_ms', + 'status': 'status', + 'currency_pair': 'currency_pair', + 'type': 'type', + 'account': 'account', + 'side': 'side', + 'amount': 'amount', + 'price': 'price', + 'time_in_force': 'time_in_force', + 'iceberg': 'iceberg', + 'auto_borrow': 'auto_borrow', + 'auto_repay': 'auto_repay', + 'left': 'left', + 'filled_amount': 'filled_amount', + 'fill_price': 'fill_price', + 'filled_total': 'filled_total', + 'avg_deal_price': 'avg_deal_price', + 'fee': 'fee', + 'fee_currency': 'fee_currency', + 'point_fee': 'point_fee', + 'gt_fee': 'gt_fee', + 'gt_maker_fee': 'gt_maker_fee', + 'gt_taker_fee': 'gt_taker_fee', + 'gt_discount': 'gt_discount', + 'rebated_fee': 'rebated_fee', + 'rebated_fee_currency': 'rebated_fee_currency', + 'stp_id': 'stp_id', + 'stp_act': 'stp_act', + 'finish_as': 'finish_as', + 'action_mode': 'action_mode' + } + + def __init__(self, id=None, text=None, amend_text=None, succeeded=None, label=None, message=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, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, bool, 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, Configuration) -> None + """OrderCancel - a 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._amend_text = None + self._succeeded = None + self._label = None + self._message = None + self._create_time = None + self._update_time = None + self._create_time_ms = None + self._update_time_ms = None + self._status = None + self._currency_pair = None + self._type = None + self._account = None + self._side = None + self._amount = None + self._price = None + self._time_in_force = None + self._iceberg = None + self._auto_borrow = None + self._auto_repay = None + self._left = None + self._filled_amount = None + self._fill_price = None + self._filled_total = None + self._avg_deal_price = None + self._fee = None + self._fee_currency = None + self._point_fee = None + self._gt_fee = None + self._gt_maker_fee = None + self._gt_taker_fee = None + self._gt_discount = None + self._rebated_fee = None + self._rebated_fee_currency = None + self._stp_id = None + self._stp_act = None + self._finish_as = None + self._action_mode = None + self.discriminator = None + + if id is not None: + self.id = id + if text is not None: + self.text = text + if amend_text is not None: + self.amend_text = amend_text + if succeeded is not None: + self.succeeded = succeeded + if label is not None: + self.label = label + if message is not None: + self.message = message + if create_time is not None: + self.create_time = create_time + if update_time is not None: + self.update_time = update_time + if create_time_ms is not None: + self.create_time_ms = create_time_ms + if update_time_ms is not None: + self.update_time_ms = update_time_ms + if status is not None: + self.status = status + self.currency_pair = currency_pair + if type is not None: + self.type = type + if account is not None: + self.account = account + self.side = side + self.amount = amount + if price is not None: + self.price = price + if time_in_force is not None: + self.time_in_force = time_in_force + if iceberg is not None: + self.iceberg = iceberg + if auto_borrow is not None: + self.auto_borrow = auto_borrow + if auto_repay is not None: + self.auto_repay = auto_repay + if left is not None: + self.left = left + if filled_amount is not None: + self.filled_amount = filled_amount + if fill_price is not None: + self.fill_price = fill_price + if filled_total is not None: + self.filled_total = filled_total + if avg_deal_price is not None: + self.avg_deal_price = avg_deal_price + if fee is not None: + self.fee = fee + if fee_currency is not None: + self.fee_currency = fee_currency + if point_fee is not None: + self.point_fee = point_fee + if gt_fee is not None: + self.gt_fee = gt_fee + if gt_maker_fee is not None: + self.gt_maker_fee = gt_maker_fee + if gt_taker_fee is not None: + self.gt_taker_fee = gt_taker_fee + if gt_discount is not None: + self.gt_discount = gt_discount + if rebated_fee is not None: + self.rebated_fee = rebated_fee + if rebated_fee_currency is not None: + self.rebated_fee_currency = rebated_fee_currency + if stp_id is not None: + self.stp_id = stp_id + if stp_act is not None: + self.stp_act = stp_act + if finish_as is not None: + self.finish_as = finish_as + if action_mode is not None: + self.action_mode = action_mode + + @property + def id(self): + """Gets the id of this OrderCancel. # noqa: E501 + + Order ID # noqa: E501 + + :return: The id of this OrderCancel. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this OrderCancel. + + Order ID # noqa: E501 + + :param id: The id of this OrderCancel. # noqa: E501 + :type: str + """ + + self._id = id + + @property + 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 + + :return: The text of this OrderCancel. # noqa: E501 + :rtype: str + """ + return self._text + + @text.setter + 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 + + :param text: The text of this OrderCancel. # noqa: E501 + :type: str + """ + + self._text = text + + @property + def amend_text(self): + """Gets the amend_text of this OrderCancel. # noqa: E501 + + The custom data that the user remarked when amending the order # noqa: E501 + + :return: The amend_text of this OrderCancel. # noqa: E501 + :rtype: str + """ + return self._amend_text + + @amend_text.setter + def amend_text(self, amend_text): + """Sets the amend_text of this OrderCancel. + + The custom data that the user remarked when amending the order # noqa: E501 + + :param amend_text: The amend_text of this OrderCancel. # noqa: E501 + :type: str + """ + + self._amend_text = amend_text + + @property + def succeeded(self): + """Gets the succeeded of this OrderCancel. # noqa: E501 + + Request execution result # noqa: E501 + + :return: The succeeded of this OrderCancel. # noqa: E501 + :rtype: bool + """ + return self._succeeded + + @succeeded.setter + def succeeded(self, succeeded): + """Sets the succeeded of this OrderCancel. + + Request execution result # noqa: E501 + + :param succeeded: The succeeded of this OrderCancel. # noqa: E501 + :type: bool + """ + + self._succeeded = succeeded + + @property + def label(self): + """Gets the label of this OrderCancel. # noqa: E501 + + Error label, if any, otherwise an empty string # noqa: E501 + + :return: The label of this OrderCancel. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this OrderCancel. + + Error label, if any, otherwise an empty string # noqa: E501 + + :param label: The label of this OrderCancel. # noqa: E501 + :type: str + """ + + self._label = label + + @property + def message(self): + """Gets the message of this OrderCancel. # noqa: E501 + + Detailed error message, if any, otherwise an empty string # noqa: E501 + + :return: The message of this OrderCancel. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this OrderCancel. + + Detailed error message, if any, otherwise an empty string # noqa: E501 + + :param message: The message of this OrderCancel. # noqa: E501 + :type: str + """ + + self._message = message + + @property + def create_time(self): + """Gets the create_time of this OrderCancel. # noqa: E501 + + Creation time of order # noqa: E501 + + :return: The create_time of this OrderCancel. # noqa: E501 + :rtype: str + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this OrderCancel. + + Creation time of order # noqa: E501 + + :param create_time: The create_time of this OrderCancel. # noqa: E501 + :type: str + """ + + self._create_time = create_time + + @property + def update_time(self): + """Gets the update_time of this OrderCancel. # noqa: E501 + + Last modification time of order # noqa: E501 + + :return: The update_time of this OrderCancel. # noqa: E501 + :rtype: str + """ + return self._update_time + + @update_time.setter + def update_time(self, update_time): + """Sets the update_time of this OrderCancel. + + Last modification time of order # noqa: E501 + + :param update_time: The update_time of this OrderCancel. # noqa: E501 + :type: str + """ + + self._update_time = update_time + + @property + def create_time_ms(self): + """Gets the create_time_ms of this OrderCancel. # noqa: E501 + + Creation time of order (in milliseconds) # noqa: E501 + + :return: The create_time_ms of this OrderCancel. # 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 OrderCancel. + + Creation time of order (in milliseconds) # noqa: E501 + + :param create_time_ms: The create_time_ms of this OrderCancel. # noqa: E501 + :type: int + """ + + self._create_time_ms = create_time_ms + + @property + def update_time_ms(self): + """Gets the update_time_ms of this OrderCancel. # noqa: E501 + + Last modification time of order (in milliseconds) # noqa: E501 + + :return: The update_time_ms of this OrderCancel. # 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 OrderCancel. + + Last modification time of order (in milliseconds) # noqa: E501 + + :param update_time_ms: The update_time_ms of this OrderCancel. # noqa: E501 + :type: int + """ + + self._update_time_ms = update_time_ms + + @property + def status(self): + """Gets the status of this OrderCancel. # noqa: E501 + + Order status - `open`: to be filled - `closed`: filled - `cancelled`: cancelled # noqa: E501 + + :return: The status of this OrderCancel. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this OrderCancel. + + Order status - `open`: to be filled - `closed`: filled - `cancelled`: cancelled # noqa: E501 + + :param status: The status of this OrderCancel. # noqa: E501 + :type: str + """ + allowed_values = ["open", "closed", "cancelled"] # 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_pair(self): + """Gets the currency_pair of this OrderCancel. # noqa: E501 + + Currency pair # noqa: E501 + + :return: The currency_pair of this OrderCancel. # noqa: E501 + :rtype: str + """ + return self._currency_pair + + @currency_pair.setter + def currency_pair(self, currency_pair): + """Sets the currency_pair of this OrderCancel. + + Currency pair # noqa: E501 + + :param currency_pair: The currency_pair of this OrderCancel. # 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 type(self): + """Gets the type of this OrderCancel. # noqa: E501 + + Order Type - limit : Limit Order - market : Market Order # noqa: E501 + + :return: The type of this OrderCancel. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this OrderCancel. + + Order Type - limit : Limit Order - market : Market Order # noqa: E501 + + :param type: The type of this OrderCancel. # 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 account(self): + """Gets the account of this OrderCancel. # noqa: E501 + + Account type, spot - spot account, margin - leveraged account, unified - unified account # noqa: E501 + + :return: The account of this OrderCancel. # noqa: E501 + :rtype: str + """ + return self._account + + @account.setter + def account(self, account): + """Sets the account of this OrderCancel. + + Account type, spot - spot account, margin - leveraged account, unified - unified account # noqa: E501 + + :param account: The account of this OrderCancel. # noqa: E501 + :type: str + """ + + self._account = account + + @property + def side(self): + """Gets the side of this OrderCancel. # noqa: E501 + + Buy or sell order # noqa: E501 + + :return: The side of this OrderCancel. # noqa: E501 + :rtype: str + """ + return self._side + + @side.setter + def side(self, side): + """Sets the side of this OrderCancel. + + Buy or sell order # noqa: E501 + + :param side: The side of this OrderCancel. # 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 OrderCancel. # 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 + + :return: The amount of this OrderCancel. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this OrderCancel. + + 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 + + :param amount: The amount of this OrderCancel. # 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(self): + """Gets the price of this OrderCancel. # noqa: E501 + + Trading price, required when `type`=`limit` # noqa: E501 + + :return: The price of this OrderCancel. # noqa: E501 + :rtype: str + """ + return self._price + + @price.setter + def price(self, price): + """Sets the price of this OrderCancel. + + Trading price, required when `type`=`limit` # noqa: E501 + + :param price: The price of this OrderCancel. # noqa: E501 + :type: str + """ + + self._price = price + + @property + def time_in_force(self): + """Gets the time_in_force of this OrderCancel. # 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 Only `ioc` and `fok` are supported when `type`=`market` # noqa: E501 + + :return: The time_in_force of this OrderCancel. # 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 OrderCancel. + + 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` # noqa: E501 + + :param time_in_force: The time_in_force of this OrderCancel. # noqa: E501 + :type: str + """ + allowed_values = ["gtc", "ioc", "poc", "fok"] # 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 iceberg(self): + """Gets the iceberg of this OrderCancel. # noqa: E501 + + Amount to display for the iceberg order. Null or 0 for normal orders. Hiding all amount is not supported # noqa: E501 + + :return: The iceberg of this OrderCancel. # noqa: E501 + :rtype: str + """ + return self._iceberg + + @iceberg.setter + def iceberg(self, iceberg): + """Sets the iceberg of this OrderCancel. + + Amount to display for the iceberg order. Null or 0 for normal orders. Hiding all amount is not supported # noqa: E501 + + :param iceberg: The iceberg of this OrderCancel. # noqa: E501 + :type: str + """ + + self._iceberg = iceberg + + @property + def auto_borrow(self): + """Gets the auto_borrow of this OrderCancel. # noqa: E501 + + Used in margin or cross margin trading to allow automatic loan of insufficient amount if balance is not enough # noqa: E501 + + :return: The auto_borrow of this OrderCancel. # noqa: E501 + :rtype: bool + """ + return self._auto_borrow + + @auto_borrow.setter + def auto_borrow(self, auto_borrow): + """Sets the auto_borrow of this OrderCancel. + + Used in margin or cross margin trading to allow automatic loan of insufficient amount if balance is not enough # noqa: E501 + + :param auto_borrow: The auto_borrow of this OrderCancel. # noqa: E501 + :type: bool + """ + + self._auto_borrow = auto_borrow + + @property + def auto_repay(self): + """Gets the auto_repay of this OrderCancel. # noqa: E501 + + Enable or disable automatic repayment for automatic borrow loan generated by cross margin order. Default is disabled. Note that: 1. This field is only effective for cross margin orders. Margin account does not support setting auto repayment for orders. 2. `auto_borrow` and `auto_repay` can be both set to true in one order # noqa: E501 + + :return: The auto_repay of this OrderCancel. # noqa: E501 + :rtype: bool + """ + return self._auto_repay + + @auto_repay.setter + def auto_repay(self, auto_repay): + """Sets the auto_repay of this OrderCancel. + + Enable or disable automatic repayment for automatic borrow loan generated by cross margin order. Default is disabled. Note that: 1. This field is only effective for cross margin orders. Margin account does not support setting auto repayment for orders. 2. `auto_borrow` and `auto_repay` can be both set to true in one order # noqa: E501 + + :param auto_repay: The auto_repay of this OrderCancel. # noqa: E501 + :type: bool + """ + + self._auto_repay = auto_repay + + @property + def left(self): + """Gets the left of this OrderCancel. # noqa: E501 + + Amount left to fill # noqa: E501 + + :return: The left of this OrderCancel. # noqa: E501 + :rtype: str + """ + return self._left + + @left.setter + def left(self, left): + """Sets the left of this OrderCancel. + + Amount left to fill # noqa: E501 + + :param left: The left of this OrderCancel. # noqa: E501 + :type: str + """ + + self._left = left + + @property + def filled_amount(self): + """Gets the filled_amount of this OrderCancel. # noqa: E501 + + Amount filled # noqa: E501 + + :return: The filled_amount of this OrderCancel. # noqa: E501 + :rtype: str + """ + return self._filled_amount + + @filled_amount.setter + def filled_amount(self, filled_amount): + """Sets the filled_amount of this OrderCancel. + + Amount filled # noqa: E501 + + :param filled_amount: The filled_amount of this OrderCancel. # noqa: E501 + :type: str + """ + + self._filled_amount = filled_amount + + @property + def fill_price(self): + """Gets the fill_price of this OrderCancel. # noqa: E501 + + Total filled in quote currency. Deprecated in favor of `filled_total` # noqa: E501 + + :return: The fill_price of this OrderCancel. # noqa: E501 + :rtype: str + """ + return self._fill_price + + @fill_price.setter + def fill_price(self, fill_price): + """Sets the fill_price of this OrderCancel. + + Total filled in quote currency. Deprecated in favor of `filled_total` # noqa: E501 + + :param fill_price: The fill_price of this OrderCancel. # noqa: E501 + :type: str + """ + + self._fill_price = fill_price + + @property + def filled_total(self): + """Gets the filled_total of this OrderCancel. # noqa: E501 + + Total filled in quote currency # noqa: E501 + + :return: The filled_total of this OrderCancel. # noqa: E501 + :rtype: str + """ + return self._filled_total + + @filled_total.setter + def filled_total(self, filled_total): + """Sets the filled_total of this OrderCancel. + + Total filled in quote currency # noqa: E501 + + :param filled_total: The filled_total of this OrderCancel. # noqa: E501 + :type: str + """ + + self._filled_total = filled_total + + @property + def avg_deal_price(self): + """Gets the avg_deal_price of this OrderCancel. # noqa: E501 + + Average fill price # noqa: E501 + + :return: The avg_deal_price of this OrderCancel. # noqa: E501 + :rtype: str + """ + return self._avg_deal_price + + @avg_deal_price.setter + def avg_deal_price(self, avg_deal_price): + """Sets the avg_deal_price of this OrderCancel. + + Average fill price # noqa: E501 + + :param avg_deal_price: The avg_deal_price of this OrderCancel. # noqa: E501 + :type: str + """ + + self._avg_deal_price = avg_deal_price + + @property + def fee(self): + """Gets the fee of this OrderCancel. # noqa: E501 + + Fee deducted # noqa: E501 + + :return: The fee of this OrderCancel. # noqa: E501 + :rtype: str + """ + return self._fee + + @fee.setter + def fee(self, fee): + """Sets the fee of this OrderCancel. + + Fee deducted # noqa: E501 + + :param fee: The fee of this OrderCancel. # noqa: E501 + :type: str + """ + + self._fee = fee + + @property + def fee_currency(self): + """Gets the fee_currency of this OrderCancel. # noqa: E501 + + Fee currency unit # noqa: E501 + + :return: The fee_currency of this OrderCancel. # noqa: E501 + :rtype: str + """ + return self._fee_currency + + @fee_currency.setter + def fee_currency(self, fee_currency): + """Sets the fee_currency of this OrderCancel. + + Fee currency unit # noqa: E501 + + :param fee_currency: The fee_currency of this OrderCancel. # noqa: E501 + :type: str + """ + + self._fee_currency = fee_currency + + @property + def point_fee(self): + """Gets the point_fee of this OrderCancel. # noqa: E501 + + Points used to deduct fee # noqa: E501 + + :return: The point_fee of this OrderCancel. # noqa: E501 + :rtype: str + """ + return self._point_fee + + @point_fee.setter + def point_fee(self, point_fee): + """Sets the point_fee of this OrderCancel. + + Points used to deduct fee # noqa: E501 + + :param point_fee: The point_fee of this OrderCancel. # noqa: E501 + :type: str + """ + + self._point_fee = point_fee + + @property + def gt_fee(self): + """Gets the gt_fee of this OrderCancel. # noqa: E501 + + GT used to deduct fee # noqa: E501 + + :return: The gt_fee of this OrderCancel. # noqa: E501 + :rtype: str + """ + return self._gt_fee + + @gt_fee.setter + def gt_fee(self, gt_fee): + """Sets the gt_fee of this OrderCancel. + + GT used to deduct fee # noqa: E501 + + :param gt_fee: The gt_fee of this OrderCancel. # noqa: E501 + :type: str + """ + + self._gt_fee = gt_fee + + @property + def gt_maker_fee(self): + """Gets the gt_maker_fee of this OrderCancel. # noqa: E501 + + GT amount used to deduct maker fee # noqa: E501 + + :return: The gt_maker_fee of this OrderCancel. # noqa: E501 + :rtype: str + """ + return self._gt_maker_fee + + @gt_maker_fee.setter + def gt_maker_fee(self, gt_maker_fee): + """Sets the gt_maker_fee of this OrderCancel. + + GT amount used to deduct maker fee # noqa: E501 + + :param gt_maker_fee: The gt_maker_fee of this OrderCancel. # noqa: E501 + :type: str + """ + + self._gt_maker_fee = gt_maker_fee + + @property + def gt_taker_fee(self): + """Gets the gt_taker_fee of this OrderCancel. # noqa: E501 + + GT amount used to deduct taker fee # noqa: E501 + + :return: The gt_taker_fee of this OrderCancel. # noqa: E501 + :rtype: str + """ + return self._gt_taker_fee + + @gt_taker_fee.setter + def gt_taker_fee(self, gt_taker_fee): + """Sets the gt_taker_fee of this OrderCancel. + + GT amount used to deduct taker fee # noqa: E501 + + :param gt_taker_fee: The gt_taker_fee of this OrderCancel. # noqa: E501 + :type: str + """ + + self._gt_taker_fee = gt_taker_fee + + @property + def gt_discount(self): + """Gets the gt_discount of this OrderCancel. # noqa: E501 + + Whether GT fee deduction is enabled # noqa: E501 + + :return: The gt_discount of this OrderCancel. # noqa: E501 + :rtype: bool + """ + return self._gt_discount + + @gt_discount.setter + def gt_discount(self, gt_discount): + """Sets the gt_discount of this OrderCancel. + + Whether GT fee deduction is enabled # noqa: E501 + + :param gt_discount: The gt_discount of this OrderCancel. # noqa: E501 + :type: bool + """ + + self._gt_discount = gt_discount + + @property + def rebated_fee(self): + """Gets the rebated_fee of this OrderCancel. # noqa: E501 + + Rebated fee # noqa: E501 + + :return: The rebated_fee of this OrderCancel. # noqa: E501 + :rtype: str + """ + return self._rebated_fee + + @rebated_fee.setter + def rebated_fee(self, rebated_fee): + """Sets the rebated_fee of this OrderCancel. + + Rebated fee # noqa: E501 + + :param rebated_fee: The rebated_fee of this OrderCancel. # noqa: E501 + :type: str + """ + + self._rebated_fee = rebated_fee + + @property + def rebated_fee_currency(self): + """Gets the rebated_fee_currency of this OrderCancel. # noqa: E501 + + Rebated fee currency unit # noqa: E501 + + :return: The rebated_fee_currency of this OrderCancel. # noqa: E501 + :rtype: str + """ + return self._rebated_fee_currency + + @rebated_fee_currency.setter + def rebated_fee_currency(self, rebated_fee_currency): + """Sets the rebated_fee_currency of this OrderCancel. + + Rebated fee currency unit # noqa: E501 + + :param rebated_fee_currency: The rebated_fee_currency of this OrderCancel. # noqa: E501 + :type: str + """ + + self._rebated_fee_currency = rebated_fee_currency + + @property + def stp_id(self): + """Gets the stp_id of this OrderCancel. # 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 OrderCancel. # noqa: E501 + :rtype: int + """ + return self._stp_id + + @stp_id.setter + def stp_id(self, stp_id): + """Sets the stp_id of this OrderCancel. + + 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 OrderCancel. # noqa: E501 + :type: int + """ + + self._stp_id = stp_id + + @property + def stp_act(self): + """Gets the stp_act of this OrderCancel. # 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 OrderCancel. # noqa: E501 + :rtype: str + """ + return self._stp_act + + @stp_act.setter + def stp_act(self, stp_act): + """Sets the stp_act of this OrderCancel. + + 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 OrderCancel. # noqa: E501 + :type: str + """ + allowed_values = ["cn", "co", "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 finish_as(self): + """Gets the finish_as of this OrderCancel. # 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 + + :return: The finish_as of this OrderCancel. # noqa: E501 + :rtype: str + """ + return self._finish_as + + @finish_as.setter + def finish_as(self, finish_as): + """Sets the finish_as of this OrderCancel. + + 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 + + :param finish_as: The finish_as of this OrderCancel. # noqa: E501 + :type: str + """ + allowed_values = ["open", "filled", "cancelled", "ioc", "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 action_mode(self): + """Gets the action_mode of this OrderCancel. # noqa: E501 + + 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) # noqa: E501 + + :return: The action_mode of this OrderCancel. # noqa: E501 + :rtype: str + """ + return self._action_mode + + @action_mode.setter + def action_mode(self, action_mode): + """Sets the action_mode of this OrderCancel. + + 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) # noqa: E501 + + :param action_mode: The action_mode of this OrderCancel. # noqa: E501 + :type: str + """ + + self._action_mode = action_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, OrderCancel): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OrderCancel): + 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 new file mode 100644 index 0000000..8e59035 --- /dev/null +++ b/gate_api/models/order_patch.py @@ -0,0 +1,266 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OrderPatch(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'account': 'str', + 'amount': 'str', + 'price': 'str', + 'amend_text': 'str', + 'action_mode': 'str' + } + + attribute_map = { + 'currency_pair': 'currency_pair', + 'account': 'account', + 'amount': 'amount', + 'price': 'price', + 'amend_text': 'amend_text', + 'action_mode': 'action_mode' + } + + 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 + """OrderPatch - a 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._account = None + self._amount = None + self._price = None + self._amend_text = None + self._action_mode = None + self.discriminator = None + + if currency_pair is not None: + self.currency_pair = currency_pair + if account is not None: + self.account = account + if amount is not None: + self.amount = amount + if price is not None: + 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 currency_pair(self): + """Gets the currency_pair of this OrderPatch. # noqa: E501 + + Currency pair # noqa: E501 + + :return: The currency_pair of this OrderPatch. # noqa: E501 + :rtype: str + """ + return self._currency_pair + + @currency_pair.setter + def currency_pair(self, currency_pair): + """Sets the currency_pair of this OrderPatch. + + Currency pair # noqa: E501 + + :param currency_pair: The currency_pair of this OrderPatch. # noqa: E501 + :type: str + """ + + self._currency_pair = currency_pair + + @property + def account(self): + """Gets the account of this OrderPatch. # noqa: E501 + + Specify query account # noqa: E501 + + :return: The account of this OrderPatch. # noqa: E501 + :rtype: str + """ + return self._account + + @account.setter + def account(self, account): + """Sets the account of this OrderPatch. + + Specify query account # noqa: E501 + + :param account: The account of this OrderPatch. # noqa: E501 + :type: str + """ + + self._account = account + + @property + def amount(self): + """Gets the amount of this OrderPatch. # noqa: E501 + + Trading quantity. Either `amount` or `price` must be specified # noqa: E501 + + :return: The amount of this OrderPatch. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this OrderPatch. + + Trading quantity. Either `amount` or `price` must be specified # noqa: E501 + + :param amount: The amount of this OrderPatch. # noqa: E501 + :type: str + """ + + self._amount = amount + + @property + def price(self): + """Gets the price of this OrderPatch. # noqa: E501 + + Trading price. Either `amount` or `price` must be specified # noqa: E501 + + :return: The price of this OrderPatch. # noqa: E501 + :rtype: str + """ + return self._price + + @price.setter + def price(self, price): + """Sets the price of this OrderPatch. + + Trading price. Either `amount` or `price` must be specified # noqa: E501 + + :param price: The price of this OrderPatch. # noqa: E501 + :type: str + """ + + self._price = price + + @property + def amend_text(self): + """Gets the amend_text of this OrderPatch. # noqa: E501 + + Custom info during order amendment # noqa: E501 + + :return: The amend_text of this OrderPatch. # noqa: E501 + :rtype: str + """ + return self._amend_text + + @amend_text.setter + def amend_text(self, amend_text): + """Sets the amend_text of this OrderPatch. + + Custom info during order amendment # noqa: E501 + + :param amend_text: The amend_text of this OrderPatch. # noqa: E501 + :type: str + """ + if (self.local_vars_configuration.client_side_validation and + amend_text is not None and len(amend_text) > 31): + raise ValueError("Invalid value for `amend_text`, length must be less than or equal to `31`") # noqa: E501 + + self._amend_text = amend_text + + @property + def action_mode(self): + """Gets the action_mode of this OrderPatch. # noqa: E501 + + 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) # noqa: E501 + + :return: The action_mode of this OrderPatch. # noqa: E501 + :rtype: str + """ + return self._action_mode + + @action_mode.setter + def action_mode(self, action_mode): + """Sets the action_mode of this OrderPatch. + + 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) # noqa: E501 + + :param action_mode: The action_mode of this OrderPatch. # noqa: E501 + :type: str + """ + + self._action_mode = action_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, OrderPatch): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OrderPatch): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/order_resp.py b/gate_api/models/order_resp.py new file mode 100644 index 0000000..c95612a --- /dev/null +++ b/gate_api/models/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 OrderResp(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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 + """OrderResp - a 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 OrderResp. # noqa: E501 + + Order ID # noqa: E501 + + :return: The order_id of this OrderResp. # noqa: E501 + :rtype: int + """ + return self._order_id + + @order_id.setter + def order_id(self, order_id): + """Sets the order_id of this OrderResp. + + Order ID # noqa: E501 + + :param order_id: The order_id of this OrderResp. # 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, OrderResp): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OrderResp): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/partner_commission_history.py b/gate_api/models/partner_commission_history.py new file mode 100644 index 0000000..77c0d2f --- /dev/null +++ b/gate_api/models/partner_commission_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 PartnerCommissionHistory(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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[AgencyCommission]' + } + + attribute_map = { + 'total': 'total', + 'list': 'list' + } + + def __init__(self, total=None, list=None, local_vars_configuration=None): # noqa: E501 + # type: (int, list[AgencyCommission], Configuration) -> None + """PartnerCommissionHistory - a 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 PartnerCommissionHistory. # noqa: E501 + + Total # noqa: E501 + + :return: The total of this PartnerCommissionHistory. # noqa: E501 + :rtype: int + """ + return self._total + + @total.setter + def total(self, total): + """Sets the total of this PartnerCommissionHistory. + + Total # noqa: E501 + + :param total: The total of this PartnerCommissionHistory. # noqa: E501 + :type: int + """ + + self._total = total + + @property + def list(self): + """Gets the list of this PartnerCommissionHistory. # noqa: E501 + + List of commission history # noqa: E501 + + :return: The list of this PartnerCommissionHistory. # noqa: E501 + :rtype: list[AgencyCommission] + """ + return self._list + + @list.setter + def list(self, list): + """Sets the list of this PartnerCommissionHistory. + + List of commission history # noqa: E501 + + :param list: The list of this PartnerCommissionHistory. # noqa: E501 + :type: list[AgencyCommission] + """ + + 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, PartnerCommissionHistory): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, PartnerCommissionHistory): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/partner_sub.py b/gate_api/models/partner_sub.py new file mode 100644 index 0000000..c82d656 --- /dev/null +++ b/gate_api/models/partner_sub.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 PartnerSub(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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': 'int', + 'user_join_time': 'int', + 'type': 'int' + } + + attribute_map = { + 'user_id': 'user_id', + 'user_join_time': 'user_join_time', + 'type': 'type' + } + + def __init__(self, user_id=None, user_join_time=None, type=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, int, Configuration) -> None + """PartnerSub - a 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._user_join_time = None + self._type = None + self.discriminator = None + + if user_id is not None: + self.user_id = user_id + if user_join_time is not None: + self.user_join_time = user_join_time + if type is not None: + self.type = type + + @property + def user_id(self): + """Gets the user_id of this PartnerSub. # noqa: E501 + + User ID # noqa: E501 + + :return: The user_id of this PartnerSub. # noqa: E501 + :rtype: int + """ + return self._user_id + + @user_id.setter + def user_id(self, user_id): + """Sets the user_id of this PartnerSub. + + User ID # noqa: E501 + + :param user_id: The user_id of this PartnerSub. # noqa: E501 + :type: int + """ + + self._user_id = user_id + + @property + def user_join_time(self): + """Gets the user_join_time of this PartnerSub. # noqa: E501 + + Time when user joined the system, Unix timestamp in seconds # noqa: E501 + + :return: The user_join_time of this PartnerSub. # noqa: E501 + :rtype: int + """ + return self._user_join_time + + @user_join_time.setter + def user_join_time(self, user_join_time): + """Sets the user_join_time of this PartnerSub. + + Time when user joined the system, Unix timestamp in seconds # noqa: E501 + + :param user_join_time: The user_join_time of this PartnerSub. # noqa: E501 + :type: int + """ + + self._user_join_time = user_join_time + + @property + def type(self): + """Gets the type of this PartnerSub. # noqa: E501 + + Type (1-Sub-agent 2-Indirect direct customer 3-Direct direct customer) # noqa: E501 + + :return: The type of this PartnerSub. # noqa: E501 + :rtype: int + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this PartnerSub. + + Type (1-Sub-agent 2-Indirect direct customer 3-Direct direct customer) # noqa: E501 + + :param type: The type of this PartnerSub. # 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, PartnerSub): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, PartnerSub): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/partner_sub_list.py b/gate_api/models/partner_sub_list.py new file mode 100644 index 0000000..9dec1e4 --- /dev/null +++ b/gate_api/models/partner_sub_list.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 PartnerSubList(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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[PartnerSub]' + } + + attribute_map = { + 'total': 'total', + 'list': 'list' + } + + def __init__(self, total=None, list=None, local_vars_configuration=None): # noqa: E501 + # type: (int, list[PartnerSub], Configuration) -> None + """PartnerSubList - a 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 PartnerSubList. # noqa: E501 + + Total # noqa: E501 + + :return: The total of this PartnerSubList. # noqa: E501 + :rtype: int + """ + return self._total + + @total.setter + def total(self, total): + """Sets the total of this PartnerSubList. + + Total # noqa: E501 + + :param total: The total of this PartnerSubList. # noqa: E501 + :type: int + """ + + self._total = total + + @property + def list(self): + """Gets the list of this PartnerSubList. # noqa: E501 + + Subordinate list # noqa: E501 + + :return: The list of this PartnerSubList. # noqa: E501 + :rtype: list[PartnerSub] + """ + return self._list + + @list.setter + def list(self, list): + """Sets the list of this PartnerSubList. + + Subordinate list # noqa: E501 + + :param list: The list of this PartnerSubList. # noqa: E501 + :type: list[PartnerSub] + """ + + 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, PartnerSubList): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, PartnerSubList): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/partner_transaction_history.py b/gate_api/models/partner_transaction_history.py new file mode 100644 index 0000000..3939e41 --- /dev/null +++ b/gate_api/models/partner_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 PartnerTransactionHistory(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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[AgencyTransaction]' + } + + attribute_map = { + 'total': 'total', + 'list': 'list' + } + + def __init__(self, total=None, list=None, local_vars_configuration=None): # noqa: E501 + # type: (int, list[AgencyTransaction], Configuration) -> None + """PartnerTransactionHistory - a 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 PartnerTransactionHistory. # noqa: E501 + + Total # noqa: E501 + + :return: The total of this PartnerTransactionHistory. # noqa: E501 + :rtype: int + """ + return self._total + + @total.setter + def total(self, total): + """Sets the total of this PartnerTransactionHistory. + + Total # noqa: E501 + + :param total: The total of this PartnerTransactionHistory. # noqa: E501 + :type: int + """ + + self._total = total + + @property + def list(self): + """Gets the list of this PartnerTransactionHistory. # noqa: E501 + + List of transaction history # noqa: E501 + + :return: The list of this PartnerTransactionHistory. # noqa: E501 + :rtype: list[AgencyTransaction] + """ + return self._list + + @list.setter + def list(self, list): + """Sets the list of this PartnerTransactionHistory. + + List of transaction history # noqa: E501 + + :param list: The list of this PartnerTransactionHistory. # noqa: E501 + :type: list[AgencyTransaction] + """ + + 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, PartnerTransactionHistory): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, PartnerTransactionHistory): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/patch_uni_lend.py b/gate_api/models/patch_uni_lend.py new file mode 100644 index 0000000..82e3a19 --- /dev/null +++ b/gate_api/models/patch_uni_lend.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 PatchUniLend(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'min_rate': 'str' + } + + attribute_map = { + 'currency': 'currency', + 'min_rate': 'min_rate' + } + + def __init__(self, currency=None, min_rate=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """PatchUniLend - a 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._min_rate = None + self.discriminator = None + + if currency is not None: + self.currency = currency + if min_rate is not None: + self.min_rate = min_rate + + @property + def currency(self): + """Gets the currency of this PatchUniLend. # noqa: E501 + + Currency name # noqa: E501 + + :return: The currency of this PatchUniLend. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this PatchUniLend. + + Currency name # noqa: E501 + + :param currency: The currency of this PatchUniLend. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def min_rate(self): + """Gets the min_rate of this PatchUniLend. # noqa: E501 + + Minimum interest rate # noqa: E501 + + :return: The min_rate of this PatchUniLend. # noqa: E501 + :rtype: str + """ + return self._min_rate + + @min_rate.setter + def min_rate(self, min_rate): + """Sets the min_rate of this PatchUniLend. + + Minimum interest rate # noqa: E501 + + :param min_rate: The min_rate of this PatchUniLend. # noqa: E501 + :type: str + """ + + self._min_rate = min_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, PatchUniLend): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, PatchUniLend): + 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 new file mode 100644 index 0000000..46346c1 --- /dev/null +++ b/gate_api/models/place_dual_investment_order.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 PlaceDualInvestmentOrder(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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 + """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._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 PlaceDualInvestmentOrder. # noqa: E501 + + Product ID # noqa: E501 + + :return: The plan_id of this PlaceDualInvestmentOrder. # noqa: E501 + :rtype: str + """ + return self._plan_id + + @plan_id.setter + def plan_id(self, plan_id): + """Sets the plan_id of this PlaceDualInvestmentOrder. + + Product ID # noqa: E501 + + :param plan_id: The plan_id of this PlaceDualInvestmentOrder. # 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 PlaceDualInvestmentOrder. # noqa: E501 + + Subscription amount, mutually exclusive with copies field # noqa: E501 + + :return: The amount of this PlaceDualInvestmentOrder. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this PlaceDualInvestmentOrder. + + Subscription amount, mutually exclusive with copies field # noqa: E501 + + :param amount: The amount 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 + + @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 + + :return: The text of this PlaceDualInvestmentOrder. # noqa: E501 + :rtype: str + """ + return self._text + + @text.setter + 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 + + :param text: The text of this PlaceDualInvestmentOrder. # 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, PlaceDualInvestmentOrder): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, PlaceDualInvestmentOrder): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/position.py b/gate_api/models/position.py index a6f6ad1..2951397 100644 --- a/gate_api/models/position.py +++ b/gate_api/models/position.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -45,8 +45,13 @@ class Position(object): 'entry_price': 'str', 'liq_price': 'str', 'mark_price': 'str', + 'initial_margin': 'str', + 'maintenance_margin': 'str', 'unrealised_pnl': 'str', 'realised_pnl': 'str', + 'pnl_pnl': 'str', + 'pnl_fund': 'str', + 'pnl_fee': 'str', 'history_pnl': 'str', 'last_close_pnl': 'str', 'realised_point': 'str', @@ -56,6 +61,12 @@ class Position(object): 'close_order': 'PositionCloseOrder', 'mode': 'str', 'cross_leverage_limit': 'str', + 'update_time': 'int', + 'update_id': 'int', + 'open_time': 'int', + 'risk_limit_table': 'str', + 'average_maintenance_rate': 'str', + 'pid': 'int' } attribute_map = { @@ -71,8 +82,13 @@ class Position(object): 'entry_price': 'entry_price', 'liq_price': 'liq_price', 'mark_price': 'mark_price', + 'initial_margin': 'initial_margin', + 'maintenance_margin': 'maintenance_margin', 'unrealised_pnl': 'unrealised_pnl', 'realised_pnl': 'realised_pnl', + 'pnl_pnl': 'pnl_pnl', + 'pnl_fund': 'pnl_fund', + 'pnl_fee': 'pnl_fee', 'history_pnl': 'history_pnl', 'last_close_pnl': 'last_close_pnl', 'realised_point': 'realised_point', @@ -82,36 +98,16 @@ class Position(object): 'close_order': 'close_order', 'mode': 'mode', 'cross_leverage_limit': 'cross_leverage_limit', + 'update_time': 'update_time', + 'update_id': 'update_id', + 'open_time': 'open_time', + 'risk_limit_table': 'risk_limit_table', + 'average_maintenance_rate': 'average_maintenance_rate', + 'pid': 'pid' } - 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, - unrealised_pnl=None, - realised_pnl=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, - local_vars_configuration=None, - ): # noqa: E501 - # type: (int, str, int, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, int, int, PositionCloseOrder, str, str, Configuration) -> None + 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, int, 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 """Position - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -129,8 +125,13 @@ def __init__( self._entry_price = None self._liq_price = None self._mark_price = None + self._initial_margin = None + self._maintenance_margin = None self._unrealised_pnl = None self._realised_pnl = None + self._pnl_pnl = None + self._pnl_fund = None + self._pnl_fee = None self._history_pnl = None self._last_close_pnl = None self._realised_point = None @@ -140,6 +141,12 @@ def __init__( self._close_order = None self._mode = None self._cross_leverage_limit = None + self._update_time = None + self._update_id = None + self._open_time = None + self._risk_limit_table = None + self._average_maintenance_rate = None + self._pid = None self.discriminator = None if user is not None: @@ -166,10 +173,20 @@ def __init__( self.liq_price = liq_price if mark_price is not None: self.mark_price = mark_price + if initial_margin is not None: + self.initial_margin = initial_margin + if maintenance_margin is not None: + self.maintenance_margin = maintenance_margin if unrealised_pnl is not None: self.unrealised_pnl = unrealised_pnl if realised_pnl is not None: self.realised_pnl = realised_pnl + if pnl_pnl is not None: + self.pnl_pnl = pnl_pnl + if pnl_fund is not None: + self.pnl_fund = pnl_fund + if pnl_fee is not None: + self.pnl_fee = pnl_fee if history_pnl is not None: self.history_pnl = history_pnl if last_close_pnl is not None: @@ -187,6 +204,18 @@ def __init__( self.mode = mode if cross_leverage_limit is not None: self.cross_leverage_limit = cross_leverage_limit + if update_time is not None: + self.update_time = update_time + if update_id is not None: + self.update_id = update_id + if open_time is not None: + self.open_time = open_time + if risk_limit_table is not None: + self.risk_limit_table = risk_limit_table + if average_maintenance_rate is not None: + self.average_maintenance_rate = average_maintenance_rate + if pid is not None: + self.pid = pid @property def user(self): @@ -464,6 +493,52 @@ def mark_price(self, mark_price): self._mark_price = mark_price + @property + def initial_margin(self): + """Gets the initial_margin of this Position. # noqa: E501 + + The initial margin occupied by the position, applicable to the portfolio margin account # noqa: E501 + + :return: The initial_margin of this Position. # noqa: E501 + :rtype: str + """ + return self._initial_margin + + @initial_margin.setter + def initial_margin(self, initial_margin): + """Sets the initial_margin of this Position. + + The initial margin occupied by the position, applicable to the portfolio margin account # noqa: E501 + + :param initial_margin: The initial_margin of this Position. # noqa: E501 + :type: str + """ + + self._initial_margin = initial_margin + + @property + def maintenance_margin(self): + """Gets the maintenance_margin of this Position. # noqa: E501 + + Maintenance margin required for the position, applicable to portfolio margin account # noqa: E501 + + :return: The maintenance_margin of this Position. # noqa: E501 + :rtype: str + """ + return self._maintenance_margin + + @maintenance_margin.setter + def maintenance_margin(self, maintenance_margin): + """Sets the maintenance_margin of this Position. + + Maintenance margin required for the position, applicable to portfolio margin account # noqa: E501 + + :param maintenance_margin: The maintenance_margin of this Position. # noqa: E501 + :type: str + """ + + self._maintenance_margin = maintenance_margin + @property def unrealised_pnl(self): """Gets the unrealised_pnl of this Position. # noqa: E501 @@ -491,7 +566,7 @@ def unrealised_pnl(self, unrealised_pnl): def realised_pnl(self): """Gets the realised_pnl of this Position. # noqa: E501 - Realized PNL # noqa: E501 + Realized PnL # noqa: E501 :return: The realised_pnl of this Position. # noqa: E501 :rtype: str @@ -502,7 +577,7 @@ def realised_pnl(self): def realised_pnl(self, realised_pnl): """Sets the realised_pnl of this Position. - Realized PNL # noqa: E501 + Realized PnL # noqa: E501 :param realised_pnl: The realised_pnl of this Position. # noqa: E501 :type: str @@ -510,11 +585,80 @@ def realised_pnl(self, realised_pnl): self._realised_pnl = realised_pnl + @property + def pnl_pnl(self): + """Gets the pnl_pnl of this Position. # noqa: E501 + + Realized PNL - Position P/L # noqa: E501 + + :return: The pnl_pnl of this Position. # noqa: E501 + :rtype: str + """ + return self._pnl_pnl + + @pnl_pnl.setter + def pnl_pnl(self, pnl_pnl): + """Sets the pnl_pnl of this Position. + + Realized PNL - Position P/L # noqa: E501 + + :param pnl_pnl: The pnl_pnl of this Position. # noqa: E501 + :type: str + """ + + self._pnl_pnl = pnl_pnl + + @property + def pnl_fund(self): + """Gets the pnl_fund of this Position. # noqa: E501 + + Realized PNL - Funding Fees # noqa: E501 + + :return: The pnl_fund of this Position. # noqa: E501 + :rtype: str + """ + return self._pnl_fund + + @pnl_fund.setter + def pnl_fund(self, pnl_fund): + """Sets the pnl_fund of this Position. + + Realized PNL - Funding Fees # noqa: E501 + + :param pnl_fund: The pnl_fund of this Position. # noqa: E501 + :type: str + """ + + self._pnl_fund = pnl_fund + + @property + def pnl_fee(self): + """Gets the pnl_fee of this Position. # noqa: E501 + + Realized PNL - Transaction Fees # noqa: E501 + + :return: The pnl_fee of this Position. # noqa: E501 + :rtype: str + """ + return self._pnl_fee + + @pnl_fee.setter + def pnl_fee(self, pnl_fee): + """Sets the pnl_fee of this Position. + + Realized PNL - Transaction Fees # noqa: E501 + + :param pnl_fee: The pnl_fee of this Position. # noqa: E501 + :type: str + """ + + self._pnl_fee = pnl_fee + @property def history_pnl(self): """Gets the history_pnl of this Position. # noqa: E501 - History realized PNL # noqa: E501 + Total realized PnL from closed positions # noqa: E501 :return: The history_pnl of this Position. # noqa: E501 :rtype: str @@ -525,7 +669,7 @@ def history_pnl(self): def history_pnl(self, history_pnl): """Sets the history_pnl of this Position. - History realized PNL # noqa: E501 + Total realized PnL from closed positions # noqa: E501 :param history_pnl: The history_pnl of this Position. # noqa: E501 :type: str @@ -606,7 +750,7 @@ def history_point(self, history_point): def adl_ranking(self): """Gets the adl_ranking of this Position. # noqa: E501 - ADL ranking, ranging from 1 to 5 # noqa: E501 + Ranking of auto deleveraging, a total of 1-5 grades, `1` is the highest, `5` is the lowest, and `6` is the special case when there is no position held or in liquidation # noqa: E501 :return: The adl_ranking of this Position. # noqa: E501 :rtype: int @@ -617,7 +761,7 @@ def adl_ranking(self): def adl_ranking(self, adl_ranking): """Sets the adl_ranking of this Position. - ADL ranking, ranging from 1 to 5 # noqa: E501 + Ranking of auto deleveraging, a total of 1-5 grades, `1` is the highest, `5` is the lowest, and `6` is the special case when there is no position held or in liquidation # noqa: E501 :param adl_ranking: The adl_ranking of this Position. # noqa: E501 :type: int @@ -629,7 +773,7 @@ def adl_ranking(self, adl_ranking): def pending_orders(self): """Gets the pending_orders of this Position. # noqa: E501 - Current open orders # noqa: E501 + Current pending order quantity # noqa: E501 :return: The pending_orders of this Position. # noqa: E501 :rtype: int @@ -640,7 +784,7 @@ def pending_orders(self): def pending_orders(self, pending_orders): """Sets the pending_orders of this Position. - Current open orders # noqa: E501 + Current pending order quantity # noqa: E501 :param pending_orders: The pending_orders of this Position. # noqa: E501 :type: int @@ -673,7 +817,7 @@ def close_order(self, close_order): def mode(self): """Gets the mode of this Position. # noqa: E501 - Position mode, including: - `single`: dual mode is not enabled- `dual_long`: long position in dual mode- `dual_short`: short position in dual mode # noqa: E501 + Position mode, including: - `single`: Single position mode - `dual_long`: Long position in dual position mode - `dual_short`: Short position in dual position mode # noqa: E501 :return: The mode of this Position. # noqa: E501 :rtype: str @@ -684,7 +828,7 @@ def mode(self): def mode(self, mode): """Sets the mode of this Position. - Position mode, including: - `single`: dual mode is not enabled- `dual_long`: long position in dual mode- `dual_short`: short position in dual mode # noqa: E501 + Position mode, including: - `single`: Single position mode - `dual_long`: Long position in dual position mode - `dual_short`: Short position in dual position mode # noqa: E501 :param mode: The mode of this Position. # noqa: E501 :type: str @@ -692,7 +836,8 @@ def mode(self, mode): allowed_values = ["single", "dual_long", "dual_short"] # noqa: E501 if self.local_vars_configuration.client_side_validation and mode not in allowed_values: # noqa: E501 raise ValueError( - "Invalid value for `mode` ({0}), must be one of {1}".format(mode, allowed_values) # noqa: E501 + "Invalid value for `mode` ({0}), must be one of {1}" # noqa: E501 + .format(mode, allowed_values) ) self._mode = mode @@ -701,7 +846,7 @@ def mode(self, mode): def cross_leverage_limit(self): """Gets the cross_leverage_limit of this Position. # noqa: E501 - Cross margin leverage(valid only when `leverage` is 0) # noqa: E501 + Cross margin leverage (valid only when `leverage` is 0) # noqa: E501 :return: The cross_leverage_limit of this Position. # noqa: E501 :rtype: str @@ -712,7 +857,7 @@ def cross_leverage_limit(self): def cross_leverage_limit(self, cross_leverage_limit): """Sets the cross_leverage_limit of this Position. - Cross margin leverage(valid only when `leverage` is 0) # noqa: E501 + Cross margin leverage (valid only when `leverage` is 0) # noqa: E501 :param cross_leverage_limit: The cross_leverage_limit of this Position. # noqa: E501 :type: str @@ -720,6 +865,144 @@ def cross_leverage_limit(self, cross_leverage_limit): self._cross_leverage_limit = cross_leverage_limit + @property + def update_time(self): + """Gets the update_time of this Position. # noqa: E501 + + Last update time # noqa: E501 + + :return: The update_time of this Position. # noqa: E501 + :rtype: int + """ + return self._update_time + + @update_time.setter + def update_time(self, update_time): + """Sets the update_time of this Position. + + Last update time # noqa: E501 + + :param update_time: The update_time of this Position. # noqa: E501 + :type: int + """ + + self._update_time = update_time + + @property + def update_id(self): + """Gets the update_id of this Position. # noqa: E501 + + Update ID. The value increments by 1 each time the position is updated # noqa: E501 + + :return: The update_id of this Position. # noqa: E501 + :rtype: int + """ + return self._update_id + + @update_id.setter + def update_id(self, update_id): + """Sets the update_id of this Position. + + Update ID. The value increments by 1 each time the position is updated # noqa: E501 + + :param update_id: The update_id of this Position. # noqa: E501 + :type: int + """ + + self._update_id = update_id + + @property + def open_time(self): + """Gets the open_time of this Position. # noqa: E501 + + First Open Time # noqa: E501 + + :return: The open_time of this Position. # noqa: E501 + :rtype: int + """ + return self._open_time + + @open_time.setter + def open_time(self, open_time): + """Sets the open_time of this Position. + + First Open Time # noqa: E501 + + :param open_time: The open_time of this Position. # noqa: E501 + :type: int + """ + + self._open_time = open_time + + @property + def risk_limit_table(self): + """Gets the risk_limit_table of this Position. # noqa: E501 + + Risk limit table ID # noqa: E501 + + :return: The risk_limit_table of this Position. # noqa: E501 + :rtype: str + """ + return self._risk_limit_table + + @risk_limit_table.setter + def risk_limit_table(self, risk_limit_table): + """Sets the risk_limit_table of this Position. + + Risk limit table ID # noqa: E501 + + :param risk_limit_table: The risk_limit_table of this Position. # noqa: E501 + :type: str + """ + + self._risk_limit_table = risk_limit_table + + @property + def average_maintenance_rate(self): + """Gets the average_maintenance_rate of this Position. # noqa: E501 + + Average maintenance margin rate # noqa: E501 + + :return: The average_maintenance_rate of this Position. # noqa: E501 + :rtype: str + """ + return self._average_maintenance_rate + + @average_maintenance_rate.setter + def average_maintenance_rate(self, average_maintenance_rate): + """Sets the average_maintenance_rate of this Position. + + Average maintenance margin rate # noqa: E501 + + :param average_maintenance_rate: The average_maintenance_rate of this Position. # noqa: E501 + :type: str + """ + + self._average_maintenance_rate = average_maintenance_rate + + @property + def pid(self): + """Gets the pid of this Position. # noqa: E501 + + Sub-account position ID # noqa: E501 + + :return: The pid of this Position. # noqa: E501 + :rtype: int + """ + return self._pid + + @pid.setter + def pid(self, pid): + """Sets the pid of this Position. + + Sub-account position ID # noqa: E501 + + :param pid: The pid of this Position. # noqa: E501 + :type: int + """ + + self._pid = pid + def to_dict(self): """Returns the model properties as a dict""" result = {} @@ -727,16 +1010,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/position_close.py b/gate_api/models/position_close.py index 3efdfa4..3ab116d 100644 --- a/gate_api/models/position_close.py +++ b/gate_api/models/position_close.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -32,14 +32,40 @@ class PositionClose(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {'time': 'float', 'contract': 'str', 'side': 'str', 'pnl': 'str', 'text': 'str'} - - attribute_map = {'time': 'time', 'contract': 'contract', 'side': 'side', 'pnl': 'pnl', 'text': 'text'} - - def __init__( - self, time=None, contract=None, side=None, pnl=None, text=None, local_vars_configuration=None - ): # noqa: E501 - # type: (float, str, str, str, str, Configuration) -> None + openapi_types = { + 'time': 'float', + 'contract': 'str', + 'side': 'str', + 'pnl': 'str', + 'pnl_pnl': 'str', + 'pnl_fund': 'str', + 'pnl_fee': 'str', + 'text': 'str', + 'max_size': 'str', + 'accum_size': 'str', + 'first_open_time': 'int', + 'long_price': 'str', + 'short_price': 'str' + } + + attribute_map = { + 'time': 'time', + 'contract': 'contract', + 'side': 'side', + 'pnl': 'pnl', + 'pnl_pnl': 'pnl_pnl', + 'pnl_fund': 'pnl_fund', + 'pnl_fee': 'pnl_fee', + 'text': 'text', + 'max_size': 'max_size', + 'accum_size': 'accum_size', + 'first_open_time': 'first_open_time', + 'long_price': 'long_price', + 'short_price': 'short_price' + } + + def __init__(self, time=None, contract=None, side=None, pnl=None, pnl_pnl=None, pnl_fund=None, pnl_fee=None, text=None, max_size=None, accum_size=None, first_open_time=None, long_price=None, short_price=None, local_vars_configuration=None): # noqa: E501 + # type: (float, str, str, str, str, str, str, str, str, str, int, str, str, Configuration) -> None """PositionClose - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -49,7 +75,15 @@ def __init__( self._contract = None self._side = None self._pnl = None + self._pnl_pnl = None + self._pnl_fund = None + self._pnl_fee = None self._text = None + self._max_size = None + self._accum_size = None + self._first_open_time = None + self._long_price = None + self._short_price = None self.discriminator = None if time is not None: @@ -60,8 +94,24 @@ def __init__( self.side = side if pnl is not None: self.pnl = pnl + if pnl_pnl is not None: + self.pnl_pnl = pnl_pnl + if pnl_fund is not None: + self.pnl_fund = pnl_fund + if pnl_fee is not None: + self.pnl_fee = pnl_fee if text is not None: self.text = text + if max_size is not None: + self.max_size = max_size + if accum_size is not None: + self.accum_size = accum_size + if first_open_time is not None: + self.first_open_time = first_open_time + if long_price is not None: + self.long_price = long_price + if short_price is not None: + self.short_price = short_price @property def time(self): @@ -113,7 +163,7 @@ def contract(self, contract): def side(self): """Gets the side of this PositionClose. # noqa: E501 - Position side, long or short # noqa: E501 + Position side - `long`: Long position - `short`: Short position # noqa: E501 :return: The side of this PositionClose. # noqa: E501 :rtype: str @@ -124,7 +174,7 @@ def side(self): def side(self, side): """Sets the side of this PositionClose. - Position side, long or short # noqa: E501 + Position side - `long`: Long position - `short`: Short position # noqa: E501 :param side: The side of this PositionClose. # noqa: E501 :type: str @@ -132,7 +182,8 @@ def side(self, side): allowed_values = ["long", "short"] # 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}".format(side, allowed_values) # noqa: E501 + "Invalid value for `side` ({0}), must be one of {1}" # noqa: E501 + .format(side, allowed_values) ) self._side = side @@ -141,7 +192,7 @@ def side(self, side): def pnl(self): """Gets the pnl of this PositionClose. # noqa: E501 - PNL # noqa: E501 + PnL # noqa: E501 :return: The pnl of this PositionClose. # noqa: E501 :rtype: str @@ -152,7 +203,7 @@ def pnl(self): def pnl(self, pnl): """Sets the pnl of this PositionClose. - PNL # noqa: E501 + PnL # noqa: E501 :param pnl: The pnl of this PositionClose. # noqa: E501 :type: str @@ -160,11 +211,80 @@ def pnl(self, pnl): self._pnl = pnl + @property + def pnl_pnl(self): + """Gets the pnl_pnl of this PositionClose. # noqa: E501 + + PNL - Position P/L # noqa: E501 + + :return: The pnl_pnl of this PositionClose. # noqa: E501 + :rtype: str + """ + return self._pnl_pnl + + @pnl_pnl.setter + def pnl_pnl(self, pnl_pnl): + """Sets the pnl_pnl of this PositionClose. + + PNL - Position P/L # noqa: E501 + + :param pnl_pnl: The pnl_pnl of this PositionClose. # noqa: E501 + :type: str + """ + + self._pnl_pnl = pnl_pnl + + @property + def pnl_fund(self): + """Gets the pnl_fund of this PositionClose. # noqa: E501 + + PNL - Funding Fees # noqa: E501 + + :return: The pnl_fund of this PositionClose. # noqa: E501 + :rtype: str + """ + return self._pnl_fund + + @pnl_fund.setter + def pnl_fund(self, pnl_fund): + """Sets the pnl_fund of this PositionClose. + + PNL - Funding Fees # noqa: E501 + + :param pnl_fund: The pnl_fund of this PositionClose. # noqa: E501 + :type: str + """ + + self._pnl_fund = pnl_fund + + @property + def pnl_fee(self): + """Gets the pnl_fee of this PositionClose. # noqa: E501 + + PNL - Transaction Fees # noqa: E501 + + :return: The pnl_fee of this PositionClose. # noqa: E501 + :rtype: str + """ + return self._pnl_fee + + @pnl_fee.setter + def pnl_fee(self, pnl_fee): + """Sets the pnl_fee of this PositionClose. + + PNL - Transaction Fees # noqa: E501 + + :param pnl_fee: The pnl_fee of this PositionClose. # noqa: E501 + :type: str + """ + + self._pnl_fee = pnl_fee + @property def text(self): """Gets the text of this PositionClose. # noqa: E501 - Text of close order # noqa: E501 + Source of close order. See `order.text` field for specific values # noqa: E501 :return: The text of this PositionClose. # noqa: E501 :rtype: str @@ -175,7 +295,7 @@ def text(self): def text(self, text): """Sets the text of this PositionClose. - Text of close order # noqa: E501 + Source of close order. See `order.text` field for specific values # noqa: E501 :param text: The text of this PositionClose. # noqa: E501 :type: str @@ -183,6 +303,121 @@ def text(self, text): self._text = text + @property + def max_size(self): + """Gets the max_size of this PositionClose. # noqa: E501 + + Max Trade Size # noqa: E501 + + :return: The max_size of this PositionClose. # noqa: E501 + :rtype: str + """ + return self._max_size + + @max_size.setter + def max_size(self, max_size): + """Sets the max_size of this PositionClose. + + Max Trade Size # noqa: E501 + + :param max_size: The max_size of this PositionClose. # noqa: E501 + :type: str + """ + + self._max_size = max_size + + @property + def accum_size(self): + """Gets the accum_size of this PositionClose. # noqa: E501 + + Cumulative closed position volume # noqa: E501 + + :return: The accum_size of this PositionClose. # noqa: E501 + :rtype: str + """ + return self._accum_size + + @accum_size.setter + def accum_size(self, accum_size): + """Sets the accum_size of this PositionClose. + + Cumulative closed position volume # noqa: E501 + + :param accum_size: The accum_size of this PositionClose. # noqa: E501 + :type: str + """ + + self._accum_size = accum_size + + @property + def first_open_time(self): + """Gets the first_open_time of this PositionClose. # noqa: E501 + + First Open Time # noqa: E501 + + :return: The first_open_time of this PositionClose. # noqa: E501 + :rtype: int + """ + return self._first_open_time + + @first_open_time.setter + def first_open_time(self, first_open_time): + """Sets the first_open_time of this PositionClose. + + First Open Time # noqa: E501 + + :param first_open_time: The first_open_time of this PositionClose. # noqa: E501 + :type: int + """ + + self._first_open_time = first_open_time + + @property + def long_price(self): + """Gets the long_price of this PositionClose. # noqa: E501 + + When side is 'long', it indicates the opening average price; when side is 'short', it indicates the closing average price # noqa: E501 + + :return: The long_price of this PositionClose. # noqa: E501 + :rtype: str + """ + return self._long_price + + @long_price.setter + def long_price(self, long_price): + """Sets the long_price of this PositionClose. + + When side is 'long', it indicates the opening average price; when side is 'short', it indicates the closing average price # noqa: E501 + + :param long_price: The long_price of this PositionClose. # noqa: E501 + :type: str + """ + + self._long_price = long_price + + @property + def short_price(self): + """Gets the short_price of this PositionClose. # noqa: E501 + + When side is 'long', it indicates the closing average price; when side is 'short', it indicates the opening average price # noqa: E501 + + :return: The short_price of this PositionClose. # noqa: E501 + :rtype: str + """ + return self._short_price + + @short_price.setter + def short_price(self, short_price): + """Sets the short_price of this PositionClose. + + When side is 'long', it indicates the closing average price; when side is 'short', it indicates the opening average price # noqa: E501 + + :param short_price: The short_price of this PositionClose. # noqa: E501 + :type: str + """ + + self._short_price = short_price + def to_dict(self): """Returns the model properties as a dict""" result = {} @@ -190,16 +425,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/position_close_order.py b/gate_api/models/position_close_order.py index 9e2781e..575f3cd 100644 --- a/gate_api/models/position_close_order.py +++ b/gate_api/models/position_close_order.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -32,9 +32,17 @@ class PositionCloseOrder(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {'id': 'int', 'price': 'str', 'is_liq': 'bool'} - - attribute_map = {'id': 'id', 'price': 'price', 'is_liq': 'is_liq'} + openapi_types = { + 'id': 'int', + 'price': 'str', + 'is_liq': 'bool' + } + + attribute_map = { + 'id': 'id', + 'price': 'price', + 'is_liq': 'is_liq' + } def __init__(self, id=None, price=None, is_liq=None, local_vars_configuration=None): # noqa: E501 # type: (int, str, bool, Configuration) -> None @@ -59,7 +67,7 @@ def __init__(self, id=None, price=None, is_liq=None, local_vars_configuration=No def id(self): """Gets the id of this PositionCloseOrder. # noqa: E501 - Close order ID # noqa: E501 + Order ID # noqa: E501 :return: The id of this PositionCloseOrder. # noqa: E501 :rtype: int @@ -70,7 +78,7 @@ def id(self): def id(self, id): """Sets the id of this PositionCloseOrder. - Close order ID # noqa: E501 + Order ID # noqa: E501 :param id: The id of this PositionCloseOrder. # noqa: E501 :type: int @@ -82,7 +90,7 @@ def id(self, id): def price(self): """Gets the price of this PositionCloseOrder. # noqa: E501 - Close order price # noqa: E501 + Order price # noqa: E501 :return: The price of this PositionCloseOrder. # noqa: E501 :rtype: str @@ -93,7 +101,7 @@ def price(self): def price(self, price): """Sets the price of this PositionCloseOrder. - Close order price # noqa: E501 + Order price # noqa: E501 :param price: The price of this PositionCloseOrder. # noqa: E501 :type: str @@ -105,7 +113,7 @@ def price(self, price): def is_liq(self): """Gets the is_liq of this PositionCloseOrder. # noqa: E501 - Is the close order from liquidation # noqa: E501 + Whether the close order is from liquidation # noqa: E501 :return: The is_liq of this PositionCloseOrder. # noqa: E501 :rtype: bool @@ -116,7 +124,7 @@ def is_liq(self): def is_liq(self, is_liq): """Sets the is_liq of this PositionCloseOrder. - Is the close order from liquidation # noqa: E501 + Whether the close order is from liquidation # noqa: E501 :param is_liq: The is_liq of this PositionCloseOrder. # noqa: E501 :type: bool @@ -131,16 +139,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/profit_loss_range.py b/gate_api/models/profit_loss_range.py new file mode 100644 index 0000000..9f6b1e0 --- /dev/null +++ b/gate_api/models/profit_loss_range.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 ProfitLossRange(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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_percentage': 'str', + 'implied_volatility_percentage': 'str', + 'profit_loss': 'str' + } + + attribute_map = { + 'price_percentage': 'price_percentage', + 'implied_volatility_percentage': 'implied_volatility_percentage', + 'profit_loss': 'profit_loss' + } + + def __init__(self, price_percentage=None, implied_volatility_percentage=None, profit_loss=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, Configuration) -> None + """ProfitLossRange - a 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_percentage = None + self._implied_volatility_percentage = None + self._profit_loss = None + self.discriminator = None + + if price_percentage is not None: + self.price_percentage = price_percentage + if implied_volatility_percentage is not None: + self.implied_volatility_percentage = implied_volatility_percentage + if profit_loss is not None: + self.profit_loss = profit_loss + + @property + def price_percentage(self): + """Gets the price_percentage of this ProfitLossRange. # noqa: E501 + + Percentage change in price # noqa: E501 + + :return: The price_percentage of this ProfitLossRange. # noqa: E501 + :rtype: str + """ + return self._price_percentage + + @price_percentage.setter + def price_percentage(self, price_percentage): + """Sets the price_percentage of this ProfitLossRange. + + Percentage change in price # noqa: E501 + + :param price_percentage: The price_percentage of this ProfitLossRange. # noqa: E501 + :type: str + """ + + self._price_percentage = price_percentage + + @property + def implied_volatility_percentage(self): + """Gets the implied_volatility_percentage of this ProfitLossRange. # noqa: E501 + + Percentage change in implied volatility # noqa: E501 + + :return: The implied_volatility_percentage of this ProfitLossRange. # noqa: E501 + :rtype: str + """ + return self._implied_volatility_percentage + + @implied_volatility_percentage.setter + def implied_volatility_percentage(self, implied_volatility_percentage): + """Sets the implied_volatility_percentage of this ProfitLossRange. + + Percentage change in implied volatility # noqa: E501 + + :param implied_volatility_percentage: The implied_volatility_percentage of this ProfitLossRange. # noqa: E501 + :type: str + """ + + self._implied_volatility_percentage = implied_volatility_percentage + + @property + def profit_loss(self): + """Gets the profit_loss of this ProfitLossRange. # noqa: E501 + + PnL # noqa: E501 + + :return: The profit_loss of this ProfitLossRange. # noqa: E501 + :rtype: str + """ + return self._profit_loss + + @profit_loss.setter + def profit_loss(self, profit_loss): + """Sets the profit_loss of this ProfitLossRange. + + PnL # noqa: E501 + + :param profit_loss: The profit_loss of this ProfitLossRange. # noqa: E501 + :type: str + """ + + self._profit_loss = profit_loss + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ProfitLossRange): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ProfitLossRange): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/rebate_user_info.py b/gate_api/models/rebate_user_info.py new file mode 100644 index 0000000..c93d182 --- /dev/null +++ b/gate_api/models/rebate_user_info.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 RebateUserInfo(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'invite_uid': 'int' + } + + attribute_map = { + 'invite_uid': 'invite_uid' + } + + def __init__(self, invite_uid=None, local_vars_configuration=None): # noqa: E501 + # type: (int, Configuration) -> None + """RebateUserInfo - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._invite_uid = None + self.discriminator = None + + if invite_uid is not None: + self.invite_uid = invite_uid + + @property + def invite_uid(self): + """Gets the invite_uid of this RebateUserInfo. # noqa: E501 + + My inviter's UID # noqa: E501 + + :return: The invite_uid of this RebateUserInfo. # noqa: E501 + :rtype: int + """ + return self._invite_uid + + @invite_uid.setter + def invite_uid(self, invite_uid): + """Sets the invite_uid of this RebateUserInfo. + + My inviter's UID # noqa: E501 + + :param invite_uid: The invite_uid of this RebateUserInfo. # noqa: E501 + :type: int + """ + + self._invite_uid = invite_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, RebateUserInfo): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, RebateUserInfo): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/repay_currency_res.py b/gate_api/models/repay_currency_res.py new file mode 100644 index 0000000..f818b19 --- /dev/null +++ b/gate_api/models/repay_currency_res.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 RepayCurrencyRes(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'succeeded': 'bool', + 'label': 'str', + 'message': 'str', + 'currency': 'str', + 'repaid_principal': 'str', + 'repaid_interest': 'str' + } + + attribute_map = { + 'succeeded': 'succeeded', + 'label': 'label', + 'message': 'message', + 'currency': 'currency', + 'repaid_principal': 'repaid_principal', + 'repaid_interest': 'repaid_interest' + } + + def __init__(self, succeeded=None, label=None, message=None, currency=None, repaid_principal=None, repaid_interest=None, local_vars_configuration=None): # noqa: E501 + # type: (bool, str, str, str, str, str, Configuration) -> None + """RepayCurrencyRes - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._succeeded = None + self._label = None + self._message = None + self._currency = None + self._repaid_principal = None + self._repaid_interest = None + self.discriminator = None + + if succeeded is not None: + self.succeeded = succeeded + if label is not None: + self.label = label + if message is not None: + self.message = message + if currency is not None: + self.currency = currency + if repaid_principal is not None: + self.repaid_principal = repaid_principal + if repaid_interest is not None: + self.repaid_interest = repaid_interest + + @property + def succeeded(self): + """Gets the succeeded of this RepayCurrencyRes. # noqa: E501 + + Whether the repayment was successful # noqa: E501 + + :return: The succeeded of this RepayCurrencyRes. # noqa: E501 + :rtype: bool + """ + return self._succeeded + + @succeeded.setter + def succeeded(self, succeeded): + """Sets the succeeded of this RepayCurrencyRes. + + Whether the repayment was successful # noqa: E501 + + :param succeeded: The succeeded of this RepayCurrencyRes. # noqa: E501 + :type: bool + """ + + self._succeeded = succeeded + + @property + def label(self): + """Gets the label of this RepayCurrencyRes. # noqa: E501 + + Error identifier for failed operations; empty when successful # noqa: E501 + + :return: The label of this RepayCurrencyRes. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this RepayCurrencyRes. + + Error identifier for failed operations; empty when successful # noqa: E501 + + :param label: The label of this RepayCurrencyRes. # noqa: E501 + :type: str + """ + + self._label = label + + @property + def message(self): + """Gets the message of this RepayCurrencyRes. # noqa: E501 + + Error description for failed operations; empty when successful # noqa: E501 + + :return: The message of this RepayCurrencyRes. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this RepayCurrencyRes. + + Error description for failed operations; empty when successful # noqa: E501 + + :param message: The message of this RepayCurrencyRes. # noqa: E501 + :type: str + """ + + self._message = message + + @property + def currency(self): + """Gets the currency of this RepayCurrencyRes. # noqa: E501 + + Repayment currency # noqa: E501 + + :return: The currency of this RepayCurrencyRes. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this RepayCurrencyRes. + + Repayment currency # noqa: E501 + + :param currency: The currency of this RepayCurrencyRes. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def repaid_principal(self): + """Gets the repaid_principal of this RepayCurrencyRes. # noqa: E501 + + Principal # noqa: E501 + + :return: The repaid_principal of this RepayCurrencyRes. # noqa: E501 + :rtype: str + """ + return self._repaid_principal + + @repaid_principal.setter + def repaid_principal(self, repaid_principal): + """Sets the repaid_principal of this RepayCurrencyRes. + + Principal # noqa: E501 + + :param repaid_principal: The repaid_principal of this RepayCurrencyRes. # noqa: E501 + :type: str + """ + + self._repaid_principal = repaid_principal + + @property + def repaid_interest(self): + """Gets the repaid_interest of this RepayCurrencyRes. # noqa: E501 + + Principal # noqa: E501 + + :return: The repaid_interest of this RepayCurrencyRes. # noqa: E501 + :rtype: str + """ + return self._repaid_interest + + @repaid_interest.setter + def repaid_interest(self, repaid_interest): + """Sets the repaid_interest of this RepayCurrencyRes. + + Principal # noqa: E501 + + :param repaid_interest: The repaid_interest of this RepayCurrencyRes. # noqa: E501 + :type: str + """ + + self._repaid_interest = repaid_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, RepayCurrencyRes): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, RepayCurrencyRes): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/repay_loan.py b/gate_api/models/repay_loan.py new file mode 100644 index 0000000..f8d97d6 --- /dev/null +++ b/gate_api/models/repay_loan.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 RepayLoan(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'repay_amount': 'str', + 'repaid_all': 'bool' + } + + attribute_map = { + 'order_id': 'order_id', + 'repay_amount': 'repay_amount', + 'repaid_all': 'repaid_all' + } + + 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 + 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.discriminator = None + + self.order_id = order_id + self.repay_amount = repay_amount + self.repaid_all = repaid_all + + @property + def order_id(self): + """Gets the order_id of this RepayLoan. # noqa: E501 + + Order ID # noqa: E501 + + :return: The order_id of this RepayLoan. # noqa: E501 + :rtype: int + """ + return self._order_id + + @order_id.setter + def order_id(self, order_id): + """Sets the order_id of this RepayLoan. + + Order ID # noqa: E501 + + :param order_id: The order_id of this RepayLoan. # 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 repay_amount(self): + """Gets the repay_amount of this RepayLoan. # noqa: E501 + + Repayment amount, it is mandatory when making partial repayments # noqa: E501 + + :return: The repay_amount of this RepayLoan. # noqa: E501 + :rtype: str + """ + return self._repay_amount + + @repay_amount.setter + def repay_amount(self, repay_amount): + """Sets the repay_amount of this RepayLoan. + + Repayment amount, it is mandatory when making partial repayments # noqa: E501 + + :param repay_amount: The repay_amount of this RepayLoan. # noqa: E501 + :type: str + """ + 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 + + self._repay_amount = repay_amount + + @property + def repaid_all(self): + """Gets the repaid_all of this RepayLoan. # 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 + + :return: The repaid_all of this RepayLoan. # noqa: E501 + :rtype: bool + """ + return self._repaid_all + + @repaid_all.setter + def repaid_all(self, repaid_all): + """Sets the repaid_all of this RepayLoan. + + 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 + + :param repaid_all: The repaid_all of this RepayLoan. # noqa: E501 + :type: bool + """ + 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 + + self._repaid_all = repaid_all + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, RepayLoan): + return 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): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/repay_multi_loan.py b/gate_api/models/repay_multi_loan.py new file mode 100644 index 0000000..20c2385 --- /dev/null +++ b/gate_api/models/repay_multi_loan.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 RepayMultiLoan(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'repay_items': 'list[MultiLoanRepayItem]' + } + + attribute_map = { + 'order_id': 'order_id', + 'repay_items': 'repay_items' + } + + def __init__(self, order_id=None, repay_items=None, local_vars_configuration=None): # noqa: E501 + # type: (int, list[MultiLoanRepayItem], Configuration) -> None + """RepayMultiLoan - a 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_items = None + self.discriminator = None + + self.order_id = order_id + self.repay_items = repay_items + + @property + def order_id(self): + """Gets the order_id of this RepayMultiLoan. # noqa: E501 + + Order ID # noqa: E501 + + :return: The order_id of this RepayMultiLoan. # noqa: E501 + :rtype: int + """ + return self._order_id + + @order_id.setter + def order_id(self, order_id): + """Sets the order_id of this RepayMultiLoan. + + Order ID # noqa: E501 + + :param order_id: The order_id of this RepayMultiLoan. # 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 repay_items(self): + """Gets the repay_items of this RepayMultiLoan. # noqa: E501 + + Repay Currency Item # noqa: E501 + + :return: The repay_items of this RepayMultiLoan. # noqa: E501 + :rtype: list[MultiLoanRepayItem] + """ + return self._repay_items + + @repay_items.setter + def repay_items(self, repay_items): + """Sets the repay_items of this RepayMultiLoan. + + Repay Currency Item # noqa: E501 + + :param repay_items: The repay_items of this RepayMultiLoan. # noqa: E501 + :type: list[MultiLoanRepayItem] + """ + if self.local_vars_configuration.client_side_validation and repay_items is None: # noqa: E501 + raise ValueError("Invalid value for `repay_items`, must not be `None`") # noqa: E501 + + self._repay_items = repay_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, RepayMultiLoan): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, RepayMultiLoan): + 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 new file mode 100644 index 0000000..faef08c --- /dev/null +++ b/gate_api/models/repay_record.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 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/repay_record_currency.py b/gate_api/models/repay_record_currency.py new file mode 100644 index 0000000..1f175bc --- /dev/null +++ b/gate_api/models/repay_record_currency.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 RepayRecordCurrency(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'index_price': 'str', + 'before_amount': 'str', + 'before_amount_usdt': 'str', + 'after_amount': 'str', + 'after_amount_usdt': 'str' + } + + attribute_map = { + 'currency': 'currency', + 'index_price': 'index_price', + 'before_amount': 'before_amount', + 'before_amount_usdt': 'before_amount_usdt', + 'after_amount': 'after_amount', + 'after_amount_usdt': 'after_amount_usdt' + } + + def __init__(self, currency=None, index_price=None, before_amount=None, before_amount_usdt=None, after_amount=None, after_amount_usdt=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, Configuration) -> None + """RepayRecordCurrency - a 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._index_price = None + self._before_amount = None + self._before_amount_usdt = None + self._after_amount = None + self._after_amount_usdt = None + self.discriminator = None + + if currency is not None: + self.currency = currency + if index_price is not None: + self.index_price = index_price + if before_amount is not None: + self.before_amount = before_amount + if before_amount_usdt is not None: + self.before_amount_usdt = before_amount_usdt + if after_amount is not None: + self.after_amount = after_amount + if after_amount_usdt is not None: + self.after_amount_usdt = after_amount_usdt + + @property + def currency(self): + """Gets the currency of this RepayRecordCurrency. # noqa: E501 + + Currency # noqa: E501 + + :return: The currency of this RepayRecordCurrency. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this RepayRecordCurrency. + + Currency # noqa: E501 + + :param currency: The currency of this RepayRecordCurrency. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def index_price(self): + """Gets the index_price of this RepayRecordCurrency. # noqa: E501 + + Currency Index Price # noqa: E501 + + :return: The index_price of this RepayRecordCurrency. # noqa: E501 + :rtype: str + """ + return self._index_price + + @index_price.setter + def index_price(self, index_price): + """Sets the index_price of this RepayRecordCurrency. + + Currency Index Price # noqa: E501 + + :param index_price: The index_price of this RepayRecordCurrency. # noqa: E501 + :type: str + """ + + self._index_price = index_price + + @property + def before_amount(self): + """Gets the before_amount of this RepayRecordCurrency. # noqa: E501 + + Amount before the operation # noqa: E501 + + :return: The before_amount of this RepayRecordCurrency. # noqa: E501 + :rtype: str + """ + return self._before_amount + + @before_amount.setter + def before_amount(self, before_amount): + """Sets the before_amount of this RepayRecordCurrency. + + Amount before the operation # noqa: E501 + + :param before_amount: The before_amount of this RepayRecordCurrency. # noqa: E501 + :type: str + """ + + self._before_amount = before_amount + + @property + def before_amount_usdt(self): + """Gets the before_amount_usdt of this RepayRecordCurrency. # noqa: E501 + + USDT Amount before the operation # noqa: E501 + + :return: The before_amount_usdt of this RepayRecordCurrency. # noqa: E501 + :rtype: str + """ + return self._before_amount_usdt + + @before_amount_usdt.setter + def before_amount_usdt(self, before_amount_usdt): + """Sets the before_amount_usdt of this RepayRecordCurrency. + + USDT Amount before the operation # noqa: E501 + + :param before_amount_usdt: The before_amount_usdt of this RepayRecordCurrency. # noqa: E501 + :type: str + """ + + self._before_amount_usdt = before_amount_usdt + + @property + def after_amount(self): + """Gets the after_amount of this RepayRecordCurrency. # noqa: E501 + + Amount after the operation # noqa: E501 + + :return: The after_amount of this RepayRecordCurrency. # noqa: E501 + :rtype: str + """ + return self._after_amount + + @after_amount.setter + def after_amount(self, after_amount): + """Sets the after_amount of this RepayRecordCurrency. + + Amount after the operation # noqa: E501 + + :param after_amount: The after_amount of this RepayRecordCurrency. # noqa: E501 + :type: str + """ + + self._after_amount = after_amount + + @property + def after_amount_usdt(self): + """Gets the after_amount_usdt of this RepayRecordCurrency. # noqa: E501 + + USDT Amount after the operation # noqa: E501 + + :return: The after_amount_usdt of this RepayRecordCurrency. # noqa: E501 + :rtype: str + """ + return self._after_amount_usdt + + @after_amount_usdt.setter + def after_amount_usdt(self, after_amount_usdt): + """Sets the after_amount_usdt of this RepayRecordCurrency. + + USDT Amount after the operation # noqa: E501 + + :param after_amount_usdt: The after_amount_usdt of this RepayRecordCurrency. # noqa: E501 + :type: str + """ + + self._after_amount_usdt = after_amount_usdt + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, RepayRecordCurrency): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, RepayRecordCurrency): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/repay_record_left_interest.py b/gate_api/models/repay_record_left_interest.py new file mode 100644 index 0000000..604dd12 --- /dev/null +++ b/gate_api/models/repay_record_left_interest.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 RepayRecordLeftInterest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'index_price': 'str', + 'before_amount': 'str', + 'before_amount_usdt': 'str', + 'after_amount': 'str', + 'after_amount_usdt': 'str' + } + + attribute_map = { + 'currency': 'currency', + 'index_price': 'index_price', + 'before_amount': 'before_amount', + 'before_amount_usdt': 'before_amount_usdt', + 'after_amount': 'after_amount', + 'after_amount_usdt': 'after_amount_usdt' + } + + def __init__(self, currency=None, index_price=None, before_amount=None, before_amount_usdt=None, after_amount=None, after_amount_usdt=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, Configuration) -> None + """RepayRecordLeftInterest - a 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._index_price = None + self._before_amount = None + self._before_amount_usdt = None + self._after_amount = None + self._after_amount_usdt = None + self.discriminator = None + + if currency is not None: + self.currency = currency + if index_price is not None: + self.index_price = index_price + if before_amount is not None: + self.before_amount = before_amount + if before_amount_usdt is not None: + self.before_amount_usdt = before_amount_usdt + if after_amount is not None: + self.after_amount = after_amount + if after_amount_usdt is not None: + self.after_amount_usdt = after_amount_usdt + + @property + def currency(self): + """Gets the currency of this RepayRecordLeftInterest. # noqa: E501 + + Currency # noqa: E501 + + :return: The currency of this RepayRecordLeftInterest. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this RepayRecordLeftInterest. + + Currency # noqa: E501 + + :param currency: The currency of this RepayRecordLeftInterest. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def index_price(self): + """Gets the index_price of this RepayRecordLeftInterest. # noqa: E501 + + Currency Index Price # noqa: E501 + + :return: The index_price of this RepayRecordLeftInterest. # noqa: E501 + :rtype: str + """ + return self._index_price + + @index_price.setter + def index_price(self, index_price): + """Sets the index_price of this RepayRecordLeftInterest. + + Currency Index Price # noqa: E501 + + :param index_price: The index_price of this RepayRecordLeftInterest. # noqa: E501 + :type: str + """ + + self._index_price = index_price + + @property + def before_amount(self): + """Gets the before_amount of this RepayRecordLeftInterest. # noqa: E501 + + Interest amount before repayment # noqa: E501 + + :return: The before_amount of this RepayRecordLeftInterest. # noqa: E501 + :rtype: str + """ + return self._before_amount + + @before_amount.setter + def before_amount(self, before_amount): + """Sets the before_amount of this RepayRecordLeftInterest. + + Interest amount before repayment # noqa: E501 + + :param before_amount: The before_amount of this RepayRecordLeftInterest. # noqa: E501 + :type: str + """ + + self._before_amount = before_amount + + @property + def before_amount_usdt(self): + """Gets the before_amount_usdt of this RepayRecordLeftInterest. # noqa: E501 + + Converted value of interest before repayment in USDT # noqa: E501 + + :return: The before_amount_usdt of this RepayRecordLeftInterest. # noqa: E501 + :rtype: str + """ + return self._before_amount_usdt + + @before_amount_usdt.setter + def before_amount_usdt(self, before_amount_usdt): + """Sets the before_amount_usdt of this RepayRecordLeftInterest. + + Converted value of interest before repayment in USDT # noqa: E501 + + :param before_amount_usdt: The before_amount_usdt of this RepayRecordLeftInterest. # noqa: E501 + :type: str + """ + + self._before_amount_usdt = before_amount_usdt + + @property + def after_amount(self): + """Gets the after_amount of this RepayRecordLeftInterest. # noqa: E501 + + Interest amount after repayment # noqa: E501 + + :return: The after_amount of this RepayRecordLeftInterest. # noqa: E501 + :rtype: str + """ + return self._after_amount + + @after_amount.setter + def after_amount(self, after_amount): + """Sets the after_amount of this RepayRecordLeftInterest. + + Interest amount after repayment # noqa: E501 + + :param after_amount: The after_amount of this RepayRecordLeftInterest. # noqa: E501 + :type: str + """ + + self._after_amount = after_amount + + @property + def after_amount_usdt(self): + """Gets the after_amount_usdt of this RepayRecordLeftInterest. # noqa: E501 + + Converted value of interest after repayment in USDT # noqa: E501 + + :return: The after_amount_usdt of this RepayRecordLeftInterest. # noqa: E501 + :rtype: str + """ + return self._after_amount_usdt + + @after_amount_usdt.setter + def after_amount_usdt(self, after_amount_usdt): + """Sets the after_amount_usdt of this RepayRecordLeftInterest. + + Converted value of interest after repayment in USDT # noqa: E501 + + :param after_amount_usdt: The after_amount_usdt of this RepayRecordLeftInterest. # noqa: E501 + :type: str + """ + + self._after_amount_usdt = after_amount_usdt + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, RepayRecordLeftInterest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, RepayRecordLeftInterest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/repay_record_repaid_currency.py b/gate_api/models/repay_record_repaid_currency.py new file mode 100644 index 0000000..5aa54fd --- /dev/null +++ b/gate_api/models/repay_record_repaid_currency.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 RepayRecordRepaidCurrency(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'index_price': 'str', + 'repaid_amount': 'str', + 'repaid_principal': 'str', + 'repaid_interest': 'str', + 'repaid_amount_usdt': 'str' + } + + attribute_map = { + 'currency': 'currency', + 'index_price': 'index_price', + 'repaid_amount': 'repaid_amount', + 'repaid_principal': 'repaid_principal', + 'repaid_interest': 'repaid_interest', + 'repaid_amount_usdt': 'repaid_amount_usdt' + } + + def __init__(self, currency=None, index_price=None, repaid_amount=None, repaid_principal=None, repaid_interest=None, repaid_amount_usdt=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, Configuration) -> None + """RepayRecordRepaidCurrency - a 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._index_price = None + self._repaid_amount = None + self._repaid_principal = None + self._repaid_interest = None + self._repaid_amount_usdt = None + self.discriminator = None + + if currency is not None: + self.currency = currency + if index_price is not None: + self.index_price = index_price + 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 repaid_amount_usdt is not None: + self.repaid_amount_usdt = repaid_amount_usdt + + @property + def currency(self): + """Gets the currency of this RepayRecordRepaidCurrency. # noqa: E501 + + Repayment currency # noqa: E501 + + :return: The currency of this RepayRecordRepaidCurrency. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this RepayRecordRepaidCurrency. + + Repayment currency # noqa: E501 + + :param currency: The currency of this RepayRecordRepaidCurrency. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def index_price(self): + """Gets the index_price of this RepayRecordRepaidCurrency. # noqa: E501 + + Currency Index Price # noqa: E501 + + :return: The index_price of this RepayRecordRepaidCurrency. # noqa: E501 + :rtype: str + """ + return self._index_price + + @index_price.setter + def index_price(self, index_price): + """Sets the index_price of this RepayRecordRepaidCurrency. + + Currency Index Price # noqa: E501 + + :param index_price: The index_price of this RepayRecordRepaidCurrency. # noqa: E501 + :type: str + """ + + self._index_price = index_price + + @property + def repaid_amount(self): + """Gets the repaid_amount of this RepayRecordRepaidCurrency. # noqa: E501 + + Repayment amount # noqa: E501 + + :return: The repaid_amount of this RepayRecordRepaidCurrency. # noqa: E501 + :rtype: str + """ + return self._repaid_amount + + @repaid_amount.setter + def repaid_amount(self, repaid_amount): + """Sets the repaid_amount of this RepayRecordRepaidCurrency. + + Repayment amount # noqa: E501 + + :param repaid_amount: The repaid_amount of this RepayRecordRepaidCurrency. # noqa: E501 + :type: str + """ + + self._repaid_amount = repaid_amount + + @property + def repaid_principal(self): + """Gets the repaid_principal of this RepayRecordRepaidCurrency. # noqa: E501 + + Principal # noqa: E501 + + :return: The repaid_principal of this RepayRecordRepaidCurrency. # noqa: E501 + :rtype: str + """ + return self._repaid_principal + + @repaid_principal.setter + def repaid_principal(self, repaid_principal): + """Sets the repaid_principal of this RepayRecordRepaidCurrency. + + Principal # noqa: E501 + + :param repaid_principal: The repaid_principal of this RepayRecordRepaidCurrency. # noqa: E501 + :type: str + """ + + self._repaid_principal = repaid_principal + + @property + def repaid_interest(self): + """Gets the repaid_interest of this RepayRecordRepaidCurrency. # noqa: E501 + + Interest # noqa: E501 + + :return: The repaid_interest of this RepayRecordRepaidCurrency. # noqa: E501 + :rtype: str + """ + return self._repaid_interest + + @repaid_interest.setter + def repaid_interest(self, repaid_interest): + """Sets the repaid_interest of this RepayRecordRepaidCurrency. + + Interest # noqa: E501 + + :param repaid_interest: The repaid_interest of this RepayRecordRepaidCurrency. # noqa: E501 + :type: str + """ + + self._repaid_interest = repaid_interest + + @property + def repaid_amount_usdt(self): + """Gets the repaid_amount_usdt of this RepayRecordRepaidCurrency. # noqa: E501 + + Repayment amount converted to USDT # noqa: E501 + + :return: The repaid_amount_usdt of this RepayRecordRepaidCurrency. # noqa: E501 + :rtype: str + """ + return self._repaid_amount_usdt + + @repaid_amount_usdt.setter + def repaid_amount_usdt(self, repaid_amount_usdt): + """Sets the repaid_amount_usdt of this RepayRecordRepaidCurrency. + + Repayment amount converted to USDT # noqa: E501 + + :param repaid_amount_usdt: The repaid_amount_usdt of this RepayRecordRepaidCurrency. # noqa: E501 + :type: str + """ + + self._repaid_amount_usdt = repaid_amount_usdt + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, RepayRecordRepaidCurrency): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, RepayRecordRepaidCurrency): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/repay_record_total_interest.py b/gate_api/models/repay_record_total_interest.py new file mode 100644 index 0000000..11e31c4 --- /dev/null +++ b/gate_api/models/repay_record_total_interest.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 RepayRecordTotalInterest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'index_price': 'str', + 'amount': 'str', + 'amount_usdt': 'str' + } + + attribute_map = { + 'currency': 'currency', + 'index_price': 'index_price', + 'amount': 'amount', + 'amount_usdt': 'amount_usdt' + } + + def __init__(self, currency=None, index_price=None, amount=None, amount_usdt=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, Configuration) -> None + """RepayRecordTotalInterest - a 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._index_price = None + self._amount = None + self._amount_usdt = None + self.discriminator = None + + if currency is not None: + self.currency = currency + if index_price is not None: + self.index_price = index_price + if amount is not None: + self.amount = amount + if amount_usdt is not None: + self.amount_usdt = amount_usdt + + @property + def currency(self): + """Gets the currency of this RepayRecordTotalInterest. # noqa: E501 + + Currency # noqa: E501 + + :return: The currency of this RepayRecordTotalInterest. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this RepayRecordTotalInterest. + + Currency # noqa: E501 + + :param currency: The currency of this RepayRecordTotalInterest. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def index_price(self): + """Gets the index_price of this RepayRecordTotalInterest. # noqa: E501 + + Currency Index Price # noqa: E501 + + :return: The index_price of this RepayRecordTotalInterest. # noqa: E501 + :rtype: str + """ + return self._index_price + + @index_price.setter + def index_price(self, index_price): + """Sets the index_price of this RepayRecordTotalInterest. + + Currency Index Price # noqa: E501 + + :param index_price: The index_price of this RepayRecordTotalInterest. # noqa: E501 + :type: str + """ + + self._index_price = index_price + + @property + def amount(self): + """Gets the amount of this RepayRecordTotalInterest. # noqa: E501 + + Interest Amount # noqa: E501 + + :return: The amount of this RepayRecordTotalInterest. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this RepayRecordTotalInterest. + + Interest Amount # noqa: E501 + + :param amount: The amount of this RepayRecordTotalInterest. # noqa: E501 + :type: str + """ + + self._amount = amount + + @property + def amount_usdt(self): + """Gets the amount_usdt of this RepayRecordTotalInterest. # noqa: E501 + + Interest amount converted to USDT # noqa: E501 + + :return: The amount_usdt of this RepayRecordTotalInterest. # noqa: E501 + :rtype: str + """ + return self._amount_usdt + + @amount_usdt.setter + def amount_usdt(self, amount_usdt): + """Sets the amount_usdt of this RepayRecordTotalInterest. + + Interest amount converted to USDT # noqa: E501 + + :param amount_usdt: The amount_usdt of this RepayRecordTotalInterest. # noqa: E501 + :type: str + """ + + self._amount_usdt = amount_usdt + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, RepayRecordTotalInterest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, RepayRecordTotalInterest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/repay_request.py b/gate_api/models/repay_request.py deleted file mode 100644 index 7a8af15..0000000 --- a/gate_api/models/repay_request.py +++ /dev/null @@ -1,205 +0,0 @@ -# coding: utf-8 - -""" - Gate API v4 - - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 - - Contact: support@mail.gate.io - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from gate_api.configuration import Configuration - - -class RepayRequest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - 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', 'currency': 'str', 'mode': 'str', 'amount': 'str'} - - attribute_map = {'currency_pair': 'currency_pair', 'currency': 'currency', 'mode': 'mode', 'amount': 'amount'} - - def __init__( - self, currency_pair=None, currency=None, mode=None, amount=None, local_vars_configuration=None - ): # noqa: E501 - # type: (str, str, str, str, Configuration) -> None - """RepayRequest - a 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._currency = None - self._mode = None - self._amount = None - self.discriminator = None - - self.currency_pair = currency_pair - self.currency = currency - self.mode = mode - if amount is not None: - self.amount = amount - - @property - def currency_pair(self): - """Gets the currency_pair of this RepayRequest. # noqa: E501 - - Currency pair # noqa: E501 - - :return: The currency_pair of this RepayRequest. # noqa: E501 - :rtype: str - """ - return self._currency_pair - - @currency_pair.setter - def currency_pair(self, currency_pair): - """Sets the currency_pair of this RepayRequest. - - Currency pair # noqa: E501 - - :param currency_pair: The currency_pair of this RepayRequest. # 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 currency(self): - """Gets the currency of this RepayRequest. # noqa: E501 - - Loan currency # noqa: E501 - - :return: The currency of this RepayRequest. # noqa: E501 - :rtype: str - """ - return self._currency - - @currency.setter - def currency(self, currency): - """Sets the currency of this RepayRequest. - - Loan currency # noqa: E501 - - :param currency: The currency of this RepayRequest. # 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 mode(self): - """Gets the mode of this RepayRequest. # noqa: E501 - - Repay mode. all - repay all; partial - repay only some portion # noqa: E501 - - :return: The mode of this RepayRequest. # noqa: E501 - :rtype: str - """ - return self._mode - - @mode.setter - def mode(self, mode): - """Sets the mode of this RepayRequest. - - Repay mode. all - repay all; partial - repay only some portion # noqa: E501 - - :param mode: The mode of this RepayRequest. # noqa: E501 - :type: str - """ - if self.local_vars_configuration.client_side_validation and mode is None: # noqa: E501 - raise ValueError("Invalid value for `mode`, must not be `None`") # noqa: E501 - allowed_values = ["all", "partial"] # noqa: E501 - if self.local_vars_configuration.client_side_validation and mode not in allowed_values: # noqa: E501 - raise ValueError( - "Invalid value for `mode` ({0}), must be one of {1}".format(mode, allowed_values) # noqa: E501 - ) - - self._mode = mode - - @property - def amount(self): - """Gets the amount of this RepayRequest. # noqa: E501 - - Repay amount. Required in `partial` mode # noqa: E501 - - :return: The amount of this RepayRequest. # noqa: E501 - :rtype: str - """ - return self._amount - - @amount.setter - def amount(self, amount): - """Sets the amount of this RepayRequest. - - Repay amount. Required in `partial` mode # noqa: E501 - - :param amount: The amount of this RepayRequest. # noqa: E501 - :type: str - """ - - 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, RepayRequest): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, RepayRequest): - return True - - return self.to_dict() != other.to_dict() diff --git a/gate_api/models/repay_resp.py b/gate_api/models/repay_resp.py new file mode 100644 index 0000000..f35f6bc --- /dev/null +++ b/gate_api/models/repay_resp.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 RepayResp(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'repaid_principal': 'str', + 'repaid_interest': 'str' + } + + attribute_map = { + 'repaid_principal': 'repaid_principal', + 'repaid_interest': 'repaid_interest' + } + + def __init__(self, repaid_principal=None, repaid_interest=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """RepayResp - a 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.discriminator = None + + if repaid_principal is not None: + self.repaid_principal = repaid_principal + if repaid_interest is not None: + self.repaid_interest = repaid_interest + + @property + def repaid_principal(self): + """Gets the repaid_principal of this RepayResp. # noqa: E501 + + Principal # noqa: E501 + + :return: The repaid_principal of this RepayResp. # noqa: E501 + :rtype: str + """ + return self._repaid_principal + + @repaid_principal.setter + def repaid_principal(self, repaid_principal): + """Sets the repaid_principal of this RepayResp. + + Principal # noqa: E501 + + :param repaid_principal: The repaid_principal of this RepayResp. # noqa: E501 + :type: str + """ + + self._repaid_principal = repaid_principal + + @property + def repaid_interest(self): + """Gets the repaid_interest of this RepayResp. # noqa: E501 + + Interest # noqa: E501 + + :return: The repaid_interest of this RepayResp. # noqa: E501 + :rtype: str + """ + return self._repaid_interest + + @repaid_interest.setter + def repaid_interest(self, repaid_interest): + """Sets the repaid_interest of this RepayResp. + + Interest # noqa: E501 + + :param repaid_interest: The repaid_interest of this RepayResp. # noqa: E501 + :type: str + """ + + self._repaid_interest = repaid_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, RepayResp): + return 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): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/repayment.py b/gate_api/models/repayment.py deleted file mode 100644 index 16ce9d1..0000000 --- a/gate_api/models/repayment.py +++ /dev/null @@ -1,197 +0,0 @@ -# coding: utf-8 - -""" - Gate API v4 - - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 - - Contact: support@mail.gate.io - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from gate_api.configuration import Configuration - - -class Repayment(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - 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', 'create_time': 'str', 'principal': 'str', 'interest': 'str'} - - attribute_map = {'id': 'id', 'create_time': 'create_time', 'principal': 'principal', 'interest': 'interest'} - - def __init__( - self, id=None, create_time=None, principal=None, interest=None, local_vars_configuration=None - ): # noqa: E501 - # type: (str, str, str, str, Configuration) -> None - """Repayment - a 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._create_time = None - self._principal = None - self._interest = None - self.discriminator = None - - if id is not None: - self.id = id - if create_time is not None: - self.create_time = create_time - if principal is not None: - self.principal = principal - if interest is not None: - self.interest = interest - - @property - def id(self): - """Gets the id of this Repayment. # noqa: E501 - - Loan record ID # noqa: E501 - - :return: The id of this Repayment. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this Repayment. - - Loan record ID # noqa: E501 - - :param id: The id of this Repayment. # noqa: E501 - :type: str - """ - - self._id = id - - @property - def create_time(self): - """Gets the create_time of this Repayment. # noqa: E501 - - Repayment time # noqa: E501 - - :return: The create_time of this Repayment. # noqa: E501 - :rtype: str - """ - return self._create_time - - @create_time.setter - def create_time(self, create_time): - """Sets the create_time of this Repayment. - - Repayment time # noqa: E501 - - :param create_time: The create_time of this Repayment. # noqa: E501 - :type: str - """ - - self._create_time = create_time - - @property - def principal(self): - """Gets the principal of this Repayment. # noqa: E501 - - Repaid principal # noqa: E501 - - :return: The principal of this Repayment. # noqa: E501 - :rtype: str - """ - return self._principal - - @principal.setter - def principal(self, principal): - """Sets the principal of this Repayment. - - Repaid principal # noqa: E501 - - :param principal: The principal of this Repayment. # noqa: E501 - :type: str - """ - - self._principal = principal - - @property - def interest(self): - """Gets the interest of this Repayment. # noqa: E501 - - Repaid interest # noqa: E501 - - :return: The interest of this Repayment. # noqa: E501 - :rtype: str - """ - return self._interest - - @interest.setter - def interest(self, interest): - """Sets the interest of this Repayment. - - Repaid interest # noqa: E501 - - :param interest: The interest of this Repayment. # noqa: E501 - :type: str - """ - - self._interest = 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, Repayment): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Repayment): - return True - - return self.to_dict() != other.to_dict() diff --git a/gate_api/models/risk_units.py b/gate_api/models/risk_units.py new file mode 100644 index 0000000..9ab5a17 --- /dev/null +++ b/gate_api/models/risk_units.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 RiskUnits(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'spot_in_use': 'str', + 'maintain_margin': 'str', + 'initial_margin': 'str', + 'delta': 'str', + 'gamma': 'str', + 'theta': 'str', + 'vega': 'str' + } + + attribute_map = { + 'symbol': 'symbol', + 'spot_in_use': 'spot_in_use', + 'maintain_margin': 'maintain_margin', + 'initial_margin': 'initial_margin', + 'delta': 'delta', + 'gamma': 'gamma', + 'theta': 'theta', + 'vega': 'vega' + } + + def __init__(self, symbol=None, spot_in_use=None, maintain_margin=None, initial_margin=None, delta=None, gamma=None, theta=None, vega=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, str, Configuration) -> None + """RiskUnits - a 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._spot_in_use = None + self._maintain_margin = None + self._initial_margin = None + self._delta = None + self._gamma = None + self._theta = None + self._vega = None + self.discriminator = None + + if symbol is not None: + self.symbol = symbol + if spot_in_use is not None: + self.spot_in_use = spot_in_use + if maintain_margin is not None: + self.maintain_margin = maintain_margin + if initial_margin is not None: + self.initial_margin = initial_margin + if delta is not None: + self.delta = delta + if gamma is not None: + self.gamma = gamma + if theta is not None: + self.theta = theta + if vega is not None: + self.vega = vega + + @property + def symbol(self): + """Gets the symbol of this RiskUnits. # noqa: E501 + + Risk unit flag # noqa: E501 + + :return: The symbol of this RiskUnits. # noqa: E501 + :rtype: str + """ + return self._symbol + + @symbol.setter + def symbol(self, symbol): + """Sets the symbol of this RiskUnits. + + Risk unit flag # noqa: E501 + + :param symbol: The symbol of this RiskUnits. # noqa: E501 + :type: str + """ + + self._symbol = symbol + + @property + def spot_in_use(self): + """Gets the spot_in_use of this RiskUnits. # noqa: E501 + + Spot hedging occupied amount # noqa: E501 + + :return: The spot_in_use of this RiskUnits. # noqa: E501 + :rtype: str + """ + return self._spot_in_use + + @spot_in_use.setter + def spot_in_use(self, spot_in_use): + """Sets the spot_in_use of this RiskUnits. + + Spot hedging occupied amount # noqa: E501 + + :param spot_in_use: The spot_in_use of this RiskUnits. # noqa: E501 + :type: str + """ + + self._spot_in_use = spot_in_use + + @property + def maintain_margin(self): + """Gets the maintain_margin of this RiskUnits. # noqa: E501 + + Maintenance margin for risk unit # noqa: E501 + + :return: The maintain_margin of this RiskUnits. # noqa: E501 + :rtype: str + """ + return self._maintain_margin + + @maintain_margin.setter + def maintain_margin(self, maintain_margin): + """Sets the maintain_margin of this RiskUnits. + + Maintenance margin for risk unit # noqa: E501 + + :param maintain_margin: The maintain_margin of this RiskUnits. # noqa: E501 + :type: str + """ + + self._maintain_margin = maintain_margin + + @property + def initial_margin(self): + """Gets the initial_margin of this RiskUnits. # noqa: E501 + + Initial margin for risk unit # noqa: E501 + + :return: The initial_margin of this RiskUnits. # noqa: E501 + :rtype: str + """ + return self._initial_margin + + @initial_margin.setter + def initial_margin(self, initial_margin): + """Sets the initial_margin of this RiskUnits. + + Initial margin for risk unit # noqa: E501 + + :param initial_margin: The initial_margin of this RiskUnits. # noqa: E501 + :type: str + """ + + self._initial_margin = initial_margin + + @property + def delta(self): + """Gets the delta of this RiskUnits. # noqa: E501 + + Total Delta of risk unit # noqa: E501 + + :return: The delta of this RiskUnits. # noqa: E501 + :rtype: str + """ + return self._delta + + @delta.setter + def delta(self, delta): + """Sets the delta of this RiskUnits. + + Total Delta of risk unit # noqa: E501 + + :param delta: The delta of this RiskUnits. # noqa: E501 + :type: str + """ + + self._delta = delta + + @property + def gamma(self): + """Gets the gamma of this RiskUnits. # noqa: E501 + + Total Gamma of risk unit # noqa: E501 + + :return: The gamma of this RiskUnits. # noqa: E501 + :rtype: str + """ + return self._gamma + + @gamma.setter + def gamma(self, gamma): + """Sets the gamma of this RiskUnits. + + Total Gamma of risk unit # noqa: E501 + + :param gamma: The gamma of this RiskUnits. # noqa: E501 + :type: str + """ + + self._gamma = gamma + + @property + def theta(self): + """Gets the theta of this RiskUnits. # noqa: E501 + + Total Theta of risk unit # noqa: E501 + + :return: The theta of this RiskUnits. # noqa: E501 + :rtype: str + """ + return self._theta + + @theta.setter + def theta(self, theta): + """Sets the theta of this RiskUnits. + + Total Theta of risk unit # noqa: E501 + + :param theta: The theta of this RiskUnits. # noqa: E501 + :type: str + """ + + self._theta = theta + + @property + def vega(self): + """Gets the vega of this RiskUnits. # noqa: E501 + + Total Vega of risk unit # noqa: E501 + + :return: The vega of this RiskUnits. # noqa: E501 + :rtype: str + """ + return self._vega + + @vega.setter + def vega(self, vega): + """Sets the vega of this RiskUnits. + + Total Vega of risk unit # noqa: E501 + + :param vega: The vega of this RiskUnits. # noqa: E501 + :type: str + """ + + self._vega = vega + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, RiskUnits): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, RiskUnits): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/saved_address.py b/gate_api/models/saved_address.py new file mode 100644 index 0000000..d82f14d --- /dev/null +++ b/gate_api/models/saved_address.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 SavedAddress(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'chain': 'str', + 'address': 'str', + 'name': 'str', + 'tag': 'str', + 'verified': 'str' + } + + attribute_map = { + 'currency': 'currency', + 'chain': 'chain', + 'address': 'address', + 'name': 'name', + 'tag': 'tag', + 'verified': 'verified' + } + + def __init__(self, currency=None, chain=None, address=None, name=None, tag=None, verified=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, Configuration) -> None + """SavedAddress - a 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._chain = None + self._address = None + self._name = None + self._tag = None + self._verified = None + self.discriminator = None + + if currency is not None: + self.currency = currency + if chain is not None: + self.chain = chain + if address is not None: + self.address = address + if name is not None: + self.name = name + if tag is not None: + self.tag = tag + if verified is not None: + self.verified = verified + + @property + def currency(self): + """Gets the currency of this SavedAddress. # noqa: E501 + + Currency # noqa: E501 + + :return: The currency of this SavedAddress. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this SavedAddress. + + Currency # noqa: E501 + + :param currency: The currency of this SavedAddress. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def chain(self): + """Gets the chain of this SavedAddress. # noqa: E501 + + Chain name # noqa: E501 + + :return: The chain of this SavedAddress. # noqa: E501 + :rtype: str + """ + return self._chain + + @chain.setter + def chain(self, chain): + """Sets the chain of this SavedAddress. + + Chain name # noqa: E501 + + :param chain: The chain of this SavedAddress. # noqa: E501 + :type: str + """ + + self._chain = chain + + @property + def address(self): + """Gets the address of this SavedAddress. # noqa: E501 + + Address # noqa: E501 + + :return: The address of this SavedAddress. # noqa: E501 + :rtype: str + """ + return self._address + + @address.setter + def address(self, address): + """Sets the address of this SavedAddress. + + Address # noqa: E501 + + :param address: The address of this SavedAddress. # noqa: E501 + :type: str + """ + + self._address = address + + @property + def name(self): + """Gets the name of this SavedAddress. # noqa: E501 + + Name # noqa: E501 + + :return: The name of this SavedAddress. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this SavedAddress. + + Name # noqa: E501 + + :param name: The name of this SavedAddress. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def tag(self): + """Gets the tag of this SavedAddress. # noqa: E501 + + Tag # noqa: E501 + + :return: The tag of this SavedAddress. # noqa: E501 + :rtype: str + """ + return self._tag + + @tag.setter + def tag(self, tag): + """Sets the tag of this SavedAddress. + + Tag # noqa: E501 + + :param tag: The tag of this SavedAddress. # noqa: E501 + :type: str + """ + + self._tag = tag + + @property + def verified(self): + """Gets the verified of this SavedAddress. # noqa: E501 + + Whether to pass the verification 0-unverified, 1-verified # noqa: E501 + + :return: The verified of this SavedAddress. # noqa: E501 + :rtype: str + """ + return self._verified + + @verified.setter + def verified(self, verified): + """Sets the verified of this SavedAddress. + + Whether to pass the verification 0-unverified, 1-verified # noqa: E501 + + :param verified: The verified of this SavedAddress. # noqa: E501 + :type: str + """ + + self._verified = verified + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SavedAddress): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, SavedAddress): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/small_balance.py b/gate_api/models/small_balance.py new file mode 100644 index 0000000..a31cd14 --- /dev/null +++ b/gate_api/models/small_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 SmallBalance(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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_balance': 'str', + 'estimated_as_btc': 'str', + 'convertible_to_gt': 'str' + } + + attribute_map = { + 'currency': 'currency', + 'available_balance': 'available_balance', + 'estimated_as_btc': 'estimated_as_btc', + 'convertible_to_gt': 'convertible_to_gt' + } + + def __init__(self, currency=None, available_balance=None, estimated_as_btc=None, convertible_to_gt=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, Configuration) -> None + """SmallBalance - a 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_balance = None + self._estimated_as_btc = None + self._convertible_to_gt = None + self.discriminator = None + + if currency is not None: + self.currency = currency + if available_balance is not None: + self.available_balance = available_balance + if estimated_as_btc is not None: + self.estimated_as_btc = estimated_as_btc + if convertible_to_gt is not None: + self.convertible_to_gt = convertible_to_gt + + @property + def currency(self): + """Gets the currency of this SmallBalance. # noqa: E501 + + Currency # noqa: E501 + + :return: The currency of this SmallBalance. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this SmallBalance. + + Currency # noqa: E501 + + :param currency: The currency of this SmallBalance. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def available_balance(self): + """Gets the available_balance of this SmallBalance. # noqa: E501 + + Available balance # noqa: E501 + + :return: The available_balance of this SmallBalance. # noqa: E501 + :rtype: str + """ + return self._available_balance + + @available_balance.setter + def available_balance(self, available_balance): + """Sets the available_balance of this SmallBalance. + + Available balance # noqa: E501 + + :param available_balance: The available_balance of this SmallBalance. # noqa: E501 + :type: str + """ + + self._available_balance = available_balance + + @property + def estimated_as_btc(self): + """Gets the estimated_as_btc of this SmallBalance. # noqa: E501 + + Estimated as BTC # noqa: E501 + + :return: The estimated_as_btc of this SmallBalance. # noqa: E501 + :rtype: str + """ + return self._estimated_as_btc + + @estimated_as_btc.setter + def estimated_as_btc(self, estimated_as_btc): + """Sets the estimated_as_btc of this SmallBalance. + + Estimated as BTC # noqa: E501 + + :param estimated_as_btc: The estimated_as_btc of this SmallBalance. # noqa: E501 + :type: str + """ + + self._estimated_as_btc = estimated_as_btc + + @property + def convertible_to_gt(self): + """Gets the convertible_to_gt of this SmallBalance. # noqa: E501 + + Estimated conversion to GT # noqa: E501 + + :return: The convertible_to_gt of this SmallBalance. # noqa: E501 + :rtype: str + """ + return self._convertible_to_gt + + @convertible_to_gt.setter + def convertible_to_gt(self, convertible_to_gt): + """Sets the convertible_to_gt of this SmallBalance. + + Estimated conversion to GT # noqa: E501 + + :param convertible_to_gt: The convertible_to_gt of this SmallBalance. # noqa: E501 + :type: str + """ + + self._convertible_to_gt = convertible_to_gt + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SmallBalance): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, SmallBalance): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/small_balance_history.py b/gate_api/models/small_balance_history.py new file mode 100644 index 0000000..da3a1d3 --- /dev/null +++ b/gate_api/models/small_balance_history.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 SmallBalanceHistory(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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': 'str', + 'amount': 'str', + 'gt_amount': 'str', + 'create_time': 'int' + } + + attribute_map = { + 'id': 'id', + 'currency': 'currency', + 'amount': 'amount', + 'gt_amount': 'gt_amount', + 'create_time': 'create_time' + } + + def __init__(self, id=None, currency=None, amount=None, gt_amount=None, create_time=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, int, Configuration) -> None + """SmallBalanceHistory - a 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 = None + self._amount = None + self._gt_amount = None + self._create_time = None + self.discriminator = None + + if id is not None: + self.id = id + if currency is not None: + self.currency = currency + if amount is not None: + self.amount = amount + if gt_amount is not None: + self.gt_amount = gt_amount + if create_time is not None: + self.create_time = create_time + + @property + def id(self): + """Gets the id of this SmallBalanceHistory. # noqa: E501 + + Order ID # noqa: E501 + + :return: The id of this SmallBalanceHistory. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this SmallBalanceHistory. + + Order ID # noqa: E501 + + :param id: The id of this SmallBalanceHistory. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def currency(self): + """Gets the currency of this SmallBalanceHistory. # noqa: E501 + + Currency # noqa: E501 + + :return: The currency of this SmallBalanceHistory. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this SmallBalanceHistory. + + Currency # noqa: E501 + + :param currency: The currency of this SmallBalanceHistory. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def amount(self): + """Gets the amount of this SmallBalanceHistory. # noqa: E501 + + Swap Amount # noqa: E501 + + :return: The amount of this SmallBalanceHistory. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this SmallBalanceHistory. + + Swap Amount # noqa: E501 + + :param amount: The amount of this SmallBalanceHistory. # noqa: E501 + :type: str + """ + + self._amount = amount + + @property + def gt_amount(self): + """Gets the gt_amount of this SmallBalanceHistory. # noqa: E501 + + GT amount # noqa: E501 + + :return: The gt_amount of this SmallBalanceHistory. # noqa: E501 + :rtype: str + """ + return self._gt_amount + + @gt_amount.setter + def gt_amount(self, gt_amount): + """Sets the gt_amount of this SmallBalanceHistory. + + GT amount # noqa: E501 + + :param gt_amount: The gt_amount of this SmallBalanceHistory. # noqa: E501 + :type: str + """ + + self._gt_amount = gt_amount + + @property + def create_time(self): + """Gets the create_time of this SmallBalanceHistory. # noqa: E501 + + Exchange time (in seconds) # noqa: E501 + + :return: The create_time of this SmallBalanceHistory. # noqa: E501 + :rtype: int + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this SmallBalanceHistory. + + Exchange time (in seconds) # noqa: E501 + + :param create_time: The create_time of this SmallBalanceHistory. # 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, SmallBalanceHistory): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, SmallBalanceHistory): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/spot_account.py b/gate_api/models/spot_account.py index 8d3ec33..e4f1aba 100644 --- a/gate_api/models/spot_account.py +++ b/gate_api/models/spot_account.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -32,12 +32,22 @@ class SpotAccount(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {'currency': 'str', 'available': 'str', 'locked': 'str'} - - attribute_map = {'currency': 'currency', 'available': 'available', 'locked': 'locked'} - - def __init__(self, currency=None, available=None, locked=None, local_vars_configuration=None): # noqa: E501 - # type: (str, str, str, Configuration) -> None + openapi_types = { + 'currency': 'str', + 'available': 'str', + 'locked': 'str', + 'update_id': 'int' + } + + attribute_map = { + 'currency': 'currency', + 'available': 'available', + 'locked': 'locked', + 'update_id': 'update_id' + } + + 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 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -46,6 +56,7 @@ def __init__(self, currency=None, available=None, locked=None, local_vars_config self._currency = None self._available = None self._locked = None + self._update_id = None self.discriminator = None if currency is not None: @@ -54,6 +65,8 @@ def __init__(self, currency=None, available=None, locked=None, local_vars_config self.available = available if locked is not None: self.locked = locked + if update_id is not None: + self.update_id = update_id @property def currency(self): @@ -124,6 +137,29 @@ def locked(self, locked): 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 + def to_dict(self): """Returns the model properties as a dict""" result = {} @@ -131,16 +167,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/spot_account_book.py b/gate_api/models/spot_account_book.py new file mode 100644 index 0000000..081b281 --- /dev/null +++ b/gate_api/models/spot_account_book.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 SpotAccountBook(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'time': 'int', + 'currency': 'str', + 'change': 'str', + 'balance': 'str', + 'type': 'str', + 'code': 'str', + 'text': 'str' + } + + attribute_map = { + 'id': 'id', + 'time': 'time', + 'currency': 'currency', + 'change': 'change', + 'balance': 'balance', + 'type': 'type', + 'code': 'code', + 'text': 'text' + } + + def __init__(self, id=None, time=None, currency=None, change=None, balance=None, type=None, code=None, text=None, local_vars_configuration=None): # noqa: E501 + # type: (str, int, str, str, str, str, str, str, Configuration) -> None + """SpotAccountBook - a 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._type = None + self._code = None + self._text = 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 + if type is not None: + self.type = type + if code is not None: + self.code = code + if text is not None: + self.text = text + + @property + def id(self): + """Gets the id of this SpotAccountBook. # noqa: E501 + + Balance change record ID # noqa: E501 + + :return: The id of this SpotAccountBook. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this SpotAccountBook. + + Balance change record ID # noqa: E501 + + :param id: The id of this SpotAccountBook. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def time(self): + """Gets the time of this SpotAccountBook. # noqa: E501 + + The timestamp of the change (in milliseconds) # noqa: E501 + + :return: The time of this SpotAccountBook. # noqa: E501 + :rtype: int + """ + return self._time + + @time.setter + def time(self, time): + """Sets the time of this SpotAccountBook. + + The timestamp of the change (in milliseconds) # noqa: E501 + + :param time: The time of this SpotAccountBook. # noqa: E501 + :type: int + """ + + self._time = time + + @property + def currency(self): + """Gets the currency of this SpotAccountBook. # noqa: E501 + + Currency changed # noqa: E501 + + :return: The currency of this SpotAccountBook. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this SpotAccountBook. + + Currency changed # noqa: E501 + + :param currency: The currency of this SpotAccountBook. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def change(self): + """Gets the change of this SpotAccountBook. # noqa: E501 + + Amount changed. Positive value means transferring in, while negative out # noqa: E501 + + :return: The change of this SpotAccountBook. # noqa: E501 + :rtype: str + """ + return self._change + + @change.setter + def change(self, change): + """Sets the change of this SpotAccountBook. + + Amount changed. Positive value means transferring in, while negative out # noqa: E501 + + :param change: The change of this SpotAccountBook. # noqa: E501 + :type: str + """ + + self._change = change + + @property + def balance(self): + """Gets the balance of this SpotAccountBook. # noqa: E501 + + Balance after change # noqa: E501 + + :return: The balance of this SpotAccountBook. # noqa: E501 + :rtype: str + """ + return self._balance + + @balance.setter + def balance(self, balance): + """Sets the balance of this SpotAccountBook. + + Balance after change # noqa: E501 + + :param balance: The balance of this SpotAccountBook. # noqa: E501 + :type: str + """ + + self._balance = balance + + @property + 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 + + :return: The type of this SpotAccountBook. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + 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 + + :param type: The type of this SpotAccountBook. # noqa: E501 + :type: str + """ + + self._type = type + + @property + def code(self): + """Gets the code of this SpotAccountBook. # noqa: E501 + + Account change code, see [Asset Record Code] (Asset Record Code) # noqa: E501 + + :return: The code of this SpotAccountBook. # noqa: E501 + :rtype: str + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this SpotAccountBook. + + Account change code, see [Asset Record Code] (Asset Record Code) # noqa: E501 + + :param code: The code of this SpotAccountBook. # noqa: E501 + :type: str + """ + + self._code = code + + @property + def text(self): + """Gets the text of this SpotAccountBook. # noqa: E501 + + Additional information # noqa: E501 + + :return: The text of this SpotAccountBook. # noqa: E501 + :rtype: str + """ + return self._text + + @text.setter + def text(self, text): + """Sets the text of this SpotAccountBook. + + Additional information # noqa: E501 + + :param text: The text of this SpotAccountBook. # 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, SpotAccountBook): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, SpotAccountBook): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/spot_currency_chain.py b/gate_api/models/spot_currency_chain.py new file mode 100644 index 0000000..7dc9a48 --- /dev/null +++ b/gate_api/models/spot_currency_chain.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 SpotCurrencyChain(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'addr': 'str', + 'withdraw_disabled': 'bool', + 'withdraw_delayed': 'bool', + 'deposit_disabled': 'bool' + } + + attribute_map = { + 'name': 'name', + 'addr': 'addr', + 'withdraw_disabled': 'withdraw_disabled', + 'withdraw_delayed': 'withdraw_delayed', + 'deposit_disabled': 'deposit_disabled' + } + + def __init__(self, name=None, addr=None, withdraw_disabled=None, withdraw_delayed=None, deposit_disabled=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, bool, bool, bool, Configuration) -> None + """SpotCurrencyChain - a 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._addr = None + self._withdraw_disabled = None + self._withdraw_delayed = None + self._deposit_disabled = None + self.discriminator = None + + if name is not None: + self.name = name + if addr is not None: + self.addr = addr + if withdraw_disabled is not None: + self.withdraw_disabled = withdraw_disabled + if withdraw_delayed is not None: + self.withdraw_delayed = withdraw_delayed + if deposit_disabled is not None: + self.deposit_disabled = deposit_disabled + + @property + def name(self): + """Gets the name of this SpotCurrencyChain. # noqa: E501 + + Blockchain name # noqa: E501 + + :return: The name of this SpotCurrencyChain. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this SpotCurrencyChain. + + Blockchain name # noqa: E501 + + :param name: The name of this SpotCurrencyChain. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def addr(self): + """Gets the addr of this SpotCurrencyChain. # noqa: E501 + + token address # noqa: E501 + + :return: The addr of this SpotCurrencyChain. # noqa: E501 + :rtype: str + """ + return self._addr + + @addr.setter + def addr(self, addr): + """Sets the addr of this SpotCurrencyChain. + + token address # noqa: E501 + + :param addr: The addr of this SpotCurrencyChain. # noqa: E501 + :type: str + """ + + self._addr = addr + + @property + def withdraw_disabled(self): + """Gets the withdraw_disabled of this SpotCurrencyChain. # noqa: E501 + + Whether currency's withdrawal is disabled # noqa: E501 + + :return: The withdraw_disabled of this SpotCurrencyChain. # noqa: E501 + :rtype: bool + """ + return self._withdraw_disabled + + @withdraw_disabled.setter + def withdraw_disabled(self, withdraw_disabled): + """Sets the withdraw_disabled of this SpotCurrencyChain. + + Whether currency's withdrawal is disabled # noqa: E501 + + :param withdraw_disabled: The withdraw_disabled of this SpotCurrencyChain. # noqa: E501 + :type: bool + """ + + self._withdraw_disabled = withdraw_disabled + + @property + def withdraw_delayed(self): + """Gets the withdraw_delayed of this SpotCurrencyChain. # noqa: E501 + + Whether currency's withdrawal is delayed # noqa: E501 + + :return: The withdraw_delayed of this SpotCurrencyChain. # noqa: E501 + :rtype: bool + """ + return self._withdraw_delayed + + @withdraw_delayed.setter + def withdraw_delayed(self, withdraw_delayed): + """Sets the withdraw_delayed of this SpotCurrencyChain. + + Whether currency's withdrawal is delayed # noqa: E501 + + :param withdraw_delayed: The withdraw_delayed of this SpotCurrencyChain. # noqa: E501 + :type: bool + """ + + self._withdraw_delayed = withdraw_delayed + + @property + def deposit_disabled(self): + """Gets the deposit_disabled of this SpotCurrencyChain. # noqa: E501 + + Whether currency's deposit is disabled # noqa: E501 + + :return: The deposit_disabled of this SpotCurrencyChain. # noqa: E501 + :rtype: bool + """ + return self._deposit_disabled + + @deposit_disabled.setter + def deposit_disabled(self, deposit_disabled): + """Sets the deposit_disabled of this SpotCurrencyChain. + + Whether currency's deposit is disabled # noqa: E501 + + :param deposit_disabled: The deposit_disabled of this SpotCurrencyChain. # noqa: E501 + :type: bool + """ + + self._deposit_disabled = deposit_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, SpotCurrencyChain): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, SpotCurrencyChain): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/spot_fee.py b/gate_api/models/spot_fee.py new file mode 100644 index 0000000..0d5327c --- /dev/null +++ b/gate_api/models/spot_fee.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 SpotFee(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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': 'int', + 'taker_fee': 'str', + 'maker_fee': 'str', + 'gt_discount': 'bool', + 'gt_taker_fee': 'str', + 'gt_maker_fee': 'str', + 'loan_fee': 'str', + 'point_type': 'str', + 'currency_pair': 'str', + 'debit_fee': 'int' + } + + attribute_map = { + 'user_id': 'user_id', + 'taker_fee': 'taker_fee', + 'maker_fee': 'maker_fee', + 'gt_discount': 'gt_discount', + 'gt_taker_fee': 'gt_taker_fee', + 'gt_maker_fee': 'gt_maker_fee', + 'loan_fee': 'loan_fee', + 'point_type': 'point_type', + 'currency_pair': 'currency_pair', + 'debit_fee': 'debit_fee' + } + + def __init__(self, user_id=None, taker_fee=None, maker_fee=None, gt_discount=None, gt_taker_fee=None, gt_maker_fee=None, loan_fee=None, point_type=None, currency_pair=None, debit_fee=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, str, bool, str, str, str, str, str, int, Configuration) -> None + """SpotFee - a 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._taker_fee = None + self._maker_fee = None + self._gt_discount = None + self._gt_taker_fee = None + self._gt_maker_fee = None + self._loan_fee = None + self._point_type = None + self._currency_pair = None + self._debit_fee = None + self.discriminator = None + + if user_id is not None: + self.user_id = user_id + if taker_fee is not None: + self.taker_fee = taker_fee + if maker_fee is not None: + self.maker_fee = maker_fee + if gt_discount is not None: + self.gt_discount = gt_discount + if gt_taker_fee is not None: + self.gt_taker_fee = gt_taker_fee + if gt_maker_fee is not None: + self.gt_maker_fee = gt_maker_fee + if loan_fee is not None: + self.loan_fee = loan_fee + if point_type is not None: + self.point_type = point_type + if currency_pair is not None: + self.currency_pair = currency_pair + if debit_fee is not None: + self.debit_fee = debit_fee + + @property + def user_id(self): + """Gets the user_id of this SpotFee. # noqa: E501 + + User ID # noqa: E501 + + :return: The user_id of this SpotFee. # noqa: E501 + :rtype: int + """ + return self._user_id + + @user_id.setter + def user_id(self, user_id): + """Sets the user_id of this SpotFee. + + User ID # noqa: E501 + + :param user_id: The user_id of this SpotFee. # noqa: E501 + :type: int + """ + + self._user_id = user_id + + @property + def taker_fee(self): + """Gets the taker_fee of this SpotFee. # noqa: E501 + + taker fee rate # noqa: E501 + + :return: The taker_fee of this SpotFee. # noqa: E501 + :rtype: str + """ + return self._taker_fee + + @taker_fee.setter + def taker_fee(self, taker_fee): + """Sets the taker_fee of this SpotFee. + + taker fee rate # noqa: E501 + + :param taker_fee: The taker_fee of this SpotFee. # noqa: E501 + :type: str + """ + + self._taker_fee = taker_fee + + @property + def maker_fee(self): + """Gets the maker_fee of this SpotFee. # noqa: E501 + + maker fee rate # noqa: E501 + + :return: The maker_fee of this SpotFee. # noqa: E501 + :rtype: str + """ + return self._maker_fee + + @maker_fee.setter + def maker_fee(self, maker_fee): + """Sets the maker_fee of this SpotFee. + + maker fee rate # noqa: E501 + + :param maker_fee: The maker_fee of this SpotFee. # noqa: E501 + :type: str + """ + + self._maker_fee = maker_fee + + @property + def gt_discount(self): + """Gets the gt_discount of this SpotFee. # noqa: E501 + + Whether GT deduction discount is enabled # noqa: E501 + + :return: The gt_discount of this SpotFee. # noqa: E501 + :rtype: bool + """ + return self._gt_discount + + @gt_discount.setter + def gt_discount(self, gt_discount): + """Sets the gt_discount of this SpotFee. + + Whether GT deduction discount is enabled # noqa: E501 + + :param gt_discount: The gt_discount of this SpotFee. # noqa: E501 + :type: bool + """ + + self._gt_discount = gt_discount + + @property + def gt_taker_fee(self): + """Gets the gt_taker_fee of this SpotFee. # noqa: E501 + + Taker fee rate if using GT deduction. It will be 0 if GT deduction is disabled # noqa: E501 + + :return: The gt_taker_fee of this SpotFee. # noqa: E501 + :rtype: str + """ + return self._gt_taker_fee + + @gt_taker_fee.setter + def gt_taker_fee(self, gt_taker_fee): + """Sets the gt_taker_fee of this SpotFee. + + Taker fee rate if using GT deduction. It will be 0 if GT deduction is disabled # noqa: E501 + + :param gt_taker_fee: The gt_taker_fee of this SpotFee. # noqa: E501 + :type: str + """ + + self._gt_taker_fee = gt_taker_fee + + @property + def gt_maker_fee(self): + """Gets the gt_maker_fee of this SpotFee. # noqa: E501 + + Maker fee rate with GT deduction. Returns 0 if GT deduction is disabled # noqa: E501 + + :return: The gt_maker_fee of this SpotFee. # noqa: E501 + :rtype: str + """ + return self._gt_maker_fee + + @gt_maker_fee.setter + def gt_maker_fee(self, gt_maker_fee): + """Sets the gt_maker_fee of this SpotFee. + + Maker fee rate with GT deduction. Returns 0 if GT deduction is disabled # noqa: E501 + + :param gt_maker_fee: The gt_maker_fee of this SpotFee. # noqa: E501 + :type: str + """ + + self._gt_maker_fee = gt_maker_fee + + @property + def loan_fee(self): + """Gets the loan_fee of this SpotFee. # noqa: E501 + + Loan fee rate of margin lending # noqa: E501 + + :return: The loan_fee of this SpotFee. # noqa: E501 + :rtype: str + """ + return self._loan_fee + + @loan_fee.setter + def loan_fee(self, loan_fee): + """Sets the loan_fee of this SpotFee. + + Loan fee rate of margin lending # noqa: E501 + + :param loan_fee: The loan_fee of this SpotFee. # noqa: E501 + :type: str + """ + + self._loan_fee = loan_fee + + @property + def point_type(self): + """Gets the point_type of this SpotFee. # noqa: E501 + + Point card type: 0 - Original version, 1 - New version since 202009 # noqa: E501 + + :return: The point_type of this SpotFee. # noqa: E501 + :rtype: str + """ + return self._point_type + + @point_type.setter + def point_type(self, point_type): + """Sets the point_type of this SpotFee. + + Point card type: 0 - Original version, 1 - New version since 202009 # noqa: E501 + + :param point_type: The point_type of this SpotFee. # noqa: E501 + :type: str + """ + + self._point_type = point_type + + @property + def currency_pair(self): + """Gets the currency_pair of this SpotFee. # noqa: E501 + + Currency pair # noqa: E501 + + :return: The currency_pair of this SpotFee. # noqa: E501 + :rtype: str + """ + return self._currency_pair + + @currency_pair.setter + def currency_pair(self, currency_pair): + """Sets the currency_pair of this SpotFee. + + Currency pair # noqa: E501 + + :param currency_pair: The currency_pair of this SpotFee. # noqa: E501 + :type: str + """ + + self._currency_pair = currency_pair + + @property + def debit_fee(self): + """Gets the debit_fee of this SpotFee. # noqa: E501 + + Deduction types for rates, 1 - GT deduction, 2 - Point card deduction, 3 - VIP rates # noqa: E501 + + :return: The debit_fee of this SpotFee. # noqa: E501 + :rtype: int + """ + return self._debit_fee + + @debit_fee.setter + def debit_fee(self, debit_fee): + """Sets the debit_fee of this SpotFee. + + Deduction types for rates, 1 - GT deduction, 2 - Point card deduction, 3 - VIP rates # noqa: E501 + + :param debit_fee: The debit_fee of this SpotFee. # noqa: E501 + :type: int + """ + + self._debit_fee = debit_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, SpotFee): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, SpotFee): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/spot_insurance_history.py b/gate_api/models/spot_insurance_history.py new file mode 100644 index 0000000..249bc6d --- /dev/null +++ b/gate_api/models/spot_insurance_history.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 SpotInsuranceHistory(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'balance': 'str', + 'time': 'int' + } + + attribute_map = { + 'currency': 'currency', + 'balance': 'balance', + 'time': 'time' + } + + def __init__(self, currency=None, balance=None, time=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, int, Configuration) -> None + """SpotInsuranceHistory - a 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._balance = None + self._time = None + self.discriminator = None + + if currency is not None: + self.currency = currency + if balance is not None: + self.balance = balance + if time is not None: + self.time = time + + @property + def currency(self): + """Gets the currency of this SpotInsuranceHistory. # noqa: E501 + + Currency # noqa: E501 + + :return: The currency of this SpotInsuranceHistory. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this SpotInsuranceHistory. + + Currency # noqa: E501 + + :param currency: The currency of this SpotInsuranceHistory. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def balance(self): + """Gets the balance of this SpotInsuranceHistory. # noqa: E501 + + Balance # noqa: E501 + + :return: The balance of this SpotInsuranceHistory. # noqa: E501 + :rtype: str + """ + return self._balance + + @balance.setter + def balance(self, balance): + """Sets the balance of this SpotInsuranceHistory. + + Balance # noqa: E501 + + :param balance: The balance of this SpotInsuranceHistory. # noqa: E501 + :type: str + """ + + self._balance = balance + + @property + def time(self): + """Gets the time of this SpotInsuranceHistory. # noqa: E501 + + Creation time, timestamp, milliseconds # noqa: E501 + + :return: The time of this SpotInsuranceHistory. # noqa: E501 + :rtype: int + """ + return self._time + + @time.setter + def time(self, time): + """Sets the time of this SpotInsuranceHistory. + + Creation time, timestamp, milliseconds # noqa: E501 + + :param time: The time of this SpotInsuranceHistory. # 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, SpotInsuranceHistory): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, SpotInsuranceHistory): + 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 99f2aa0..72cfa78 100644 --- a/gate_api/models/spot_price_put_order.py +++ b/gate_api/models/spot_price_put_order.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -39,6 +39,9 @@ class SpotPricePutOrder(object): 'amount': 'str', 'account': 'str', 'time_in_force': 'str', + 'auto_borrow': 'bool', + 'auto_repay': 'bool', + 'text': 'str' } attribute_map = { @@ -48,19 +51,13 @@ class SpotPricePutOrder(object): 'amount': 'amount', 'account': 'account', 'time_in_force': 'time_in_force', + 'auto_borrow': 'auto_borrow', + 'auto_repay': 'auto_repay', + 'text': 'text' } - def __init__( - self, - type='limit', - side=None, - price=None, - amount=None, - account='normal', - time_in_force='gtc', - local_vars_configuration=None, - ): # noqa: E501 - # type: (str, str, str, str, str, str, Configuration) -> None + def __init__(self, type='limit', side=None, price=None, amount=None, account='normal', time_in_force='gtc', auto_borrow=False, auto_repay=False, text=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, bool, bool, str, Configuration) -> None """SpotPricePutOrder - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -72,6 +69,9 @@ def __init__( self._amount = None self._account = None self._time_in_force = None + self._auto_borrow = None + self._auto_repay = None + self._text = None self.discriminator = None if type is not None: @@ -82,12 +82,18 @@ def __init__( self.account = account if time_in_force is not None: self.time_in_force = time_in_force + if auto_borrow is not None: + self.auto_borrow = auto_borrow + if auto_repay is not None: + self.auto_repay = auto_repay + if text is not None: + self.text = text @property def type(self): """Gets the type of this SpotPricePutOrder. # noqa: E501 - Order type, default to `limit` # noqa: E501 + Order type,default to `limit` - limit : Limit Order - market : Market Order # noqa: E501 :return: The type of this SpotPricePutOrder. # noqa: E501 :rtype: str @@ -98,11 +104,17 @@ def type(self): def type(self, type): """Sets the type of this SpotPricePutOrder. - Order type, default to `limit` # noqa: E501 + Order type,default to `limit` - limit : Limit Order - market : Market Order # noqa: E501 :param type: The type of this SpotPricePutOrder. # 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 @@ -131,7 +143,8 @@ def side(self, side): 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}".format(side, allowed_values) # noqa: E501 + "Invalid value for `side` ({0}), must be one of {1}" # noqa: E501 + .format(side, allowed_values) ) self._side = side @@ -165,7 +178,7 @@ def price(self, price): def amount(self): """Gets the amount of this SpotPricePutOrder. # noqa: E501 - Order amount # 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 :return: The amount of this SpotPricePutOrder. # noqa: E501 :rtype: str @@ -176,7 +189,7 @@ def amount(self): def amount(self, amount): """Sets the amount of this SpotPricePutOrder. - Order amount # 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 :param amount: The amount of this SpotPricePutOrder. # noqa: E501 :type: str @@ -190,7 +203,7 @@ def amount(self, amount): def account(self): """Gets the account of this SpotPricePutOrder. # noqa: E501 - Trading type - normal: spot trading - margin: margin trading # noqa: E501 + Trading account type. Unified account must be set to `unified` - normal: spot trading - margin: margin trading - unified: unified account # noqa: E501 :return: The account of this SpotPricePutOrder. # noqa: E501 :rtype: str @@ -201,17 +214,18 @@ def account(self): def account(self, account): """Sets the account of this SpotPricePutOrder. - Trading type - normal: spot trading - margin: margin trading # noqa: E501 + Trading account type. Unified account must be set to `unified` - normal: spot trading - margin: margin trading - unified: unified account # noqa: E501 :param account: The account of this SpotPricePutOrder. # noqa: E501 :type: str """ if self.local_vars_configuration.client_side_validation and account is None: # noqa: E501 raise ValueError("Invalid value for `account`, must not be `None`") # noqa: E501 - allowed_values = ["normal", "margin"] # noqa: E501 + allowed_values = ["normal", "margin", "unified"] # noqa: E501 if self.local_vars_configuration.client_side_validation and account not in allowed_values: # noqa: E501 raise ValueError( - "Invalid value for `account` ({0}), must be one of {1}".format(account, allowed_values) # noqa: E501 + "Invalid value for `account` ({0}), must be one of {1}" # noqa: E501 + .format(account, allowed_values) ) self._account = account @@ -239,13 +253,81 @@ def time_in_force(self, time_in_force): 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( - "Invalid value for `time_in_force` ({0}), must be one of {1}".format( # noqa: E501 - time_in_force, allowed_values - ) + "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 auto_borrow(self): + """Gets the auto_borrow of this SpotPricePutOrder. # noqa: E501 + + Whether to borrow coins automatically # noqa: E501 + + :return: The auto_borrow of this SpotPricePutOrder. # noqa: E501 + :rtype: bool + """ + return self._auto_borrow + + @auto_borrow.setter + def auto_borrow(self, auto_borrow): + """Sets the auto_borrow of this SpotPricePutOrder. + + Whether to borrow coins automatically # noqa: E501 + + :param auto_borrow: The auto_borrow of this SpotPricePutOrder. # noqa: E501 + :type: bool + """ + + self._auto_borrow = auto_borrow + + @property + def auto_repay(self): + """Gets the auto_repay of this SpotPricePutOrder. # noqa: E501 + + Whether to repay the loan automatically # noqa: E501 + + :return: The auto_repay of this SpotPricePutOrder. # noqa: E501 + :rtype: bool + """ + return self._auto_repay + + @auto_repay.setter + def auto_repay(self, auto_repay): + """Sets the auto_repay of this SpotPricePutOrder. + + Whether to repay the loan automatically # noqa: E501 + + :param auto_repay: The auto_repay of this SpotPricePutOrder. # noqa: E501 + :type: bool + """ + + self._auto_repay = auto_repay + + @property + def text(self): + """Gets the text of this SpotPricePutOrder. # noqa: E501 + + The source of the order, including: - web: Web - api: API call - app: Mobile app # noqa: E501 + + :return: The text of this SpotPricePutOrder. # noqa: E501 + :rtype: str + """ + return self._text + + @text.setter + def text(self, text): + """Sets the text of this SpotPricePutOrder. + + The source of the order, including: - web: Web - api: API call - app: Mobile app # noqa: E501 + + :param text: The text of this SpotPricePutOrder. # noqa: E501 + :type: str + """ + + self._text = text + def to_dict(self): """Returns the model properties as a dict""" result = {} @@ -253,16 +335,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/spot_price_trigger.py b/gate_api/models/spot_price_trigger.py index 7fd8c54..5e49da6 100644 --- a/gate_api/models/spot_price_trigger.py +++ b/gate_api/models/spot_price_trigger.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -32,9 +32,17 @@ class SpotPriceTrigger(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {'price': 'str', 'rule': 'str', 'expiration': 'int'} - - attribute_map = {'price': 'price', 'rule': 'rule', 'expiration': 'expiration'} + openapi_types = { + 'price': 'str', + 'rule': 'str', + 'expiration': 'int' + } + + attribute_map = { + 'price': 'price', + 'rule': 'rule', + 'expiration': 'expiration' + } def __init__(self, price=None, rule=None, expiration=None, local_vars_configuration=None): # noqa: E501 # type: (str, str, int, Configuration) -> None @@ -81,7 +89,7 @@ def price(self, price): def rule(self): """Gets the rule of this SpotPriceTrigger. # noqa: E501 - Price trigger condition - >=: triggered when market price larger than or equal to `price` field - <=: triggered when market price less than or equal to `price` field # noqa: E501 + 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` # noqa: E501 :return: The rule of this SpotPriceTrigger. # noqa: E501 :rtype: str @@ -92,7 +100,7 @@ def rule(self): def rule(self, rule): """Sets the rule of this SpotPriceTrigger. - Price trigger condition - >=: triggered when market price larger than or equal to `price` field - <=: triggered when market price less than or equal to `price` field # noqa: E501 + 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` # noqa: E501 :param rule: The rule of this SpotPriceTrigger. # noqa: E501 :type: str @@ -102,7 +110,8 @@ def rule(self, rule): allowed_values = [">=", "<="] # noqa: E501 if self.local_vars_configuration.client_side_validation and rule not in allowed_values: # noqa: E501 raise ValueError( - "Invalid value for `rule` ({0}), must be one of {1}".format(rule, allowed_values) # noqa: E501 + "Invalid value for `rule` ({0}), must be one of {1}" # noqa: E501 + .format(rule, allowed_values) ) self._rule = rule @@ -111,7 +120,7 @@ def rule(self, rule): def expiration(self): """Gets the expiration of this SpotPriceTrigger. # noqa: E501 - How long (in seconds) to wait for the condition to be triggered before cancelling the order. # noqa: E501 + Maximum wait time for trigger condition (in seconds). Order will be cancelled if timeout # noqa: E501 :return: The expiration of this SpotPriceTrigger. # noqa: E501 :rtype: int @@ -122,7 +131,7 @@ def expiration(self): def expiration(self, expiration): """Sets the expiration of this SpotPriceTrigger. - How long (in seconds) to wait for the condition to be triggered before cancelling the order. # noqa: E501 + Maximum wait time for trigger condition (in seconds). Order will be cancelled if timeout # noqa: E501 :param expiration: The expiration of this SpotPriceTrigger. # noqa: E501 :type: int @@ -139,16 +148,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/spot_price_triggered_order.py b/gate_api/models/spot_price_triggered_order.py index 0b63129..69e14df 100644 --- a/gate_api/models/spot_price_triggered_order.py +++ b/gate_api/models/spot_price_triggered_order.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -42,7 +42,7 @@ class SpotPriceTriggeredOrder(object): 'ftime': 'int', 'fired_order_id': 'int', 'status': 'str', - 'reason': 'str', + 'reason': 'str' } attribute_map = { @@ -55,23 +55,10 @@ class SpotPriceTriggeredOrder(object): 'ftime': 'ftime', 'fired_order_id': 'fired_order_id', 'status': 'status', - 'reason': 'reason', + 'reason': 'reason' } - def __init__( - self, - trigger=None, - put=None, - id=None, - user=None, - market=None, - ctime=None, - ftime=None, - fired_order_id=None, - status=None, - reason=None, - local_vars_configuration=None, - ): # noqa: E501 + def __init__(self, trigger=None, put=None, id=None, user=None, market=None, ctime=None, ftime=None, fired_order_id=None, status=None, reason=None, local_vars_configuration=None): # noqa: E501 # type: (SpotPriceTrigger, SpotPricePutOrder, int, int, str, int, int, int, str, str, Configuration) -> None """SpotPriceTriggeredOrder - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: @@ -204,7 +191,7 @@ def user(self, user): def market(self): """Gets the market of this SpotPriceTriggeredOrder. # noqa: E501 - Currency pair # noqa: E501 + Market # noqa: E501 :return: The market of this SpotPriceTriggeredOrder. # noqa: E501 :rtype: str @@ -215,7 +202,7 @@ def market(self): def market(self, market): """Sets the market of this SpotPriceTriggeredOrder. - Currency pair # noqa: E501 + Market # noqa: E501 :param market: The market of this SpotPriceTriggeredOrder. # noqa: E501 :type: str @@ -229,7 +216,7 @@ def market(self, market): def ctime(self): """Gets the ctime of this SpotPriceTriggeredOrder. # noqa: E501 - Creation time # noqa: E501 + Created time # noqa: E501 :return: The ctime of this SpotPriceTriggeredOrder. # noqa: E501 :rtype: int @@ -240,7 +227,7 @@ def ctime(self): def ctime(self, ctime): """Sets the ctime of this SpotPriceTriggeredOrder. - Creation time # noqa: E501 + Created time # noqa: E501 :param ctime: The ctime of this SpotPriceTriggeredOrder. # noqa: E501 :type: int @@ -252,7 +239,7 @@ def ctime(self, ctime): def ftime(self): """Gets the ftime of this SpotPriceTriggeredOrder. # noqa: E501 - Finished time # noqa: E501 + End time # noqa: E501 :return: The ftime of this SpotPriceTriggeredOrder. # noqa: E501 :rtype: int @@ -263,7 +250,7 @@ def ftime(self): def ftime(self, ftime): """Sets the ftime of this SpotPriceTriggeredOrder. - Finished time # noqa: E501 + End time # noqa: E501 :param ftime: The ftime of this SpotPriceTriggeredOrder. # noqa: E501 :type: int @@ -275,7 +262,7 @@ def ftime(self, ftime): def fired_order_id(self): """Gets the fired_order_id of this SpotPriceTriggeredOrder. # noqa: E501 - ID of the newly created order on condition triggered # noqa: E501 + ID of the order created after trigger # noqa: E501 :return: The fired_order_id of this SpotPriceTriggeredOrder. # noqa: E501 :rtype: int @@ -286,7 +273,7 @@ def fired_order_id(self): def fired_order_id(self, fired_order_id): """Sets the fired_order_id of this SpotPriceTriggeredOrder. - ID of the newly created order on condition triggered # noqa: E501 + ID of the order created after trigger # noqa: E501 :param fired_order_id: The fired_order_id of this SpotPriceTriggeredOrder. # noqa: E501 :type: int @@ -298,7 +285,7 @@ def fired_order_id(self, fired_order_id): def status(self): """Gets the status of this SpotPriceTriggeredOrder. # noqa: E501 - Status - open: open - cancelled: being manually cancelled - finish: successfully executed - failed: failed to execute - expired - expired # noqa: E501 + Status - open: Running - cancelled: Manually cancelled - finish: Successfully completed - failed: Failed to execute - expired: Expired # noqa: E501 :return: The status of this SpotPriceTriggeredOrder. # noqa: E501 :rtype: str @@ -309,7 +296,7 @@ def status(self): def status(self, status): """Sets the status of this SpotPriceTriggeredOrder. - Status - open: open - cancelled: being manually cancelled - finish: successfully executed - failed: failed to execute - expired - expired # noqa: E501 + Status - open: Running - cancelled: Manually cancelled - finish: Successfully completed - failed: Failed to execute - expired: Expired # noqa: E501 :param status: The status of this SpotPriceTriggeredOrder. # noqa: E501 :type: str @@ -321,7 +308,7 @@ def status(self, status): def reason(self): """Gets the reason of this SpotPriceTriggeredOrder. # noqa: E501 - Additional remarks on how the order was finished # noqa: E501 + Additional description of how the order was completed # noqa: E501 :return: The reason of this SpotPriceTriggeredOrder. # noqa: E501 :rtype: str @@ -332,7 +319,7 @@ def reason(self): def reason(self, reason): """Sets the reason of this SpotPriceTriggeredOrder. - Additional remarks on how the order was finished # noqa: E501 + Additional description of how the order was completed # noqa: E501 :param reason: The reason of this SpotPriceTriggeredOrder. # noqa: E501 :type: str @@ -347,16 +334,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/stp_group.py b/gate_api/models/stp_group.py new file mode 100644 index 0000000..52ba304 --- /dev/null +++ b/gate_api/models/stp_group.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 StpGroup(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'creator_id': 'int', + 'create_time': 'int' + } + + attribute_map = { + 'id': 'id', + 'name': 'name', + 'creator_id': 'creator_id', + 'create_time': 'create_time' + } + + def __init__(self, id=None, name=None, creator_id=None, create_time=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, int, int, Configuration) -> None + """StpGroup - a 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._creator_id = None + self._create_time = None + self.discriminator = None + + if id is not None: + self.id = id + self.name = name + if creator_id is not None: + self.creator_id = creator_id + if create_time is not None: + self.create_time = create_time + + @property + def id(self): + """Gets the id of this StpGroup. # noqa: E501 + + STP Group ID # noqa: E501 + + :return: The id of this StpGroup. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this StpGroup. + + STP Group ID # noqa: E501 + + :param id: The id of this StpGroup. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def name(self): + """Gets the name of this StpGroup. # noqa: E501 + + STP Group name # noqa: E501 + + :return: The name of this StpGroup. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this StpGroup. + + STP Group name # noqa: E501 + + :param name: The name of this StpGroup. # 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 creator_id(self): + """Gets the creator_id of this StpGroup. # noqa: E501 + + Creator ID # noqa: E501 + + :return: The creator_id of this StpGroup. # noqa: E501 + :rtype: int + """ + return self._creator_id + + @creator_id.setter + def creator_id(self, creator_id): + """Sets the creator_id of this StpGroup. + + Creator ID # noqa: E501 + + :param creator_id: The creator_id of this StpGroup. # noqa: E501 + :type: int + """ + + self._creator_id = creator_id + + @property + def create_time(self): + """Gets the create_time of this StpGroup. # noqa: E501 + + Created time # noqa: E501 + + :return: The create_time of this StpGroup. # noqa: E501 + :rtype: int + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this StpGroup. + + Created time # noqa: E501 + + :param create_time: The create_time of this StpGroup. # 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, StpGroup): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, StpGroup): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/stp_group_user.py b/gate_api/models/stp_group_user.py new file mode 100644 index 0000000..e6584f3 --- /dev/null +++ b/gate_api/models/stp_group_user.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 StpGroupUser(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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': 'int', + 'stp_id': 'int', + 'create_time': 'int' + } + + attribute_map = { + 'user_id': 'user_id', + 'stp_id': 'stp_id', + 'create_time': 'create_time' + } + + def __init__(self, user_id=None, stp_id=None, create_time=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, int, Configuration) -> None + """StpGroupUser - a 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._stp_id = None + self._create_time = None + self.discriminator = None + + if user_id is not None: + self.user_id = user_id + if stp_id is not None: + self.stp_id = stp_id + if create_time is not None: + self.create_time = create_time + + @property + def user_id(self): + """Gets the user_id of this StpGroupUser. # noqa: E501 + + User ID # noqa: E501 + + :return: The user_id of this StpGroupUser. # noqa: E501 + :rtype: int + """ + return self._user_id + + @user_id.setter + def user_id(self, user_id): + """Sets the user_id of this StpGroupUser. + + User ID # noqa: E501 + + :param user_id: The user_id of this StpGroupUser. # noqa: E501 + :type: int + """ + + self._user_id = user_id + + @property + def stp_id(self): + """Gets the stp_id of this StpGroupUser. # noqa: E501 + + STP Group ID # noqa: E501 + + :return: The stp_id of this StpGroupUser. # noqa: E501 + :rtype: int + """ + return self._stp_id + + @stp_id.setter + def stp_id(self, stp_id): + """Sets the stp_id of this StpGroupUser. + + STP Group ID # noqa: E501 + + :param stp_id: The stp_id of this StpGroupUser. # noqa: E501 + :type: int + """ + + self._stp_id = stp_id + + @property + def create_time(self): + """Gets the create_time of this StpGroupUser. # noqa: E501 + + Created time # noqa: E501 + + :return: The create_time of this StpGroupUser. # noqa: E501 + :rtype: int + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this StpGroupUser. + + Created time # noqa: E501 + + :param create_time: The create_time of this StpGroupUser. # 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, StpGroupUser): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, StpGroupUser): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/structured_buy.py b/gate_api/models/structured_buy.py new file mode 100644 index 0000000..285adf7 --- /dev/null +++ b/gate_api/models/structured_buy.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 StructuredBuy(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'pid': 'str', + 'amount': 'str' + } + + attribute_map = { + 'pid': 'pid', + 'amount': 'amount' + } + + def __init__(self, pid=None, amount=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """StructuredBuy - a 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.discriminator = None + + if pid is not None: + self.pid = pid + if amount is not None: + self.amount = amount + + @property + def pid(self): + """Gets the pid of this StructuredBuy. # noqa: E501 + + Product ID # noqa: E501 + + :return: The pid of this StructuredBuy. # noqa: E501 + :rtype: str + """ + return self._pid + + @pid.setter + def pid(self, pid): + """Sets the pid of this StructuredBuy. + + Product ID # noqa: E501 + + :param pid: The pid of this StructuredBuy. # noqa: E501 + :type: str + """ + + self._pid = pid + + @property + def amount(self): + """Gets the amount of this StructuredBuy. # noqa: E501 + + Buy Quantity # noqa: E501 + + :return: The amount of this StructuredBuy. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this StructuredBuy. + + Buy Quantity # noqa: E501 + + :param amount: The amount of this StructuredBuy. # noqa: E501 + :type: str + """ + + 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, StructuredBuy): + return 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): + 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 new file mode 100644 index 0000000..664a021 --- /dev/null +++ b/gate_api/models/structured_get_project_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 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 new file mode 100644 index 0000000..4f75222 --- /dev/null +++ b/gate_api/models/structured_order_list.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 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.py b/gate_api/models/sub_account.py new file mode 100644 index 0000000..ad8b79e --- /dev/null +++ b/gate_api/models/sub_account.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 SubAccount(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'remark': 'str', + 'login_name': 'str', + 'password': 'str', + 'email': 'str', + 'state': 'int', + 'type': 'int', + 'user_id': 'int', + 'create_time': 'int' + } + + attribute_map = { + 'remark': 'remark', + 'login_name': 'login_name', + 'password': 'password', + 'email': 'email', + 'state': 'state', + 'type': 'type', + 'user_id': 'user_id', + 'create_time': 'create_time' + } + + def __init__(self, remark=None, login_name=None, password=None, email=None, state=None, type=None, user_id=None, create_time=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, int, int, int, int, Configuration) -> None + """SubAccount - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._remark = None + self._login_name = None + self._password = None + self._email = None + self._state = None + self._type = None + self._user_id = None + self._create_time = None + self.discriminator = None + + if remark is not None: + self.remark = remark + self.login_name = login_name + if password is not None: + self.password = password + if email is not None: + self.email = email + if state is not None: + self.state = state + if type is not None: + self.type = type + if user_id is not None: + self.user_id = user_id + if create_time is not None: + self.create_time = create_time + + @property + def remark(self): + """Gets the remark of this SubAccount. # noqa: E501 + + Remark # noqa: E501 + + :return: The remark of this SubAccount. # noqa: E501 + :rtype: str + """ + return self._remark + + @remark.setter + def remark(self, remark): + """Sets the remark of this SubAccount. + + Remark # noqa: E501 + + :param remark: The remark of this SubAccount. # noqa: E501 + :type: str + """ + + self._remark = remark + + @property + def login_name(self): + """Gets the login_name of this SubAccount. # noqa: E501 + + Sub-account login name: Only letters, numbers and underscores are supported, cannot contain other invalid characters # noqa: E501 + + :return: The login_name of this SubAccount. # noqa: E501 + :rtype: str + """ + return self._login_name + + @login_name.setter + def login_name(self, login_name): + """Sets the login_name of this SubAccount. + + Sub-account login name: Only letters, numbers and underscores are supported, cannot contain other invalid characters # noqa: E501 + + :param login_name: The login_name of this SubAccount. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and login_name is None: # noqa: E501 + raise ValueError("Invalid value for `login_name`, must not be `None`") # noqa: E501 + + self._login_name = login_name + + @property + def password(self): + """Gets the password of this SubAccount. # noqa: E501 + + The sub-account's password. (Default: the same as main account's password) # noqa: E501 + + :return: The password of this SubAccount. # noqa: E501 + :rtype: str + """ + return self._password + + @password.setter + def password(self, password): + """Sets the password of this SubAccount. + + The sub-account's password. (Default: the same as main account's password) # noqa: E501 + + :param password: The password of this SubAccount. # noqa: E501 + :type: str + """ + + self._password = password + + @property + def email(self): + """Gets the email of this SubAccount. # noqa: E501 + + The sub-account's email address. (Default: the same as main account's email address) # noqa: E501 + + :return: The email of this SubAccount. # noqa: E501 + :rtype: str + """ + return self._email + + @email.setter + def email(self, email): + """Sets the email of this SubAccount. + + The sub-account's email address. (Default: the same as main account's email address) # noqa: E501 + + :param email: The email of this SubAccount. # noqa: E501 + :type: str + """ + + self._email = email + + @property + def state(self): + """Gets the state of this SubAccount. # noqa: E501 + + Sub-account status: 1-normal, 2-locked # noqa: E501 + + :return: The state of this SubAccount. # noqa: E501 + :rtype: int + """ + return self._state + + @state.setter + def state(self, state): + """Sets the state of this SubAccount. + + Sub-account status: 1-normal, 2-locked # noqa: E501 + + :param state: The state of this SubAccount. # noqa: E501 + :type: int + """ + + self._state = state + + @property + def type(self): + """Gets the type of this SubAccount. # noqa: E501 + + Sub-account type: 1-Regular sub-account, 3-Cross margin sub-account # noqa: E501 + + :return: The type of this SubAccount. # noqa: E501 + :rtype: int + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this SubAccount. + + Sub-account type: 1-Regular sub-account, 3-Cross margin sub-account # noqa: E501 + + :param type: The type of this SubAccount. # noqa: E501 + :type: int + """ + + self._type = type + + @property + def user_id(self): + """Gets the user_id of this SubAccount. # noqa: E501 + + Sub-account user ID # noqa: E501 + + :return: The user_id of this SubAccount. # noqa: E501 + :rtype: int + """ + return self._user_id + + @user_id.setter + def user_id(self, user_id): + """Sets the user_id of this SubAccount. + + Sub-account user ID # noqa: E501 + + :param user_id: The user_id of this SubAccount. # noqa: E501 + :type: int + """ + + self._user_id = user_id + + @property + def create_time(self): + """Gets the create_time of this SubAccount. # noqa: E501 + + Created time # noqa: E501 + + :return: The create_time of this SubAccount. # noqa: E501 + :rtype: int + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this SubAccount. + + Created time # noqa: E501 + + :param create_time: The create_time of this SubAccount. # 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, SubAccount): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, SubAccount): + 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 0c3c630..7af2fb8 100644 --- a/gate_api/models/sub_account_balance.py +++ b/gate_api/models/sub_account_balance.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -32,9 +32,15 @@ class SubAccountBalance(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {'uid': 'str', 'available': 'dict(str, str)'} + openapi_types = { + 'uid': 'str', + 'available': 'dict(str, str)' + } - attribute_map = {'uid': 'uid', 'available': 'available'} + attribute_map = { + 'uid': 'uid', + 'available': 'available' + } def __init__(self, uid=None, available=None, local_vars_configuration=None): # noqa: E501 # type: (str, dict(str, str), Configuration) -> None @@ -105,16 +111,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/sub_account_cross_margin_balance.py b/gate_api/models/sub_account_cross_margin_balance.py new file mode 100644 index 0000000..524294f --- /dev/null +++ b/gate_api/models/sub_account_cross_margin_balance.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 SubAccountCrossMarginBalance(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'available': 'SubCrossMarginAccount' + } + + attribute_map = { + 'uid': 'uid', + 'available': 'available' + } + + def __init__(self, uid=None, available=None, local_vars_configuration=None): # noqa: E501 + # type: (str, SubCrossMarginAccount, Configuration) -> None + """SubAccountCrossMarginBalance - a 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._available = None + self.discriminator = None + + if uid is not None: + self.uid = uid + if available is not None: + self.available = available + + @property + def uid(self): + """Gets the uid of this SubAccountCrossMarginBalance. # noqa: E501 + + User ID # noqa: E501 + + :return: The uid of this SubAccountCrossMarginBalance. # noqa: E501 + :rtype: str + """ + return self._uid + + @uid.setter + def uid(self, uid): + """Sets the uid of this SubAccountCrossMarginBalance. + + User ID # noqa: E501 + + :param uid: The uid of this SubAccountCrossMarginBalance. # noqa: E501 + :type: str + """ + + self._uid = uid + + @property + def available(self): + """Gets the available of this SubAccountCrossMarginBalance. # noqa: E501 + + 账户余额信息 # noqa: E501 + + :return: The available of this SubAccountCrossMarginBalance. # noqa: E501 + :rtype: SubCrossMarginAccount + """ + return self._available + + @available.setter + def available(self, available): + """Sets the available of this SubAccountCrossMarginBalance. + + 账户余额信息 # noqa: E501 + + :param available: The available of this SubAccountCrossMarginBalance. # noqa: E501 + :type: SubCrossMarginAccount + """ + + self._available = available + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SubAccountCrossMarginBalance): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, SubAccountCrossMarginBalance): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/sub_account_futures_balance.py b/gate_api/models/sub_account_futures_balance.py new file mode 100644 index 0000000..c499b88 --- /dev/null +++ b/gate_api/models/sub_account_futures_balance.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 SubAccountFuturesBalance(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'available': 'dict(str, FuturesAccount)' + } + + attribute_map = { + 'uid': 'uid', + 'available': 'available' + } + + def __init__(self, uid=None, available=None, local_vars_configuration=None): # noqa: E501 + # type: (str, dict(str, FuturesAccount), Configuration) -> None + """SubAccountFuturesBalance - a 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._available = None + self.discriminator = None + + if uid is not None: + self.uid = uid + if available is not None: + self.available = available + + @property + def uid(self): + """Gets the uid of this SubAccountFuturesBalance. # noqa: E501 + + User ID # noqa: E501 + + :return: The uid of this SubAccountFuturesBalance. # noqa: E501 + :rtype: str + """ + return self._uid + + @uid.setter + def uid(self, uid): + """Sets the uid of this SubAccountFuturesBalance. + + User ID # noqa: E501 + + :param uid: The uid of this SubAccountFuturesBalance. # noqa: E501 + :type: str + """ + + self._uid = uid + + @property + def available(self): + """Gets the available of this SubAccountFuturesBalance. # noqa: E501 + + Futures account balances # noqa: E501 + + :return: The available of this SubAccountFuturesBalance. # noqa: E501 + :rtype: dict(str, FuturesAccount) + """ + return self._available + + @available.setter + def available(self, available): + """Sets the available of this SubAccountFuturesBalance. + + Futures account balances # noqa: E501 + + :param available: The available of this SubAccountFuturesBalance. # noqa: E501 + :type: dict(str, FuturesAccount) + """ + + self._available = available + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SubAccountFuturesBalance): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, SubAccountFuturesBalance): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/sub_account_key.py b/gate_api/models/sub_account_key.py new file mode 100644 index 0000000..c644eb6 --- /dev/null +++ b/gate_api/models/sub_account_key.py @@ -0,0 +1,373 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class SubAccountKey(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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': 'int', + 'mode': 'int', + 'name': 'str', + 'perms': 'list[SubAccountKeyPerms]', + 'ip_whitelist': 'list[str]', + 'key': 'str', + 'state': 'int', + 'created_at': 'int', + 'updated_at': 'int', + 'last_access': 'int' + } + + attribute_map = { + 'user_id': 'user_id', + 'mode': 'mode', + 'name': 'name', + 'perms': 'perms', + 'ip_whitelist': 'ip_whitelist', + 'key': 'key', + 'state': 'state', + 'created_at': 'created_at', + 'updated_at': 'updated_at', + 'last_access': 'last_access' + } + + def __init__(self, user_id=None, mode=None, name=None, perms=None, ip_whitelist=None, key=None, state=None, created_at=None, updated_at=None, last_access=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, str, list[SubAccountKeyPerms], list[str], str, int, int, int, int, Configuration) -> None + """SubAccountKey - a 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._mode = None + self._name = None + self._perms = None + self._ip_whitelist = None + self._key = None + self._state = None + self._created_at = None + self._updated_at = None + self._last_access = None + self.discriminator = None + + if user_id is not None: + self.user_id = user_id + if mode is not None: + self.mode = mode + if name is not None: + self.name = name + if perms is not None: + self.perms = perms + if ip_whitelist is not None: + self.ip_whitelist = ip_whitelist + if key is not None: + self.key = key + if state is not None: + self.state = state + if created_at is not None: + self.created_at = created_at + if updated_at is not None: + self.updated_at = updated_at + if last_access is not None: + self.last_access = last_access + + @property + def user_id(self): + """Gets the user_id of this SubAccountKey. # noqa: E501 + + User ID # noqa: E501 + + :return: The user_id of this SubAccountKey. # noqa: E501 + :rtype: int + """ + return self._user_id + + @user_id.setter + def user_id(self, user_id): + """Sets the user_id of this SubAccountKey. + + User ID # noqa: E501 + + :param user_id: The user_id of this SubAccountKey. # noqa: E501 + :type: int + """ + + self._user_id = user_id + + @property + def mode(self): + """Gets the mode of this SubAccountKey. # noqa: E501 + + Mode: 1 - classic 2 - portfolio account # noqa: E501 + + :return: The mode of this SubAccountKey. # noqa: E501 + :rtype: int + """ + return self._mode + + @mode.setter + def mode(self, mode): + """Sets the mode of this SubAccountKey. + + Mode: 1 - classic 2 - portfolio account # noqa: E501 + + :param mode: The mode of this SubAccountKey. # noqa: E501 + :type: int + """ + + self._mode = mode + + @property + def name(self): + """Gets the name of this SubAccountKey. # noqa: E501 + + API Key Name # noqa: E501 + + :return: The name of this SubAccountKey. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this SubAccountKey. + + API Key Name # noqa: E501 + + :param name: The name of this SubAccountKey. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def perms(self): + """Gets the perms of this SubAccountKey. # noqa: E501 + + + :return: The perms of this SubAccountKey. # noqa: E501 + :rtype: list[SubAccountKeyPerms] + """ + return self._perms + + @perms.setter + def perms(self, perms): + """Sets the perms of this SubAccountKey. + + + :param perms: The perms of this SubAccountKey. # noqa: E501 + :type: list[SubAccountKeyPerms] + """ + + self._perms = perms + + @property + def ip_whitelist(self): + """Gets the ip_whitelist of this SubAccountKey. # noqa: E501 + + IP whitelist (list will be cleared if no value is passed) # noqa: E501 + + :return: The ip_whitelist of this SubAccountKey. # noqa: E501 + :rtype: list[str] + """ + return self._ip_whitelist + + @ip_whitelist.setter + def ip_whitelist(self, ip_whitelist): + """Sets the ip_whitelist of this SubAccountKey. + + IP whitelist (list will be cleared if no value is passed) # noqa: E501 + + :param ip_whitelist: The ip_whitelist of this SubAccountKey. # noqa: E501 + :type: list[str] + """ + + self._ip_whitelist = ip_whitelist + + @property + def key(self): + """Gets the key of this SubAccountKey. # noqa: E501 + + API Key # noqa: E501 + + :return: The key of this SubAccountKey. # noqa: E501 + :rtype: str + """ + return self._key + + @key.setter + def key(self, key): + """Sets the key of this SubAccountKey. + + API Key # noqa: E501 + + :param key: The key of this SubAccountKey. # noqa: E501 + :type: str + """ + + self._key = key + + @property + def state(self): + """Gets the state of this SubAccountKey. # noqa: E501 + + Status: 1-Normal 2-Frozen 3-Locked # noqa: E501 + + :return: The state of this SubAccountKey. # noqa: E501 + :rtype: int + """ + return self._state + + @state.setter + def state(self, state): + """Sets the state of this SubAccountKey. + + Status: 1-Normal 2-Frozen 3-Locked # noqa: E501 + + :param state: The state of this SubAccountKey. # noqa: E501 + :type: int + """ + + self._state = state + + @property + def created_at(self): + """Gets the created_at of this SubAccountKey. # noqa: E501 + + Created time # noqa: E501 + + :return: The created_at of this SubAccountKey. # noqa: E501 + :rtype: int + """ + return self._created_at + + @created_at.setter + def created_at(self, created_at): + """Sets the created_at of this SubAccountKey. + + Created time # noqa: E501 + + :param created_at: The created_at of this SubAccountKey. # noqa: E501 + :type: int + """ + + self._created_at = created_at + + @property + def updated_at(self): + """Gets the updated_at of this SubAccountKey. # noqa: E501 + + Last Update Time # noqa: E501 + + :return: The updated_at of this SubAccountKey. # noqa: E501 + :rtype: int + """ + return self._updated_at + + @updated_at.setter + def updated_at(self, updated_at): + """Sets the updated_at of this SubAccountKey. + + Last Update Time # noqa: E501 + + :param updated_at: The updated_at of this SubAccountKey. # noqa: E501 + :type: int + """ + + self._updated_at = updated_at + + @property + def last_access(self): + """Gets the last_access of this SubAccountKey. # noqa: E501 + + Last Access Time # noqa: E501 + + :return: The last_access of this SubAccountKey. # noqa: E501 + :rtype: int + """ + return self._last_access + + @last_access.setter + def last_access(self, last_access): + """Sets the last_access of this SubAccountKey. + + Last Access Time # noqa: E501 + + :param last_access: The last_access of this SubAccountKey. # noqa: E501 + :type: int + """ + + self._last_access = last_access + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SubAccountKey): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, SubAccountKey): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/sub_account_key_perms.py b/gate_api/models/sub_account_key_perms.py new file mode 100644 index 0000000..fa9a9f3 --- /dev/null +++ b/gate_api/models/sub_account_key_perms.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 SubAccountKeyPerms(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'read_only': 'bool' + } + + attribute_map = { + 'name': 'name', + 'read_only': 'read_only' + } + + def __init__(self, name=None, read_only=None, local_vars_configuration=None): # noqa: E501 + # type: (str, bool, Configuration) -> None + """SubAccountKeyPerms - a 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._read_only = None + self.discriminator = None + + if name is not None: + self.name = name + if read_only is not None: + self.read_only = read_only + + @property + def name(self): + """Gets the name of this SubAccountKeyPerms. # noqa: E501 + + Permission function name (no value will be cleared) - wallet: wallet - spot: spot/margin - futures: perpetual contract - delivery: delivery contract - earn: earn - custody: custody - options: options - account: account information - loan: lending - margin: margin - unified: unified account - copy: copy trading # noqa: E501 + + :return: The name of this SubAccountKeyPerms. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this SubAccountKeyPerms. + + Permission function name (no value will be cleared) - wallet: wallet - spot: spot/margin - futures: perpetual contract - delivery: delivery contract - earn: earn - custody: custody - options: options - account: account information - loan: lending - margin: margin - unified: unified account - copy: copy trading # noqa: E501 + + :param name: The name of this SubAccountKeyPerms. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def read_only(self): + """Gets the read_only of this SubAccountKeyPerms. # noqa: E501 + + Read Only # noqa: E501 + + :return: The read_only of this SubAccountKeyPerms. # noqa: E501 + :rtype: bool + """ + return self._read_only + + @read_only.setter + def read_only(self, read_only): + """Sets the read_only of this SubAccountKeyPerms. + + Read Only # noqa: E501 + + :param read_only: The read_only of this SubAccountKeyPerms. # noqa: E501 + :type: bool + """ + + self._read_only = read_only + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SubAccountKeyPerms): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, SubAccountKeyPerms): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/sub_account_margin_balance.py b/gate_api/models/sub_account_margin_balance.py new file mode 100644 index 0000000..22d8025 --- /dev/null +++ b/gate_api/models/sub_account_margin_balance.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 SubAccountMarginBalance(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'available': 'list[MarginAccount]' + } + + attribute_map = { + 'uid': 'uid', + 'available': 'available' + } + + def __init__(self, uid=None, available=None, local_vars_configuration=None): # noqa: E501 + # type: (str, list[MarginAccount], Configuration) -> None + """SubAccountMarginBalance - a 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._available = None + self.discriminator = None + + if uid is not None: + self.uid = uid + if available is not None: + self.available = available + + @property + def uid(self): + """Gets the uid of this SubAccountMarginBalance. # noqa: E501 + + User ID # noqa: E501 + + :return: The uid of this SubAccountMarginBalance. # noqa: E501 + :rtype: str + """ + return self._uid + + @uid.setter + def uid(self, uid): + """Sets the uid of this SubAccountMarginBalance. + + User ID # noqa: E501 + + :param uid: The uid of this SubAccountMarginBalance. # noqa: E501 + :type: str + """ + + self._uid = uid + + @property + def available(self): + """Gets the available of this SubAccountMarginBalance. # noqa: E501 + + Margin account balances # noqa: E501 + + :return: The available of this SubAccountMarginBalance. # noqa: E501 + :rtype: list[MarginAccount] + """ + return self._available + + @available.setter + def available(self, available): + """Sets the available of this SubAccountMarginBalance. + + Margin account balances # noqa: E501 + + :param available: The available of this SubAccountMarginBalance. # noqa: E501 + :type: list[MarginAccount] + """ + + self._available = available + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SubAccountMarginBalance): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, SubAccountMarginBalance): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/sub_account_to_sub_account.py b/gate_api/models/sub_account_to_sub_account.py new file mode 100644 index 0000000..c082521 --- /dev/null +++ b/gate_api/models/sub_account_to_sub_account.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 SubAccountToSubAccount(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'sub_account_type': 'str', + 'sub_account_from': 'str', + 'sub_account_from_type': 'str', + 'sub_account_to': 'str', + 'sub_account_to_type': 'str', + 'amount': 'str' + } + + attribute_map = { + 'currency': 'currency', + 'sub_account_type': 'sub_account_type', + 'sub_account_from': 'sub_account_from', + 'sub_account_from_type': 'sub_account_from_type', + 'sub_account_to': 'sub_account_to', + 'sub_account_to_type': 'sub_account_to_type', + 'amount': 'amount' + } + + def __init__(self, currency=None, sub_account_type=None, sub_account_from=None, sub_account_from_type=None, sub_account_to=None, sub_account_to_type=None, amount=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, Configuration) -> None + """SubAccountToSubAccount - a 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._sub_account_type = None + self._sub_account_from = None + self._sub_account_from_type = None + self._sub_account_to = None + self._sub_account_to_type = None + self._amount = None + self.discriminator = None + + self.currency = currency + if sub_account_type is not None: + self.sub_account_type = sub_account_type + self.sub_account_from = sub_account_from + self.sub_account_from_type = sub_account_from_type + self.sub_account_to = sub_account_to + self.sub_account_to_type = sub_account_to_type + self.amount = amount + + @property + def currency(self): + """Gets the currency of this SubAccountToSubAccount. # noqa: E501 + + Transfer currency name # noqa: E501 + + :return: The currency of this SubAccountToSubAccount. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this SubAccountToSubAccount. + + Transfer currency name # noqa: E501 + + :param currency: The currency of this SubAccountToSubAccount. # 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 sub_account_type(self): + """Gets the sub_account_type of this SubAccountToSubAccount. # noqa: E501 + + Transfer from account (deprecated, use `sub_account_from_type` and `sub_account_to_type` instead) # noqa: E501 + + :return: The sub_account_type of this SubAccountToSubAccount. # noqa: E501 + :rtype: str + """ + return self._sub_account_type + + @sub_account_type.setter + def sub_account_type(self, sub_account_type): + """Sets the sub_account_type of this SubAccountToSubAccount. + + Transfer from account (deprecated, use `sub_account_from_type` and `sub_account_to_type` instead) # noqa: E501 + + :param sub_account_type: The sub_account_type of this SubAccountToSubAccount. # noqa: E501 + :type: str + """ + + self._sub_account_type = sub_account_type + + @property + def sub_account_from(self): + """Gets the sub_account_from of this SubAccountToSubAccount. # noqa: E501 + + Transfer from the user id of the sub-account # noqa: E501 + + :return: The sub_account_from of this SubAccountToSubAccount. # noqa: E501 + :rtype: str + """ + return self._sub_account_from + + @sub_account_from.setter + def sub_account_from(self, sub_account_from): + """Sets the sub_account_from of this SubAccountToSubAccount. + + Transfer from the user id of the sub-account # noqa: E501 + + :param sub_account_from: The sub_account_from of this SubAccountToSubAccount. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and sub_account_from is None: # noqa: E501 + raise ValueError("Invalid value for `sub_account_from`, must not be `None`") # noqa: E501 + + self._sub_account_from = sub_account_from + + @property + def sub_account_from_type(self): + """Gets the sub_account_from_type of this SubAccountToSubAccount. # noqa: E501 + + Source sub-account trading account: spot - spot account, futures - perpetual contract account, delivery - delivery contract account # noqa: E501 + + :return: The sub_account_from_type of this SubAccountToSubAccount. # noqa: E501 + :rtype: str + """ + return self._sub_account_from_type + + @sub_account_from_type.setter + def sub_account_from_type(self, sub_account_from_type): + """Sets the sub_account_from_type of this SubAccountToSubAccount. + + Source sub-account trading account: spot - spot account, futures - perpetual contract account, delivery - delivery contract account # noqa: E501 + + :param sub_account_from_type: The sub_account_from_type of this SubAccountToSubAccount. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and sub_account_from_type is None: # noqa: E501 + raise ValueError("Invalid value for `sub_account_from_type`, must not be `None`") # noqa: E501 + + self._sub_account_from_type = sub_account_from_type + + @property + def sub_account_to(self): + """Gets the sub_account_to of this SubAccountToSubAccount. # noqa: E501 + + Transfer to the user id of the sub-account # noqa: E501 + + :return: The sub_account_to of this SubAccountToSubAccount. # noqa: E501 + :rtype: str + """ + return self._sub_account_to + + @sub_account_to.setter + def sub_account_to(self, sub_account_to): + """Sets the sub_account_to of this SubAccountToSubAccount. + + Transfer to the user id of the sub-account # noqa: E501 + + :param sub_account_to: The sub_account_to of this SubAccountToSubAccount. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and sub_account_to is None: # noqa: E501 + raise ValueError("Invalid value for `sub_account_to`, must not be `None`") # noqa: E501 + + self._sub_account_to = sub_account_to + + @property + def sub_account_to_type(self): + """Gets the sub_account_to_type of this SubAccountToSubAccount. # noqa: E501 + + Target sub-account trading account: spot - spot account, futures - perpetual contract account, delivery - delivery contract account # noqa: E501 + + :return: The sub_account_to_type of this SubAccountToSubAccount. # noqa: E501 + :rtype: str + """ + return self._sub_account_to_type + + @sub_account_to_type.setter + def sub_account_to_type(self, sub_account_to_type): + """Sets the sub_account_to_type of this SubAccountToSubAccount. + + Target sub-account trading account: spot - spot account, futures - perpetual contract account, delivery - delivery contract account # noqa: E501 + + :param sub_account_to_type: The sub_account_to_type of this SubAccountToSubAccount. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and sub_account_to_type is None: # noqa: E501 + raise ValueError("Invalid value for `sub_account_to_type`, must not be `None`") # noqa: E501 + + self._sub_account_to_type = sub_account_to_type + + @property + def amount(self): + """Gets the amount of this SubAccountToSubAccount. # noqa: E501 + + Transfer amount # noqa: E501 + + :return: The amount of this SubAccountToSubAccount. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this SubAccountToSubAccount. + + Transfer amount # noqa: E501 + + :param amount: The amount of this SubAccountToSubAccount. # 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, SubAccountToSubAccount): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, SubAccountToSubAccount): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/sub_account_transfer.py b/gate_api/models/sub_account_transfer.py index 1e3dfb8..9ab7c79 100644 --- a/gate_api/models/sub_account_transfer.py +++ b/gate_api/models/sub_account_transfer.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -33,92 +33,46 @@ class SubAccountTransfer(object): and the value is json key in definition. """ openapi_types = { - 'currency': 'str', 'sub_account': 'str', - 'direction': 'str', - 'amount': 'str', - 'uid': 'str', - 'timest': 'str', - 'source': 'str', 'sub_account_type': 'str', + 'currency': 'str', + 'amount': 'str', + 'direction': 'str', + 'client_order_id': 'str' } attribute_map = { - 'currency': 'currency', 'sub_account': 'sub_account', - 'direction': 'direction', - 'amount': 'amount', - 'uid': 'uid', - 'timest': 'timest', - 'source': 'source', 'sub_account_type': 'sub_account_type', + 'currency': 'currency', + 'amount': 'amount', + 'direction': 'direction', + 'client_order_id': 'client_order_id' } - def __init__( - self, - currency=None, - sub_account=None, - direction=None, - amount=None, - uid=None, - timest=None, - source=None, - sub_account_type='spot', - local_vars_configuration=None, - ): # noqa: E501 - # type: (str, str, str, str, str, str, str, str, Configuration) -> None + def __init__(self, sub_account=None, sub_account_type='spot', currency=None, amount=None, direction=None, client_order_id=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, Configuration) -> None """SubAccountTransfer - a 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._sub_account = None - self._direction = None - self._amount = None - self._uid = None - self._timest = None - self._source = None self._sub_account_type = None + self._currency = None + self._amount = None + self._direction = None + self._client_order_id = None self.discriminator = None - self.currency = currency self.sub_account = sub_account - self.direction = direction - self.amount = amount - if uid is not None: - self.uid = uid - if timest is not None: - self.timest = timest - if source is not None: - self.source = source if sub_account_type is not None: self.sub_account_type = sub_account_type - - @property - def currency(self): - """Gets the currency of this SubAccountTransfer. # noqa: E501 - - Transfer currency name # noqa: E501 - - :return: The currency of this SubAccountTransfer. # noqa: E501 - :rtype: str - """ - return self._currency - - @currency.setter - def currency(self, currency): - """Sets the currency of this SubAccountTransfer. - - Transfer currency name # noqa: E501 - - :param currency: The currency of this SubAccountTransfer. # 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 + self.currency = currency + self.amount = amount + self.direction = direction + if client_order_id is not None: + self.client_order_id = client_order_id @property def sub_account(self): @@ -146,36 +100,52 @@ def sub_account(self, sub_account): self._sub_account = sub_account @property - def direction(self): - """Gets the direction of this SubAccountTransfer. # noqa: E501 + def sub_account_type(self): + """Gets the sub_account_type of this SubAccountTransfer. # noqa: E501 - Transfer direction. to - transfer into sub account; from - transfer out from sub account # noqa: E501 + Target sub-account trading account: spot - spot account, futures - perpetual contract account, delivery - delivery contract account, options - options account # noqa: E501 - :return: The direction of this SubAccountTransfer. # noqa: E501 + :return: The sub_account_type of this SubAccountTransfer. # noqa: E501 :rtype: str """ - return self._direction + return self._sub_account_type - @direction.setter - def direction(self, direction): - """Sets the direction of this SubAccountTransfer. + @sub_account_type.setter + def sub_account_type(self, sub_account_type): + """Sets the sub_account_type of this SubAccountTransfer. - Transfer direction. to - transfer into sub account; from - transfer out from sub account # noqa: E501 + Target sub-account trading account: spot - spot account, futures - perpetual contract account, delivery - delivery contract account, options - options account # noqa: E501 - :param direction: The direction of this SubAccountTransfer. # noqa: E501 + :param sub_account_type: The sub_account_type of this SubAccountTransfer. # noqa: E501 :type: str """ - 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 - allowed_values = ["to", "from"] # noqa: E501 - if self.local_vars_configuration.client_side_validation and direction not in allowed_values: # noqa: E501 - raise ValueError( - "Invalid value for `direction` ({0}), must be one of {1}".format( # noqa: E501 - direction, allowed_values - ) - ) - self._direction = direction + self._sub_account_type = sub_account_type + + @property + def currency(self): + """Gets the currency of this SubAccountTransfer. # noqa: E501 + + Transfer currency name # noqa: E501 + + :return: The currency of this SubAccountTransfer. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this SubAccountTransfer. + + Transfer currency name # noqa: E501 + + :param currency: The currency of this SubAccountTransfer. # 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): @@ -203,105 +173,52 @@ def amount(self, amount): self._amount = amount @property - def uid(self): - """Gets the uid of this SubAccountTransfer. # noqa: E501 - - Main account user ID # noqa: E501 - - :return: The uid of this SubAccountTransfer. # noqa: E501 - :rtype: str - """ - return self._uid - - @uid.setter - def uid(self, uid): - """Sets the uid of this SubAccountTransfer. - - Main account user ID # noqa: E501 - - :param uid: The uid of this SubAccountTransfer. # noqa: E501 - :type: str - """ - - self._uid = uid - - @property - def timest(self): - """Gets the timest of this SubAccountTransfer. # noqa: E501 - - Transfer timestamp # noqa: E501 - - :return: The timest of this SubAccountTransfer. # noqa: E501 - :rtype: str - """ - return self._timest - - @timest.setter - def timest(self, timest): - """Sets the timest of this SubAccountTransfer. - - Transfer timestamp # noqa: E501 - - :param timest: The timest of this SubAccountTransfer. # noqa: E501 - :type: str - """ - - self._timest = timest - - @property - def source(self): - """Gets the source of this SubAccountTransfer. # noqa: E501 + def direction(self): + """Gets the direction of this SubAccountTransfer. # noqa: E501 - Where the operation is initiated from # noqa: E501 + Transfer direction: to - transfer into sub-account, from - transfer out from sub-account # noqa: E501 - :return: The source of this SubAccountTransfer. # noqa: E501 + :return: The direction of this SubAccountTransfer. # noqa: E501 :rtype: str """ - return self._source + return self._direction - @source.setter - def source(self, source): - """Sets the source of this SubAccountTransfer. + @direction.setter + def direction(self, direction): + """Sets the direction of this SubAccountTransfer. - Where the operation is initiated from # noqa: E501 + Transfer direction: to - transfer into sub-account, from - transfer out from sub-account # noqa: E501 - :param source: The source of this SubAccountTransfer. # noqa: E501 + :param direction: The direction of this SubAccountTransfer. # noqa: E501 :type: str """ + 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._source = source + self._direction = direction @property - def sub_account_type(self): - """Gets the sub_account_type of this SubAccountTransfer. # noqa: E501 + def client_order_id(self): + """Gets the client_order_id of this SubAccountTransfer. # noqa: E501 - Target sub user's account. `spot` - spot account, `futures` - perpetual contract account # noqa: E501 + 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 # noqa: E501 - :return: The sub_account_type of this SubAccountTransfer. # noqa: E501 + :return: The client_order_id of this SubAccountTransfer. # noqa: E501 :rtype: str """ - return self._sub_account_type + return self._client_order_id - @sub_account_type.setter - def sub_account_type(self, sub_account_type): - """Sets the sub_account_type of this SubAccountTransfer. + @client_order_id.setter + def client_order_id(self, client_order_id): + """Sets the client_order_id of this SubAccountTransfer. - Target sub user's account. `spot` - spot account, `futures` - perpetual contract account # noqa: E501 + 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 # noqa: E501 - :param sub_account_type: The sub_account_type of this SubAccountTransfer. # noqa: E501 + :param client_order_id: The client_order_id of this SubAccountTransfer. # noqa: E501 :type: str """ - allowed_values = ["spot", "futures"] # noqa: E501 - if ( - self.local_vars_configuration.client_side_validation and sub_account_type not in allowed_values - ): # noqa: E501 - raise ValueError( - "Invalid value for `sub_account_type` ({0}), must be one of {1}".format( # noqa: E501 - sub_account_type, allowed_values - ) - ) - self._sub_account_type = sub_account_type + self._client_order_id = client_order_id def to_dict(self): """Returns the model properties as a dict""" @@ -310,16 +227,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/sub_account_transfer_record_item.py b/gate_api/models/sub_account_transfer_record_item.py new file mode 100644 index 0000000..650a595 --- /dev/null +++ b/gate_api/models/sub_account_transfer_record_item.py @@ -0,0 +1,379 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class SubAccountTransferRecordItem(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'timest': 'str', + 'uid': 'str', + 'sub_account': 'str', + 'sub_account_type': 'str', + 'currency': 'str', + 'amount': 'str', + 'direction': 'str', + 'source': 'str', + 'client_order_id': 'str', + 'status': 'str' + } + + attribute_map = { + 'timest': 'timest', + 'uid': 'uid', + 'sub_account': 'sub_account', + 'sub_account_type': 'sub_account_type', + 'currency': 'currency', + 'amount': 'amount', + 'direction': 'direction', + 'source': 'source', + 'client_order_id': 'client_order_id', + 'status': 'status' + } + + def __init__(self, timest=None, uid=None, sub_account=None, sub_account_type='spot', currency=None, amount=None, direction=None, source=None, client_order_id=None, status=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, str, str, str, Configuration) -> None + """SubAccountTransferRecordItem - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._timest = None + self._uid = None + self._sub_account = None + self._sub_account_type = None + self._currency = None + self._amount = None + self._direction = None + self._source = None + self._client_order_id = None + self._status = None + self.discriminator = None + + if timest is not None: + self.timest = timest + if uid is not None: + self.uid = uid + self.sub_account = sub_account + if sub_account_type is not None: + self.sub_account_type = sub_account_type + self.currency = currency + self.amount = amount + self.direction = direction + if source is not None: + self.source = source + if client_order_id is not None: + self.client_order_id = client_order_id + if status is not None: + self.status = status + + @property + def timest(self): + """Gets the timest of this SubAccountTransferRecordItem. # noqa: E501 + + Transfer timestamp # noqa: E501 + + :return: The timest of this SubAccountTransferRecordItem. # noqa: E501 + :rtype: str + """ + return self._timest + + @timest.setter + def timest(self, timest): + """Sets the timest of this SubAccountTransferRecordItem. + + Transfer timestamp # noqa: E501 + + :param timest: The timest of this SubAccountTransferRecordItem. # noqa: E501 + :type: str + """ + + self._timest = timest + + @property + def uid(self): + """Gets the uid of this SubAccountTransferRecordItem. # noqa: E501 + + Main account user ID # noqa: E501 + + :return: The uid of this SubAccountTransferRecordItem. # noqa: E501 + :rtype: str + """ + return self._uid + + @uid.setter + def uid(self, uid): + """Sets the uid of this SubAccountTransferRecordItem. + + Main account user ID # noqa: E501 + + :param uid: The uid of this SubAccountTransferRecordItem. # noqa: E501 + :type: str + """ + + self._uid = uid + + @property + def sub_account(self): + """Gets the sub_account of this SubAccountTransferRecordItem. # noqa: E501 + + Sub account user ID # noqa: E501 + + :return: The sub_account of this SubAccountTransferRecordItem. # noqa: E501 + :rtype: str + """ + return self._sub_account + + @sub_account.setter + def sub_account(self, sub_account): + """Sets the sub_account of this SubAccountTransferRecordItem. + + Sub account user ID # noqa: E501 + + :param sub_account: The sub_account of this SubAccountTransferRecordItem. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and sub_account is None: # noqa: E501 + raise ValueError("Invalid value for `sub_account`, must not be `None`") # noqa: E501 + + self._sub_account = sub_account + + @property + def sub_account_type(self): + """Gets the sub_account_type of this SubAccountTransferRecordItem. # noqa: E501 + + Target sub-account trading account: spot - spot account, futures - perpetual contract account, delivery - delivery contract account, options - options account # noqa: E501 + + :return: The sub_account_type of this SubAccountTransferRecordItem. # noqa: E501 + :rtype: str + """ + return self._sub_account_type + + @sub_account_type.setter + def sub_account_type(self, sub_account_type): + """Sets the sub_account_type of this SubAccountTransferRecordItem. + + Target sub-account trading account: spot - spot account, futures - perpetual contract account, delivery - delivery contract account, options - options account # noqa: E501 + + :param sub_account_type: The sub_account_type of this SubAccountTransferRecordItem. # noqa: E501 + :type: str + """ + + self._sub_account_type = sub_account_type + + @property + def currency(self): + """Gets the currency of this SubAccountTransferRecordItem. # noqa: E501 + + Transfer currency name # noqa: E501 + + :return: The currency of this SubAccountTransferRecordItem. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this SubAccountTransferRecordItem. + + Transfer currency name # noqa: E501 + + :param currency: The currency of this SubAccountTransferRecordItem. # 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 SubAccountTransferRecordItem. # noqa: E501 + + Transfer amount # noqa: E501 + + :return: The amount of this SubAccountTransferRecordItem. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this SubAccountTransferRecordItem. + + Transfer amount # noqa: E501 + + :param amount: The amount of this SubAccountTransferRecordItem. # 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 direction(self): + """Gets the direction of this SubAccountTransferRecordItem. # noqa: E501 + + Transfer direction: to - transfer into sub-account, from - transfer out from sub-account # noqa: E501 + + :return: The direction of this SubAccountTransferRecordItem. # noqa: E501 + :rtype: str + """ + return self._direction + + @direction.setter + def direction(self, direction): + """Sets the direction of this SubAccountTransferRecordItem. + + Transfer direction: to - transfer into sub-account, from - transfer out from sub-account # noqa: E501 + + :param direction: The direction of this SubAccountTransferRecordItem. # noqa: E501 + :type: str + """ + 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 source(self): + """Gets the source of this SubAccountTransferRecordItem. # noqa: E501 + + Source of the transfer operation # noqa: E501 + + :return: The source of this SubAccountTransferRecordItem. # noqa: E501 + :rtype: str + """ + return self._source + + @source.setter + def source(self, source): + """Sets the source of this SubAccountTransferRecordItem. + + Source of the transfer operation # noqa: E501 + + :param source: The source of this SubAccountTransferRecordItem. # noqa: E501 + :type: str + """ + + self._source = source + + @property + def client_order_id(self): + """Gets the client_order_id of this SubAccountTransferRecordItem. # noqa: E501 + + 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 # noqa: E501 + + :return: The client_order_id of this SubAccountTransferRecordItem. # 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 SubAccountTransferRecordItem. + + 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 # noqa: E501 + + :param client_order_id: The client_order_id of this SubAccountTransferRecordItem. # noqa: E501 + :type: str + """ + + self._client_order_id = client_order_id + + @property + def status(self): + """Gets the status of this SubAccountTransferRecordItem. # noqa: E501 + + Sub-account transfer record status, currently only 'success' # noqa: E501 + + :return: The status of this SubAccountTransferRecordItem. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this SubAccountTransferRecordItem. + + Sub-account transfer record status, currently only 'success' # noqa: E501 + + :param status: The status of this SubAccountTransferRecordItem. # 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, SubAccountTransferRecordItem): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, SubAccountTransferRecordItem): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/sub_cross_margin_account.py b/gate_api/models/sub_cross_margin_account.py new file mode 100644 index 0000000..0e43bca --- /dev/null +++ b/gate_api/models/sub_cross_margin_account.py @@ -0,0 +1,541 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class SubCrossMarginAccount(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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': 'int', + 'locked': 'bool', + 'balances': 'dict(str, CrossMarginBalance)', + 'total': 'str', + 'borrowed': 'str', + 'borrowed_net': 'str', + 'net': 'str', + 'leverage': 'str', + 'interest': 'str', + 'risk': 'str', + 'total_initial_margin': 'str', + 'total_margin_balance': 'str', + 'total_maintenance_margin': 'str', + 'total_initial_margin_rate': 'str', + 'total_maintenance_margin_rate': 'str', + 'total_available_margin': 'str' + } + + attribute_map = { + 'user_id': 'user_id', + 'locked': 'locked', + 'balances': 'balances', + 'total': 'total', + 'borrowed': 'borrowed', + 'borrowed_net': 'borrowed_net', + 'net': 'net', + 'leverage': 'leverage', + 'interest': 'interest', + 'risk': 'risk', + 'total_initial_margin': 'total_initial_margin', + 'total_margin_balance': 'total_margin_balance', + 'total_maintenance_margin': 'total_maintenance_margin', + 'total_initial_margin_rate': 'total_initial_margin_rate', + 'total_maintenance_margin_rate': 'total_maintenance_margin_rate', + 'total_available_margin': 'total_available_margin' + } + + def __init__(self, user_id=None, locked=None, balances=None, total=None, borrowed=None, borrowed_net=None, net=None, leverage=None, interest=None, risk=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, local_vars_configuration=None): # noqa: E501 + # type: (int, bool, dict(str, CrossMarginBalance), str, str, str, str, str, str, str, str, str, str, str, str, str, Configuration) -> None + """SubCrossMarginAccount - a 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._locked = None + self._balances = None + self._total = None + self._borrowed = None + self._borrowed_net = None + self._net = None + self._leverage = None + self._interest = None + self._risk = None + self._total_initial_margin = None + self._total_margin_balance = None + self._total_maintenance_margin = None + self._total_initial_margin_rate = None + self._total_maintenance_margin_rate = None + self._total_available_margin = None + self.discriminator = None + + if user_id is not None: + self.user_id = user_id + if locked is not None: + self.locked = locked + if balances is not None: + self.balances = balances + if total is not None: + self.total = total + if borrowed is not None: + self.borrowed = borrowed + if borrowed_net is not None: + self.borrowed_net = borrowed_net + if net is not None: + self.net = net + if leverage is not None: + self.leverage = leverage + if interest is not None: + self.interest = interest + if risk is not None: + self.risk = risk + if total_initial_margin is not None: + self.total_initial_margin = total_initial_margin + if total_margin_balance is not None: + self.total_margin_balance = total_margin_balance + if total_maintenance_margin is not None: + self.total_maintenance_margin = total_maintenance_margin + if total_initial_margin_rate is not None: + self.total_initial_margin_rate = total_initial_margin_rate + if total_maintenance_margin_rate is not None: + self.total_maintenance_margin_rate = total_maintenance_margin_rate + if total_available_margin is not None: + self.total_available_margin = total_available_margin + + @property + def user_id(self): + """Gets the user_id of this SubCrossMarginAccount. # noqa: E501 + + Cross margin account user ID. 0 means this sub-account has not yet opened a cross margin account # noqa: E501 + + :return: The user_id of this SubCrossMarginAccount. # noqa: E501 + :rtype: int + """ + return self._user_id + + @user_id.setter + def user_id(self, user_id): + """Sets the user_id of this SubCrossMarginAccount. + + Cross margin account user ID. 0 means this sub-account has not yet opened a cross margin account # noqa: E501 + + :param user_id: The user_id of this SubCrossMarginAccount. # noqa: E501 + :type: int + """ + + self._user_id = user_id + + @property + def locked(self): + """Gets the locked of this SubCrossMarginAccount. # noqa: E501 + + Whether the account is locked # noqa: E501 + + :return: The locked of this SubCrossMarginAccount. # noqa: E501 + :rtype: bool + """ + return self._locked + + @locked.setter + def locked(self, locked): + """Sets the locked of this SubCrossMarginAccount. + + Whether the account is locked # noqa: E501 + + :param locked: The locked of this SubCrossMarginAccount. # noqa: E501 + :type: bool + """ + + self._locked = locked + + @property + def balances(self): + """Gets the balances of this SubCrossMarginAccount. # noqa: E501 + + + :return: The balances of this SubCrossMarginAccount. # noqa: E501 + :rtype: dict(str, CrossMarginBalance) + """ + return self._balances + + @balances.setter + def balances(self, balances): + """Sets the balances of this SubCrossMarginAccount. + + + :param balances: The balances of this SubCrossMarginAccount. # noqa: E501 + :type: dict(str, CrossMarginBalance) + """ + + self._balances = balances + + @property + def total(self): + """Gets the total of this SubCrossMarginAccount. # noqa: E501 + + Total account value in USDT, i.e., the sum of all currencies' `(available+freeze)*price*discount` # noqa: E501 + + :return: The total of this SubCrossMarginAccount. # noqa: E501 + :rtype: str + """ + return self._total + + @total.setter + def total(self, total): + """Sets the total of this SubCrossMarginAccount. + + Total account value in USDT, i.e., the sum of all currencies' `(available+freeze)*price*discount` # noqa: E501 + + :param total: The total of this SubCrossMarginAccount. # noqa: E501 + :type: str + """ + + self._total = total + + @property + def borrowed(self): + """Gets the borrowed of this SubCrossMarginAccount. # noqa: E501 + + Total borrowed value in USDT, i.e., the sum of all currencies' `borrowed*price*discount` # noqa: E501 + + :return: The borrowed of this SubCrossMarginAccount. # noqa: E501 + :rtype: str + """ + return self._borrowed + + @borrowed.setter + def borrowed(self, borrowed): + """Sets the borrowed of this SubCrossMarginAccount. + + Total borrowed value in USDT, i.e., the sum of all currencies' `borrowed*price*discount` # noqa: E501 + + :param borrowed: The borrowed of this SubCrossMarginAccount. # noqa: E501 + :type: str + """ + + self._borrowed = borrowed + + @property + def borrowed_net(self): + """Gets the borrowed_net of this SubCrossMarginAccount. # noqa: E501 + + Total borrowed value in USDT * leverage factor # noqa: E501 + + :return: The borrowed_net of this SubCrossMarginAccount. # noqa: E501 + :rtype: str + """ + return self._borrowed_net + + @borrowed_net.setter + def borrowed_net(self, borrowed_net): + """Sets the borrowed_net of this SubCrossMarginAccount. + + Total borrowed value in USDT * leverage factor # noqa: E501 + + :param borrowed_net: The borrowed_net of this SubCrossMarginAccount. # noqa: E501 + :type: str + """ + + self._borrowed_net = borrowed_net + + @property + def net(self): + """Gets the net of this SubCrossMarginAccount. # noqa: E501 + + Total net assets in USDT # noqa: E501 + + :return: The net of this SubCrossMarginAccount. # noqa: E501 + :rtype: str + """ + return self._net + + @net.setter + def net(self, net): + """Sets the net of this SubCrossMarginAccount. + + Total net assets in USDT # noqa: E501 + + :param net: The net of this SubCrossMarginAccount. # noqa: E501 + :type: str + """ + + self._net = net + + @property + def leverage(self): + """Gets the leverage of this SubCrossMarginAccount. # noqa: E501 + + Position leverage # noqa: E501 + + :return: The leverage of this SubCrossMarginAccount. # noqa: E501 + :rtype: str + """ + return self._leverage + + @leverage.setter + def leverage(self, leverage): + """Sets the leverage of this SubCrossMarginAccount. + + Position leverage # noqa: E501 + + :param leverage: The leverage of this SubCrossMarginAccount. # noqa: E501 + :type: str + """ + + self._leverage = leverage + + @property + def interest(self): + """Gets the interest of this SubCrossMarginAccount. # noqa: E501 + + Total unpaid interest in USDT, i.e., the sum of all currencies' `interest*price*discount` # noqa: E501 + + :return: The interest of this SubCrossMarginAccount. # noqa: E501 + :rtype: str + """ + return self._interest + + @interest.setter + def interest(self, interest): + """Sets the interest of this SubCrossMarginAccount. + + Total unpaid interest in USDT, i.e., the sum of all currencies' `interest*price*discount` # noqa: E501 + + :param interest: The interest of this SubCrossMarginAccount. # noqa: E501 + :type: str + """ + + self._interest = interest + + @property + def risk(self): + """Gets the risk of this SubCrossMarginAccount. # noqa: E501 + + Risk rate. When it falls below 110%, liquidation will be triggered. Calculation formula: `total / (borrowed+interest)` # noqa: E501 + + :return: The risk of this SubCrossMarginAccount. # noqa: E501 + :rtype: str + """ + return self._risk + + @risk.setter + def risk(self, risk): + """Sets the risk of this SubCrossMarginAccount. + + Risk rate. When it falls below 110%, liquidation will be triggered. Calculation formula: `total / (borrowed+interest)` # noqa: E501 + + :param risk: The risk of this SubCrossMarginAccount. # noqa: E501 + :type: str + """ + + self._risk = risk + + @property + def total_initial_margin(self): + """Gets the total_initial_margin of this SubCrossMarginAccount. # noqa: E501 + + Total initial margin # noqa: E501 + + :return: The total_initial_margin of this SubCrossMarginAccount. # noqa: E501 + :rtype: str + """ + return self._total_initial_margin + + @total_initial_margin.setter + def total_initial_margin(self, total_initial_margin): + """Sets the total_initial_margin of this SubCrossMarginAccount. + + Total initial margin # noqa: E501 + + :param total_initial_margin: The total_initial_margin of this SubCrossMarginAccount. # noqa: E501 + :type: str + """ + + self._total_initial_margin = total_initial_margin + + @property + def total_margin_balance(self): + """Gets the total_margin_balance of this SubCrossMarginAccount. # noqa: E501 + + Total margin balance # noqa: E501 + + :return: The total_margin_balance of this SubCrossMarginAccount. # noqa: E501 + :rtype: str + """ + return self._total_margin_balance + + @total_margin_balance.setter + def total_margin_balance(self, total_margin_balance): + """Sets the total_margin_balance of this SubCrossMarginAccount. + + Total margin balance # noqa: E501 + + :param total_margin_balance: The total_margin_balance of this SubCrossMarginAccount. # noqa: E501 + :type: str + """ + + self._total_margin_balance = total_margin_balance + + @property + def total_maintenance_margin(self): + """Gets the total_maintenance_margin of this SubCrossMarginAccount. # noqa: E501 + + Total maintenance margin # noqa: E501 + + :return: The total_maintenance_margin of this SubCrossMarginAccount. # noqa: E501 + :rtype: str + """ + return self._total_maintenance_margin + + @total_maintenance_margin.setter + def total_maintenance_margin(self, total_maintenance_margin): + """Sets the total_maintenance_margin of this SubCrossMarginAccount. + + Total maintenance margin # noqa: E501 + + :param total_maintenance_margin: The total_maintenance_margin of this SubCrossMarginAccount. # noqa: E501 + :type: str + """ + + self._total_maintenance_margin = total_maintenance_margin + + @property + def total_initial_margin_rate(self): + """Gets the total_initial_margin_rate of this SubCrossMarginAccount. # noqa: E501 + + Total initial margin rate # noqa: E501 + + :return: The total_initial_margin_rate of this SubCrossMarginAccount. # noqa: E501 + :rtype: str + """ + return self._total_initial_margin_rate + + @total_initial_margin_rate.setter + def total_initial_margin_rate(self, total_initial_margin_rate): + """Sets the total_initial_margin_rate of this SubCrossMarginAccount. + + Total initial margin rate # noqa: E501 + + :param total_initial_margin_rate: The total_initial_margin_rate of this SubCrossMarginAccount. # noqa: E501 + :type: str + """ + + self._total_initial_margin_rate = total_initial_margin_rate + + @property + def total_maintenance_margin_rate(self): + """Gets the total_maintenance_margin_rate of this SubCrossMarginAccount. # noqa: E501 + + Total maintenance margin rate # noqa: E501 + + :return: The total_maintenance_margin_rate of this SubCrossMarginAccount. # noqa: E501 + :rtype: str + """ + return self._total_maintenance_margin_rate + + @total_maintenance_margin_rate.setter + def total_maintenance_margin_rate(self, total_maintenance_margin_rate): + """Sets the total_maintenance_margin_rate of this SubCrossMarginAccount. + + Total maintenance margin rate # noqa: E501 + + :param total_maintenance_margin_rate: The total_maintenance_margin_rate of this SubCrossMarginAccount. # noqa: E501 + :type: str + """ + + self._total_maintenance_margin_rate = total_maintenance_margin_rate + + @property + def total_available_margin(self): + """Gets the total_available_margin of this SubCrossMarginAccount. # noqa: E501 + + Total available margin # noqa: E501 + + :return: The total_available_margin of this SubCrossMarginAccount. # noqa: E501 + :rtype: str + """ + return self._total_available_margin + + @total_available_margin.setter + def total_available_margin(self, total_available_margin): + """Sets the total_available_margin of this SubCrossMarginAccount. + + Total available margin # noqa: E501 + + :param total_available_margin: The total_available_margin of this SubCrossMarginAccount. # noqa: E501 + :type: str + """ + + self._total_available_margin = total_available_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, SubCrossMarginAccount): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, SubCrossMarginAccount): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/sub_user_mode.py b/gate_api/models/sub_user_mode.py new file mode 100644 index 0000000..2c73505 --- /dev/null +++ b/gate_api/models/sub_user_mode.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 SubUserMode(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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': 'int', + 'is_unified': 'bool', + 'mode': 'str' + } + + attribute_map = { + 'user_id': 'user_id', + 'is_unified': 'is_unified', + 'mode': 'mode' + } + + def __init__(self, user_id=None, is_unified=None, mode=None, local_vars_configuration=None): # noqa: E501 + # type: (int, bool, str, Configuration) -> None + """SubUserMode - a 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._is_unified = None + self._mode = None + self.discriminator = None + + if user_id is not None: + self.user_id = user_id + if is_unified is not None: + self.is_unified = is_unified + if mode is not None: + self.mode = mode + + @property + def user_id(self): + """Gets the user_id of this SubUserMode. # noqa: E501 + + User ID # noqa: E501 + + :return: The user_id of this SubUserMode. # noqa: E501 + :rtype: int + """ + return self._user_id + + @user_id.setter + def user_id(self, user_id): + """Sets the user_id of this SubUserMode. + + User ID # noqa: E501 + + :param user_id: The user_id of this SubUserMode. # noqa: E501 + :type: int + """ + + self._user_id = user_id + + @property + def is_unified(self): + """Gets the is_unified of this SubUserMode. # noqa: E501 + + Whether it is a unified account # noqa: E501 + + :return: The is_unified of this SubUserMode. # noqa: E501 + :rtype: bool + """ + return self._is_unified + + @is_unified.setter + def is_unified(self, is_unified): + """Sets the is_unified of this SubUserMode. + + Whether it is a unified account # noqa: E501 + + :param is_unified: The is_unified of this SubUserMode. # noqa: E501 + :type: bool + """ + + self._is_unified = is_unified + + @property + def mode(self): + """Gets the mode of this SubUserMode. # noqa: E501 + + Unified account mode: - `classic`: Classic account mode - `multi_currency`: Multi-currency margin mode - `portfolio`: Portfolio margin mode # noqa: E501 + + :return: The mode of this SubUserMode. # noqa: E501 + :rtype: str + """ + return self._mode + + @mode.setter + def mode(self, mode): + """Sets the mode of this SubUserMode. + + Unified account mode: - `classic`: Classic account mode - `multi_currency`: Multi-currency margin mode - `portfolio`: Portfolio margin mode # noqa: E501 + + :param mode: The mode of this SubUserMode. # noqa: E501 + :type: str + """ + + self._mode = 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, SubUserMode): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, SubUserMode): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/swap_coin.py b/gate_api/models/swap_coin.py new file mode 100644 index 0000000..14d56e4 --- /dev/null +++ b/gate_api/models/swap_coin.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 SwapCoin(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'side': 'str', + 'amount': 'str', + 'pid': 'int' + } + + attribute_map = { + 'coin': 'coin', + 'side': 'side', + 'amount': 'amount', + 'pid': 'pid' + } + + def __init__(self, coin=None, side=None, amount=None, pid=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, int, Configuration) -> None + """SwapCoin - a 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._side = None + self._amount = None + self._pid = None + self.discriminator = None + + self.coin = coin + self.side = side + self.amount = amount + if pid is not None: + self.pid = pid + + @property + def coin(self): + """Gets the coin of this SwapCoin. # noqa: E501 + + Currency # noqa: E501 + + :return: The coin of this SwapCoin. # noqa: E501 + :rtype: str + """ + return self._coin + + @coin.setter + def coin(self, coin): + """Sets the coin of this SwapCoin. + + Currency # noqa: E501 + + :param coin: The coin of this SwapCoin. # 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 side(self): + """Gets the side of this SwapCoin. # noqa: E501 + + 0 - Stake 1 - Redeem # noqa: E501 + + :return: The side of this SwapCoin. # noqa: E501 + :rtype: str + """ + return self._side + + @side.setter + def side(self, side): + """Sets the side of this SwapCoin. + + 0 - Stake 1 - Redeem # noqa: E501 + + :param side: The side of this SwapCoin. # 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 SwapCoin. # noqa: E501 + + Size # noqa: E501 + + :return: The amount of this SwapCoin. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this SwapCoin. + + Size # noqa: E501 + + :param amount: The amount of this SwapCoin. # 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 pid(self): + """Gets the pid of this SwapCoin. # noqa: E501 + + DeFi-type Mining Protocol Identifier # noqa: E501 + + :return: The pid of this SwapCoin. # noqa: E501 + :rtype: int + """ + return self._pid + + @pid.setter + def pid(self, pid): + """Sets the pid of this SwapCoin. + + DeFi-type Mining Protocol Identifier # noqa: E501 + + :param pid: The pid of this SwapCoin. # noqa: E501 + :type: int + """ + + self._pid = pid + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SwapCoin): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, SwapCoin): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/swap_coin_struct.py b/gate_api/models/swap_coin_struct.py new file mode 100644 index 0000000..8a7ae01 --- /dev/null +++ b/gate_api/models/swap_coin_struct.py @@ -0,0 +1,515 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class SwapCoinStruct(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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': 'int', + 'uid': 'int', + 'coin': 'str', + 'type': 'int', + 'subtype': 'str', + 'amount': 'str', + 'exchange_rate': 'str', + 'exchange_amount': 'str', + 'update_stamp': 'int', + 'create_stamp': 'int', + 'status': 'int', + 'protocol_type': 'int', + 'client_order_id': 'str', + 'source': 'str' + } + + attribute_map = { + 'id': 'id', + 'pid': 'pid', + 'uid': 'uid', + 'coin': 'coin', + 'type': 'type', + 'subtype': 'subtype', + 'amount': 'amount', + 'exchange_rate': 'exchange_rate', + 'exchange_amount': 'exchange_amount', + 'update_stamp': 'updateStamp', + 'create_stamp': 'createStamp', + 'status': 'status', + 'protocol_type': 'protocol_type', + 'client_order_id': 'client_order_id', + 'source': 'source' + } + + def __init__(self, id=None, pid=None, uid=None, coin=None, type=None, subtype=None, amount=None, exchange_rate=None, exchange_amount=None, update_stamp=None, create_stamp=None, status=None, protocol_type=None, client_order_id=None, source=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, int, str, int, str, str, str, str, int, int, int, int, str, str, Configuration) -> None + """SwapCoinStruct - a 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._uid = None + self._coin = None + self._type = None + self._subtype = None + self._amount = None + self._exchange_rate = None + self._exchange_amount = None + self._update_stamp = None + self._create_stamp = None + self._status = None + self._protocol_type = None + self._client_order_id = None + self._source = None + self.discriminator = None + + if id is not None: + self.id = id + if pid is not None: + self.pid = pid + if uid is not None: + self.uid = uid + if coin is not None: + self.coin = coin + if type is not None: + self.type = type + if subtype is not None: + self.subtype = subtype + if amount is not None: + self.amount = amount + if exchange_rate is not None: + self.exchange_rate = exchange_rate + if exchange_amount is not None: + self.exchange_amount = exchange_amount + if update_stamp is not None: + self.update_stamp = update_stamp + if create_stamp is not None: + self.create_stamp = create_stamp + if status is not None: + self.status = status + if protocol_type is not None: + self.protocol_type = protocol_type + if client_order_id is not None: + self.client_order_id = client_order_id + if source is not None: + self.source = source + + @property + def id(self): + """Gets the id of this SwapCoinStruct. # noqa: E501 + + Order ID # noqa: E501 + + :return: The id of this SwapCoinStruct. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this SwapCoinStruct. + + Order ID # noqa: E501 + + :param id: The id of this SwapCoinStruct. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def pid(self): + """Gets the pid of this SwapCoinStruct. # noqa: E501 + + Product ID # noqa: E501 + + :return: The pid of this SwapCoinStruct. # noqa: E501 + :rtype: int + """ + return self._pid + + @pid.setter + def pid(self, pid): + """Sets the pid of this SwapCoinStruct. + + Product ID # noqa: E501 + + :param pid: The pid of this SwapCoinStruct. # noqa: E501 + :type: int + """ + + self._pid = pid + + @property + def uid(self): + """Gets the uid of this SwapCoinStruct. # noqa: E501 + + User ID # noqa: E501 + + :return: The uid of this SwapCoinStruct. # noqa: E501 + :rtype: int + """ + return self._uid + + @uid.setter + def uid(self, uid): + """Sets the uid of this SwapCoinStruct. + + User ID # noqa: E501 + + :param uid: The uid of this SwapCoinStruct. # noqa: E501 + :type: int + """ + + self._uid = uid + + @property + def coin(self): + """Gets the coin of this SwapCoinStruct. # noqa: E501 + + Currency # noqa: E501 + + :return: The coin of this SwapCoinStruct. # noqa: E501 + :rtype: str + """ + return self._coin + + @coin.setter + def coin(self, coin): + """Sets the coin of this SwapCoinStruct. + + Currency # noqa: E501 + + :param coin: The coin of this SwapCoinStruct. # noqa: E501 + :type: str + """ + + self._coin = coin + + @property + def type(self): + """Gets the type of this SwapCoinStruct. # noqa: E501 + + Type 0-Staking 1-Redemption # noqa: E501 + + :return: The type of this SwapCoinStruct. # noqa: E501 + :rtype: int + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this SwapCoinStruct. + + Type 0-Staking 1-Redemption # noqa: E501 + + :param type: The type of this SwapCoinStruct. # noqa: E501 + :type: int + """ + + self._type = type + + @property + def subtype(self): + """Gets the subtype of this SwapCoinStruct. # noqa: E501 + + SubType # noqa: E501 + + :return: The subtype of this SwapCoinStruct. # noqa: E501 + :rtype: str + """ + return self._subtype + + @subtype.setter + def subtype(self, subtype): + """Sets the subtype of this SwapCoinStruct. + + SubType # noqa: E501 + + :param subtype: The subtype of this SwapCoinStruct. # noqa: E501 + :type: str + """ + + self._subtype = subtype + + @property + def amount(self): + """Gets the amount of this SwapCoinStruct. # noqa: E501 + + Amount # noqa: E501 + + :return: The amount of this SwapCoinStruct. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this SwapCoinStruct. + + Amount # noqa: E501 + + :param amount: The amount of this SwapCoinStruct. # noqa: E501 + :type: str + """ + + self._amount = amount + + @property + def exchange_rate(self): + """Gets the exchange_rate of this SwapCoinStruct. # noqa: E501 + + Exchange ratio # noqa: E501 + + :return: The exchange_rate of this SwapCoinStruct. # noqa: E501 + :rtype: str + """ + return self._exchange_rate + + @exchange_rate.setter + def exchange_rate(self, exchange_rate): + """Sets the exchange_rate of this SwapCoinStruct. + + Exchange ratio # noqa: E501 + + :param exchange_rate: The exchange_rate of this SwapCoinStruct. # noqa: E501 + :type: str + """ + + self._exchange_rate = exchange_rate + + @property + def exchange_amount(self): + """Gets the exchange_amount of this SwapCoinStruct. # noqa: E501 + + Redemption Amount # noqa: E501 + + :return: The exchange_amount of this SwapCoinStruct. # noqa: E501 + :rtype: str + """ + return self._exchange_amount + + @exchange_amount.setter + def exchange_amount(self, exchange_amount): + """Sets the exchange_amount of this SwapCoinStruct. + + Redemption Amount # noqa: E501 + + :param exchange_amount: The exchange_amount of this SwapCoinStruct. # noqa: E501 + :type: str + """ + + self._exchange_amount = exchange_amount + + @property + def update_stamp(self): + """Gets the update_stamp of this SwapCoinStruct. # noqa: E501 + + UpdateTimestamp # noqa: E501 + + :return: The update_stamp of this SwapCoinStruct. # noqa: E501 + :rtype: int + """ + return self._update_stamp + + @update_stamp.setter + def update_stamp(self, update_stamp): + """Sets the update_stamp of this SwapCoinStruct. + + UpdateTimestamp # noqa: E501 + + :param update_stamp: The update_stamp of this SwapCoinStruct. # noqa: E501 + :type: int + """ + + self._update_stamp = update_stamp + + @property + def create_stamp(self): + """Gets the create_stamp of this SwapCoinStruct. # noqa: E501 + + Transaction timestamp # noqa: E501 + + :return: The create_stamp of this SwapCoinStruct. # noqa: E501 + :rtype: int + """ + return self._create_stamp + + @create_stamp.setter + def create_stamp(self, create_stamp): + """Sets the create_stamp of this SwapCoinStruct. + + Transaction timestamp # noqa: E501 + + :param create_stamp: The create_stamp of this SwapCoinStruct. # noqa: E501 + :type: int + """ + + self._create_stamp = create_stamp + + @property + def status(self): + """Gets the status of this SwapCoinStruct. # noqa: E501 + + status 1-success # noqa: E501 + + :return: The status of this SwapCoinStruct. # noqa: E501 + :rtype: int + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this SwapCoinStruct. + + status 1-success # noqa: E501 + + :param status: The status of this SwapCoinStruct. # noqa: E501 + :type: int + """ + + self._status = status + + @property + def protocol_type(self): + """Gets the protocol_type of this SwapCoinStruct. # noqa: E501 + + DEFI Protocol Type # noqa: E501 + + :return: The protocol_type of this SwapCoinStruct. # noqa: E501 + :rtype: int + """ + return self._protocol_type + + @protocol_type.setter + def protocol_type(self, protocol_type): + """Sets the protocol_type of this SwapCoinStruct. + + DEFI Protocol Type # noqa: E501 + + :param protocol_type: The protocol_type of this SwapCoinStruct. # noqa: E501 + :type: int + """ + + self._protocol_type = protocol_type + + @property + def client_order_id(self): + """Gets the client_order_id of this SwapCoinStruct. # noqa: E501 + + Reference ID # noqa: E501 + + :return: The client_order_id of this SwapCoinStruct. # 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 SwapCoinStruct. + + Reference ID # noqa: E501 + + :param client_order_id: The client_order_id of this SwapCoinStruct. # noqa: E501 + :type: str + """ + + self._client_order_id = client_order_id + + @property + def source(self): + """Gets the source of this SwapCoinStruct. # noqa: E501 + + Order Origin # noqa: E501 + + :return: The source of this SwapCoinStruct. # noqa: E501 + :rtype: str + """ + return self._source + + @source.setter + def source(self, source): + """Sets the source of this SwapCoinStruct. + + Order Origin # noqa: E501 + + :param source: The source of this SwapCoinStruct. # noqa: E501 + :type: str + """ + + self._source = 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, SwapCoinStruct): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, SwapCoinStruct): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/system_time.py b/gate_api/models/system_time.py new file mode 100644 index 0000000..285a0e7 --- /dev/null +++ b/gate_api/models/system_time.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 SystemTime(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'server_time': 'int' + } + + attribute_map = { + 'server_time': 'server_time' + } + + def __init__(self, server_time=None, local_vars_configuration=None): # noqa: E501 + # type: (int, Configuration) -> None + """SystemTime - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._server_time = None + self.discriminator = None + + if server_time is not None: + self.server_time = server_time + + @property + def server_time(self): + """Gets the server_time of this SystemTime. # noqa: E501 + + Server current time(ms) # noqa: E501 + + :return: The server_time of this SystemTime. # noqa: E501 + :rtype: int + """ + return self._server_time + + @server_time.setter + def server_time(self, server_time): + """Sets the server_time of this SystemTime. + + Server current time(ms) # noqa: E501 + + :param server_time: The server_time of this SystemTime. # noqa: E501 + :type: int + """ + + self._server_time = server_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, SystemTime): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, SystemTime): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/ticker.py b/gate_api/models/ticker.py index 290e714..289c557 100644 --- a/gate_api/models/ticker.py +++ b/gate_api/models/ticker.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -36,8 +36,12 @@ class Ticker(object): 'currency_pair': 'str', 'last': 'str', 'lowest_ask': 'str', + 'lowest_size': 'str', 'highest_bid': 'str', + 'highest_size': 'str', 'change_percentage': 'str', + 'change_utc0': 'str', + 'change_utc8': 'str', 'base_volume': 'str', 'quote_volume': 'str', 'high_24h': 'str', @@ -45,15 +49,19 @@ class Ticker(object): 'etf_net_value': 'str', 'etf_pre_net_value': 'str', 'etf_pre_timestamp': 'int', - 'etf_leverage': 'str', + 'etf_leverage': 'str' } attribute_map = { 'currency_pair': 'currency_pair', 'last': 'last', 'lowest_ask': 'lowest_ask', + 'lowest_size': 'lowest_size', 'highest_bid': 'highest_bid', + 'highest_size': 'highest_size', 'change_percentage': 'change_percentage', + 'change_utc0': 'change_utc0', + 'change_utc8': 'change_utc8', 'base_volume': 'base_volume', 'quote_volume': 'quote_volume', 'high_24h': 'high_24h', @@ -61,27 +69,11 @@ class Ticker(object): 'etf_net_value': 'etf_net_value', 'etf_pre_net_value': 'etf_pre_net_value', 'etf_pre_timestamp': 'etf_pre_timestamp', - 'etf_leverage': 'etf_leverage', + 'etf_leverage': 'etf_leverage' } - def __init__( - self, - currency_pair=None, - last=None, - lowest_ask=None, - highest_bid=None, - change_percentage=None, - base_volume=None, - quote_volume=None, - high_24h=None, - low_24h=None, - etf_net_value=None, - etf_pre_net_value=None, - etf_pre_timestamp=None, - etf_leverage=None, - local_vars_configuration=None, - ): # noqa: E501 - # type: (str, str, str, str, str, str, str, str, str, str, str, int, str, Configuration) -> None + def __init__(self, currency_pair=None, last=None, lowest_ask=None, lowest_size=None, highest_bid=None, highest_size=None, change_percentage=None, change_utc0=None, change_utc8=None, base_volume=None, quote_volume=None, high_24h=None, low_24h=None, etf_net_value=None, etf_pre_net_value=None, etf_pre_timestamp=None, etf_leverage=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, int, str, Configuration) -> None """Ticker - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -90,8 +82,12 @@ def __init__( self._currency_pair = None self._last = None self._lowest_ask = None + self._lowest_size = None self._highest_bid = None + self._highest_size = None self._change_percentage = None + self._change_utc0 = None + self._change_utc8 = None self._base_volume = None self._quote_volume = None self._high_24h = None @@ -108,10 +104,18 @@ def __init__( self.last = last if lowest_ask is not None: self.lowest_ask = lowest_ask + if lowest_size is not None: + self.lowest_size = lowest_size if highest_bid is not None: self.highest_bid = highest_bid + if highest_size is not None: + self.highest_size = highest_size if change_percentage is not None: self.change_percentage = change_percentage + if change_utc0 is not None: + self.change_utc0 = change_utc0 + if change_utc8 is not None: + self.change_utc8 = change_utc8 if base_volume is not None: self.base_volume = base_volume if quote_volume is not None: @@ -176,7 +180,7 @@ def last(self, last): def lowest_ask(self): """Gets the lowest_ask of this Ticker. # noqa: E501 - Lowest ask # noqa: E501 + Recent lowest ask # noqa: E501 :return: The lowest_ask of this Ticker. # noqa: E501 :rtype: str @@ -187,7 +191,7 @@ def lowest_ask(self): def lowest_ask(self, lowest_ask): """Sets the lowest_ask of this Ticker. - Lowest ask # noqa: E501 + Recent lowest ask # noqa: E501 :param lowest_ask: The lowest_ask of this Ticker. # noqa: E501 :type: str @@ -195,11 +199,34 @@ def lowest_ask(self, lowest_ask): self._lowest_ask = lowest_ask + @property + def lowest_size(self): + """Gets the lowest_size of this Ticker. # noqa: E501 + + Latest seller's lowest price quantity; not available for batch queries; available for single queries, empty if no data # noqa: E501 + + :return: The lowest_size of this Ticker. # noqa: E501 + :rtype: str + """ + return self._lowest_size + + @lowest_size.setter + def lowest_size(self, lowest_size): + """Sets the lowest_size of this Ticker. + + Latest seller's lowest price quantity; not available for batch queries; available for single queries, empty if no data # noqa: E501 + + :param lowest_size: The lowest_size of this Ticker. # noqa: E501 + :type: str + """ + + self._lowest_size = lowest_size + @property def highest_bid(self): """Gets the highest_bid of this Ticker. # noqa: E501 - Highest bid # noqa: E501 + Recent highest bid # noqa: E501 :return: The highest_bid of this Ticker. # noqa: E501 :rtype: str @@ -210,7 +237,7 @@ def highest_bid(self): def highest_bid(self, highest_bid): """Sets the highest_bid of this Ticker. - Highest bid # noqa: E501 + Recent highest bid # noqa: E501 :param highest_bid: The highest_bid of this Ticker. # noqa: E501 :type: str @@ -218,11 +245,34 @@ def highest_bid(self, highest_bid): self._highest_bid = highest_bid + @property + def highest_size(self): + """Gets the highest_size of this Ticker. # noqa: E501 + + Latest buyer's highest price quantity; not available for batch queries; available for single queries, empty if no data # noqa: E501 + + :return: The highest_size of this Ticker. # noqa: E501 + :rtype: str + """ + return self._highest_size + + @highest_size.setter + def highest_size(self, highest_size): + """Sets the highest_size of this Ticker. + + Latest buyer's highest price quantity; not available for batch queries; available for single queries, empty if no data # noqa: E501 + + :param highest_size: The highest_size of this Ticker. # noqa: E501 + :type: str + """ + + self._highest_size = highest_size + @property def change_percentage(self): """Gets the change_percentage of this Ticker. # noqa: E501 - Change percentage. # noqa: E501 + 24h price change percentage (negative for decrease, e.g., -7.45) # noqa: E501 :return: The change_percentage of this Ticker. # noqa: E501 :rtype: str @@ -233,7 +283,7 @@ def change_percentage(self): def change_percentage(self, change_percentage): """Sets the change_percentage of this Ticker. - Change percentage. # noqa: E501 + 24h price change percentage (negative for decrease, e.g., -7.45) # noqa: E501 :param change_percentage: The change_percentage of this Ticker. # noqa: E501 :type: str @@ -241,11 +291,57 @@ def change_percentage(self, change_percentage): self._change_percentage = change_percentage + @property + def change_utc0(self): + """Gets the change_utc0 of this Ticker. # noqa: E501 + + UTC+0 timezone, 24h price change percentage, negative for decline (e.g., -7.45) # noqa: E501 + + :return: The change_utc0 of this Ticker. # noqa: E501 + :rtype: str + """ + return self._change_utc0 + + @change_utc0.setter + def change_utc0(self, change_utc0): + """Sets the change_utc0 of this Ticker. + + UTC+0 timezone, 24h price change percentage, negative for decline (e.g., -7.45) # noqa: E501 + + :param change_utc0: The change_utc0 of this Ticker. # noqa: E501 + :type: str + """ + + self._change_utc0 = change_utc0 + + @property + def change_utc8(self): + """Gets the change_utc8 of this Ticker. # noqa: E501 + + UTC+8 timezone, 24h price change percentage, negative for decline (e.g., -7.45) # noqa: E501 + + :return: The change_utc8 of this Ticker. # noqa: E501 + :rtype: str + """ + return self._change_utc8 + + @change_utc8.setter + def change_utc8(self, change_utc8): + """Sets the change_utc8 of this Ticker. + + UTC+8 timezone, 24h price change percentage, negative for decline (e.g., -7.45) # noqa: E501 + + :param change_utc8: The change_utc8 of this Ticker. # noqa: E501 + :type: str + """ + + self._change_utc8 = change_utc8 + @property def base_volume(self): """Gets the base_volume of this Ticker. # noqa: E501 - Base currency trade volume # noqa: E501 + Base currency trading volume in the last 24h # noqa: E501 :return: The base_volume of this Ticker. # noqa: E501 :rtype: str @@ -256,7 +352,7 @@ def base_volume(self): def base_volume(self, base_volume): """Sets the base_volume of this Ticker. - Base currency trade volume # noqa: E501 + Base currency trading volume in the last 24h # noqa: E501 :param base_volume: The base_volume of this Ticker. # noqa: E501 :type: str @@ -268,7 +364,7 @@ def base_volume(self, base_volume): def quote_volume(self): """Gets the quote_volume of this Ticker. # noqa: E501 - Quote currency trade volume # noqa: E501 + Quote currency trading volume in the last 24h # noqa: E501 :return: The quote_volume of this Ticker. # noqa: E501 :rtype: str @@ -279,7 +375,7 @@ def quote_volume(self): def quote_volume(self, quote_volume): """Sets the quote_volume of this Ticker. - Quote currency trade volume # noqa: E501 + Quote currency trading volume in the last 24h # noqa: E501 :param quote_volume: The quote_volume of this Ticker. # noqa: E501 :type: str @@ -291,7 +387,7 @@ def quote_volume(self, quote_volume): def high_24h(self): """Gets the high_24h of this Ticker. # noqa: E501 - Highest price in 24h # noqa: E501 + 24h High # noqa: E501 :return: The high_24h of this Ticker. # noqa: E501 :rtype: str @@ -302,7 +398,7 @@ def high_24h(self): def high_24h(self, high_24h): """Sets the high_24h of this Ticker. - Highest price in 24h # noqa: E501 + 24h High # noqa: E501 :param high_24h: The high_24h of this Ticker. # noqa: E501 :type: str @@ -314,7 +410,7 @@ def high_24h(self, high_24h): def low_24h(self): """Gets the low_24h of this Ticker. # noqa: E501 - Lowest price in 24h # noqa: E501 + 24h Low # noqa: E501 :return: The low_24h of this Ticker. # noqa: E501 :rtype: str @@ -325,7 +421,7 @@ def low_24h(self): def low_24h(self, low_24h): """Sets the low_24h of this Ticker. - Lowest price in 24h # noqa: E501 + 24h Low # noqa: E501 :param low_24h: The low_24h of this Ticker. # noqa: E501 :type: str @@ -360,7 +456,7 @@ def etf_net_value(self, etf_net_value): def etf_pre_net_value(self): """Gets the etf_pre_net_value of this Ticker. # noqa: E501 - ETF previous net value at re-balancing time # noqa: E501 + ETF net value at previous rebalancing point # noqa: E501 :return: The etf_pre_net_value of this Ticker. # noqa: E501 :rtype: str @@ -371,7 +467,7 @@ def etf_pre_net_value(self): def etf_pre_net_value(self, etf_pre_net_value): """Sets the etf_pre_net_value of this Ticker. - ETF previous net value at re-balancing time # noqa: E501 + ETF net value at previous rebalancing point # noqa: E501 :param etf_pre_net_value: The etf_pre_net_value of this Ticker. # noqa: E501 :type: str @@ -383,7 +479,7 @@ def etf_pre_net_value(self, etf_pre_net_value): def etf_pre_timestamp(self): """Gets the etf_pre_timestamp of this Ticker. # noqa: E501 - ETF previous re-balancing time # noqa: E501 + ETF previous rebalancing time # noqa: E501 :return: The etf_pre_timestamp of this Ticker. # noqa: E501 :rtype: int @@ -394,7 +490,7 @@ def etf_pre_timestamp(self): def etf_pre_timestamp(self, etf_pre_timestamp): """Sets the etf_pre_timestamp of this Ticker. - ETF previous re-balancing time # noqa: E501 + ETF previous rebalancing time # noqa: E501 :param etf_pre_timestamp: The etf_pre_timestamp of this Ticker. # noqa: E501 :type: int @@ -432,16 +528,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/total_balance.py b/gate_api/models/total_balance.py index 89364a5..9dd8b78 100644 --- a/gate_api/models/total_balance.py +++ b/gate_api/models/total_balance.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -32,9 +32,15 @@ class TotalBalance(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {'total': 'AccountBalance', 'details': 'dict(str, AccountBalance)'} + openapi_types = { + 'total': 'AccountBalance', + 'details': 'dict(str, AccountBalance)' + } - attribute_map = {'total': 'total', 'details': 'details'} + attribute_map = { + 'total': 'total', + 'details': 'details' + } def __init__(self, total=None, details=None, local_vars_configuration=None): # noqa: E501 # type: (AccountBalance, dict(str, AccountBalance), Configuration) -> None @@ -77,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: futures account - delivery: delivery account - warrant: warrant account - cbbc: cbbc account # 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 :return: The details of this TotalBalance. # noqa: E501 :rtype: dict(str, AccountBalance) @@ -88,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: futures account - delivery: delivery account - warrant: warrant account - cbbc: cbbc account # 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 :param details: The details of this TotalBalance. # noqa: E501 :type: dict(str, AccountBalance) @@ -103,16 +109,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/trade.py b/gate_api/models/trade.py index 305ebaf..7fbeff8 100644 --- a/gate_api/models/trade.py +++ b/gate_api/models/trade.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -46,6 +46,9 @@ class Trade(object): 'fee_currency': 'str', 'point_fee': 'str', 'gt_fee': 'str', + 'amend_text': 'str', + 'sequence_id': 'str', + 'text': 'str' } attribute_map = { @@ -62,26 +65,13 @@ class Trade(object): 'fee_currency': 'fee_currency', 'point_fee': 'point_fee', 'gt_fee': 'gt_fee', + 'amend_text': 'amend_text', + 'sequence_id': 'sequence_id', + 'text': 'text' } - def __init__( - self, - id=None, - create_time=None, - create_time_ms=None, - currency_pair=None, - side=None, - role=None, - amount=None, - price=None, - order_id=None, - fee=None, - fee_currency=None, - point_fee=None, - gt_fee=None, - local_vars_configuration=None, - ): # noqa: E501 - # type: (str, str, str, str, str, str, str, str, str, str, str, str, str, Configuration) -> None + def __init__(self, id=None, create_time=None, create_time_ms=None, currency_pair=None, side=None, role=None, amount=None, price=None, order_id=None, fee=None, fee_currency=None, point_fee=None, gt_fee=None, amend_text=None, sequence_id=None, text=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, Configuration) -> None """Trade - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -100,6 +90,9 @@ def __init__( self._fee_currency = None self._point_fee = None self._gt_fee = None + self._amend_text = None + self._sequence_id = None + self._text = None self.discriminator = None if id is not None: @@ -128,12 +121,18 @@ def __init__( self.point_fee = point_fee if gt_fee is not None: self.gt_fee = gt_fee + if amend_text is not None: + self.amend_text = amend_text + if sequence_id is not None: + self.sequence_id = sequence_id + if text is not None: + self.text = text @property def id(self): """Gets the id of this Trade. # noqa: E501 - Trade ID # noqa: E501 + Fill ID # noqa: E501 :return: The id of this Trade. # noqa: E501 :rtype: str @@ -144,7 +143,7 @@ def id(self): def id(self, id): """Sets the id of this Trade. - Trade ID # noqa: E501 + Fill ID # noqa: E501 :param id: The id of this Trade. # noqa: E501 :type: str @@ -156,7 +155,7 @@ def id(self, id): def create_time(self): """Gets the create_time of this Trade. # noqa: E501 - Trading time # noqa: E501 + Fill Time # noqa: E501 :return: The create_time of this Trade. # noqa: E501 :rtype: str @@ -167,7 +166,7 @@ def create_time(self): def create_time(self, create_time): """Sets the create_time of this Trade. - Trading time # noqa: E501 + Fill Time # noqa: E501 :param create_time: The create_time of this Trade. # noqa: E501 :type: str @@ -225,7 +224,7 @@ def currency_pair(self, currency_pair): def side(self): """Gets the side of this Trade. # noqa: E501 - Order side # noqa: E501 + Buy or sell order # noqa: E501 :return: The side of this Trade. # noqa: E501 :rtype: str @@ -236,7 +235,7 @@ def side(self): def side(self, side): """Sets the side of this Trade. - Order side # noqa: E501 + Buy or sell order # noqa: E501 :param side: The side of this Trade. # noqa: E501 :type: str @@ -244,7 +243,8 @@ def side(self, side): 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}".format(side, allowed_values) # noqa: E501 + "Invalid value for `side` ({0}), must be one of {1}" # noqa: E501 + .format(side, allowed_values) ) self._side = side @@ -253,7 +253,7 @@ def side(self, side): def role(self): """Gets the role of this Trade. # noqa: E501 - Trade role # noqa: E501 + Trade role, not returned in public endpoints # noqa: E501 :return: The role of this Trade. # noqa: E501 :rtype: str @@ -264,7 +264,7 @@ def role(self): def role(self, role): """Sets the role of this Trade. - Trade role # noqa: E501 + Trade role, not returned in public endpoints # noqa: E501 :param role: The role of this Trade. # noqa: E501 :type: str @@ -272,7 +272,8 @@ def role(self, role): allowed_values = ["taker", "maker"] # noqa: E501 if self.local_vars_configuration.client_side_validation and role not in allowed_values: # noqa: E501 raise ValueError( - "Invalid value for `role` ({0}), must be one of {1}".format(role, allowed_values) # noqa: E501 + "Invalid value for `role` ({0}), must be one of {1}" # noqa: E501 + .format(role, allowed_values) ) self._role = role @@ -327,7 +328,7 @@ def price(self, price): def order_id(self): """Gets the order_id of this Trade. # noqa: E501 - Related order ID. No value in public endpoints # noqa: E501 + Related order ID, not returned in public endpoints # noqa: E501 :return: The order_id of this Trade. # noqa: E501 :rtype: str @@ -338,7 +339,7 @@ def order_id(self): def order_id(self, order_id): """Sets the order_id of this Trade. - Related order ID. No value in public endpoints # noqa: E501 + Related order ID, not returned in public endpoints # noqa: E501 :param order_id: The order_id of this Trade. # noqa: E501 :type: str @@ -350,7 +351,7 @@ def order_id(self, order_id): def fee(self): """Gets the fee of this Trade. # noqa: E501 - Fee deducted. No value in public endpoints # noqa: E501 + Fee deducted, not returned in public endpoints # noqa: E501 :return: The fee of this Trade. # noqa: E501 :rtype: str @@ -361,7 +362,7 @@ def fee(self): def fee(self, fee): """Sets the fee of this Trade. - Fee deducted. No value in public endpoints # noqa: E501 + Fee deducted, not returned in public endpoints # noqa: E501 :param fee: The fee of this Trade. # noqa: E501 :type: str @@ -373,7 +374,7 @@ def fee(self, fee): def fee_currency(self): """Gets the fee_currency of this Trade. # noqa: E501 - Fee currency unit. No value in public endpoints # noqa: E501 + Fee currency unit, not returned in public endpoints # noqa: E501 :return: The fee_currency of this Trade. # noqa: E501 :rtype: str @@ -384,7 +385,7 @@ def fee_currency(self): def fee_currency(self, fee_currency): """Sets the fee_currency of this Trade. - Fee currency unit. No value in public endpoints # noqa: E501 + Fee currency unit, not returned in public endpoints # noqa: E501 :param fee_currency: The fee_currency of this Trade. # noqa: E501 :type: str @@ -396,7 +397,7 @@ def fee_currency(self, fee_currency): def point_fee(self): """Gets the point_fee of this Trade. # noqa: E501 - Points used to deduct fee # noqa: E501 + Points used to deduct fee, not returned in public endpoints # noqa: E501 :return: The point_fee of this Trade. # noqa: E501 :rtype: str @@ -407,7 +408,7 @@ def point_fee(self): def point_fee(self, point_fee): """Sets the point_fee of this Trade. - Points used to deduct fee # noqa: E501 + Points used to deduct fee, not returned in public endpoints # noqa: E501 :param point_fee: The point_fee of this Trade. # noqa: E501 :type: str @@ -419,7 +420,7 @@ def point_fee(self, point_fee): def gt_fee(self): """Gets the gt_fee of this Trade. # noqa: E501 - GT used to deduct fee # noqa: E501 + GT used to deduct fee, not returned in public endpoints # noqa: E501 :return: The gt_fee of this Trade. # noqa: E501 :rtype: str @@ -430,7 +431,7 @@ def gt_fee(self): def gt_fee(self, gt_fee): """Sets the gt_fee of this Trade. - GT used to deduct fee # noqa: E501 + GT used to deduct fee, not returned in public endpoints # noqa: E501 :param gt_fee: The gt_fee of this Trade. # noqa: E501 :type: str @@ -438,6 +439,75 @@ def gt_fee(self, gt_fee): self._gt_fee = gt_fee + @property + def amend_text(self): + """Gets the amend_text of this Trade. # noqa: E501 + + The custom data that the user remarked when amending the order # noqa: E501 + + :return: The amend_text of this Trade. # noqa: E501 + :rtype: str + """ + return self._amend_text + + @amend_text.setter + def amend_text(self, amend_text): + """Sets the amend_text of this Trade. + + The custom data that the user remarked when amending the order # noqa: E501 + + :param amend_text: The amend_text of this Trade. # noqa: E501 + :type: str + """ + + self._amend_text = amend_text + + @property + def sequence_id(self): + """Gets the sequence_id of this Trade. # noqa: E501 + + Consecutive trade ID within a single market. Used to track and identify trades in the specific market # noqa: E501 + + :return: The sequence_id of this Trade. # noqa: E501 + :rtype: str + """ + return self._sequence_id + + @sequence_id.setter + def sequence_id(self, sequence_id): + """Sets the sequence_id of this Trade. + + Consecutive trade ID within a single market. Used to track and identify trades in the specific market # noqa: E501 + + :param sequence_id: The sequence_id of this Trade. # noqa: E501 + :type: str + """ + + self._sequence_id = sequence_id + + @property + def text(self): + """Gets the text of this Trade. # noqa: E501 + + User-defined information, not returned in public endpoints # noqa: E501 + + :return: The text of this Trade. # noqa: E501 + :rtype: str + """ + return self._text + + @text.setter + def text(self, text): + """Sets the text of this Trade. + + User-defined information, not returned in public endpoints # noqa: E501 + + :param text: The text of this Trade. # noqa: E501 + :type: str + """ + + self._text = text + def to_dict(self): """Returns the model properties as a dict""" result = {} @@ -445,16 +515,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/trade_fee.py b/gate_api/models/trade_fee.py index 3fae191..7b3fd5a 100644 --- a/gate_api/models/trade_fee.py +++ b/gate_api/models/trade_fee.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -43,6 +43,9 @@ class TradeFee(object): 'point_type': 'str', 'futures_taker_fee': 'str', 'futures_maker_fee': 'str', + 'delivery_taker_fee': 'str', + 'delivery_maker_fee': 'str', + 'debit_fee': 'int' } attribute_map = { @@ -56,23 +59,13 @@ class TradeFee(object): 'point_type': 'point_type', 'futures_taker_fee': 'futures_taker_fee', 'futures_maker_fee': 'futures_maker_fee', + 'delivery_taker_fee': 'delivery_taker_fee', + 'delivery_maker_fee': 'delivery_maker_fee', + 'debit_fee': 'debit_fee' } - def __init__( - self, - user_id=None, - taker_fee=None, - maker_fee=None, - gt_discount=None, - gt_taker_fee=None, - gt_maker_fee=None, - loan_fee=None, - point_type=None, - futures_taker_fee=None, - futures_maker_fee=None, - local_vars_configuration=None, - ): # noqa: E501 - # type: (int, str, str, bool, str, str, str, str, str, str, Configuration) -> None + def __init__(self, user_id=None, taker_fee=None, maker_fee=None, gt_discount=None, gt_taker_fee=None, gt_maker_fee=None, loan_fee=None, point_type=None, futures_taker_fee=None, futures_maker_fee=None, delivery_taker_fee=None, delivery_maker_fee=None, debit_fee=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, str, bool, str, str, str, str, str, str, str, str, int, Configuration) -> None """TradeFee - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -88,6 +81,9 @@ def __init__( self._point_type = None self._futures_taker_fee = None self._futures_maker_fee = None + self._delivery_taker_fee = None + self._delivery_maker_fee = None + self._debit_fee = None self.discriminator = None if user_id is not None: @@ -110,6 +106,12 @@ def __init__( self.futures_taker_fee = futures_taker_fee if futures_maker_fee is not None: self.futures_maker_fee = futures_maker_fee + if delivery_taker_fee is not None: + self.delivery_taker_fee = delivery_taker_fee + if delivery_maker_fee is not None: + self.delivery_maker_fee = delivery_maker_fee + if debit_fee is not None: + self.debit_fee = debit_fee @property def user_id(self): @@ -184,7 +186,7 @@ def maker_fee(self, maker_fee): def gt_discount(self): """Gets the gt_discount of this TradeFee. # noqa: E501 - If GT deduction is enabled # noqa: E501 + Whether GT deduction discount is enabled # noqa: E501 :return: The gt_discount of this TradeFee. # noqa: E501 :rtype: bool @@ -195,7 +197,7 @@ def gt_discount(self): def gt_discount(self, gt_discount): """Sets the gt_discount of this TradeFee. - If GT deduction is enabled # noqa: E501 + Whether GT deduction discount is enabled # noqa: E501 :param gt_discount: The gt_discount of this TradeFee. # noqa: E501 :type: bool @@ -230,7 +232,7 @@ def gt_taker_fee(self, gt_taker_fee): def gt_maker_fee(self): """Gets the gt_maker_fee of this TradeFee. # noqa: E501 - Maker fee rate if using GT deduction. It will be 0 if GT deduction is disabled # noqa: E501 + Maker fee rate with GT deduction. Returns 0 if GT deduction is disabled # noqa: E501 :return: The gt_maker_fee of this TradeFee. # noqa: E501 :rtype: str @@ -241,7 +243,7 @@ def gt_maker_fee(self): def gt_maker_fee(self, gt_maker_fee): """Sets the gt_maker_fee of this TradeFee. - Maker fee rate if using GT deduction. It will be 0 if GT deduction is disabled # noqa: E501 + Maker fee rate with GT deduction. Returns 0 if GT deduction is disabled # noqa: E501 :param gt_maker_fee: The gt_maker_fee of this TradeFee. # noqa: E501 :type: str @@ -276,7 +278,7 @@ def loan_fee(self, loan_fee): def point_type(self): """Gets the point_type of this TradeFee. # noqa: E501 - Point type. 0 - Initial version. 1 - new version since 202009 # noqa: E501 + Point card type: 0 - Original version, 1 - New version since 202009 # noqa: E501 :return: The point_type of this TradeFee. # noqa: E501 :rtype: str @@ -287,7 +289,7 @@ def point_type(self): def point_type(self, point_type): """Sets the point_type of this TradeFee. - Point type. 0 - Initial version. 1 - new version since 202009 # noqa: E501 + Point card type: 0 - Original version, 1 - New version since 202009 # noqa: E501 :param point_type: The point_type of this TradeFee. # noqa: E501 :type: str @@ -299,7 +301,7 @@ def point_type(self, point_type): def futures_taker_fee(self): """Gets the futures_taker_fee of this TradeFee. # noqa: E501 - Futures trading taker fee # noqa: E501 + Perpetual contract taker fee rate # noqa: E501 :return: The futures_taker_fee of this TradeFee. # noqa: E501 :rtype: str @@ -310,7 +312,7 @@ def futures_taker_fee(self): def futures_taker_fee(self, futures_taker_fee): """Sets the futures_taker_fee of this TradeFee. - Futures trading taker fee # noqa: E501 + Perpetual contract taker fee rate # noqa: E501 :param futures_taker_fee: The futures_taker_fee of this TradeFee. # noqa: E501 :type: str @@ -322,7 +324,7 @@ def futures_taker_fee(self, futures_taker_fee): def futures_maker_fee(self): """Gets the futures_maker_fee of this TradeFee. # noqa: E501 - Future trading maker fee # noqa: E501 + Perpetual contract maker fee rate # noqa: E501 :return: The futures_maker_fee of this TradeFee. # noqa: E501 :rtype: str @@ -333,7 +335,7 @@ def futures_maker_fee(self): def futures_maker_fee(self, futures_maker_fee): """Sets the futures_maker_fee of this TradeFee. - Future trading maker fee # noqa: E501 + Perpetual contract maker fee rate # noqa: E501 :param futures_maker_fee: The futures_maker_fee of this TradeFee. # noqa: E501 :type: str @@ -341,6 +343,75 @@ def futures_maker_fee(self, futures_maker_fee): self._futures_maker_fee = futures_maker_fee + @property + def delivery_taker_fee(self): + """Gets the delivery_taker_fee of this TradeFee. # noqa: E501 + + Delivery contract taker fee rate # noqa: E501 + + :return: The delivery_taker_fee of this TradeFee. # noqa: E501 + :rtype: str + """ + return self._delivery_taker_fee + + @delivery_taker_fee.setter + def delivery_taker_fee(self, delivery_taker_fee): + """Sets the delivery_taker_fee of this TradeFee. + + Delivery contract taker fee rate # noqa: E501 + + :param delivery_taker_fee: The delivery_taker_fee of this TradeFee. # noqa: E501 + :type: str + """ + + self._delivery_taker_fee = delivery_taker_fee + + @property + def delivery_maker_fee(self): + """Gets the delivery_maker_fee of this TradeFee. # noqa: E501 + + Delivery contract maker fee rate # noqa: E501 + + :return: The delivery_maker_fee of this TradeFee. # noqa: E501 + :rtype: str + """ + return self._delivery_maker_fee + + @delivery_maker_fee.setter + def delivery_maker_fee(self, delivery_maker_fee): + """Sets the delivery_maker_fee of this TradeFee. + + Delivery contract maker fee rate # noqa: E501 + + :param delivery_maker_fee: The delivery_maker_fee of this TradeFee. # noqa: E501 + :type: str + """ + + self._delivery_maker_fee = delivery_maker_fee + + @property + def debit_fee(self): + """Gets the debit_fee of this TradeFee. # noqa: E501 + + Deduction types for rates, 1 - GT deduction, 2 - Point card deduction, 3 - VIP rates # noqa: E501 + + :return: The debit_fee of this TradeFee. # noqa: E501 + :rtype: int + """ + return self._debit_fee + + @debit_fee.setter + def debit_fee(self, debit_fee): + """Sets the debit_fee of this TradeFee. + + Deduction types for rates, 1 - GT deduction, 2 - Point card deduction, 3 - VIP rates # noqa: E501 + + :param debit_fee: The debit_fee of this TradeFee. # noqa: E501 + :type: int + """ + + self._debit_fee = debit_fee + def to_dict(self): """Returns the model properties as a dict""" result = {} @@ -348,16 +419,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/transaction_id.py b/gate_api/models/transaction_id.py new file mode 100644 index 0000000..d902340 --- /dev/null +++ b/gate_api/models/transaction_id.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 TransactionID(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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': 'int' + } + + attribute_map = { + 'tx_id': 'tx_id' + } + + def __init__(self, tx_id=None, local_vars_configuration=None): # noqa: E501 + # type: (int, Configuration) -> None + """TransactionID - a 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.discriminator = None + + if tx_id is not None: + self.tx_id = tx_id + + @property + def tx_id(self): + """Gets the tx_id of this TransactionID. # noqa: E501 + + Order ID # noqa: E501 + + :return: The tx_id of this TransactionID. # noqa: E501 + :rtype: int + """ + return self._tx_id + + @tx_id.setter + def tx_id(self, tx_id): + """Sets the tx_id of this TransactionID. + + Order ID # noqa: E501 + + :param tx_id: The tx_id of this TransactionID. # noqa: E501 + :type: int + """ + + self._tx_id = tx_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, TransactionID): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, TransactionID): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/transfer.py b/gate_api/models/transfer.py index 96a5db2..aaf2469 100644 --- a/gate_api/models/transfer.py +++ b/gate_api/models/transfer.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -38,7 +38,7 @@ class Transfer(object): 'to': 'str', 'amount': 'str', 'currency_pair': 'str', - 'settle': 'str', + 'settle': 'str' } attribute_map = { @@ -47,19 +47,10 @@ class Transfer(object): 'to': 'to', 'amount': 'amount', 'currency_pair': 'currency_pair', - 'settle': 'settle', + 'settle': 'settle' } - def __init__( - self, - currency=None, - _from=None, - to=None, - amount=None, - currency_pair=None, - settle=None, - local_vars_configuration=None, - ): # noqa: E501 + def __init__(self, currency=None, _from=None, to=None, amount=None, currency_pair=None, settle=None, local_vars_configuration=None): # noqa: E501 # type: (str, str, str, str, str, str, Configuration) -> None """Transfer - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: @@ -87,7 +78,7 @@ def __init__( def currency(self): """Gets the currency of this Transfer. # noqa: E501 - Transfer currency. For futures account, `currency` can be set to `POINT` or settle currency # noqa: E501 + Transfer currency name. For contract accounts, `currency` can be set to `POINT` (points) or supported settlement currencies (e.g., `BTC`, `USDT`) # noqa: E501 :return: The currency of this Transfer. # noqa: E501 :rtype: str @@ -98,7 +89,7 @@ def currency(self): def currency(self, currency): """Sets the currency of this Transfer. - Transfer currency. For futures account, `currency` can be set to `POINT` or settle currency # noqa: E501 + Transfer currency name. For contract accounts, `currency` can be set to `POINT` (points) or supported settlement currencies (e.g., `BTC`, `USDT`) # noqa: E501 :param currency: The currency of this Transfer. # noqa: E501 :type: str @@ -130,10 +121,11 @@ def _from(self, _from): """ 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 - allowed_values = ["spot", "margin", "futures", "delivery", "cross_margin"] # noqa: E501 + allowed_values = ["spot", "margin", "futures", "delivery", "options"] # noqa: E501 if self.local_vars_configuration.client_side_validation and _from not in allowed_values: # noqa: E501 raise ValueError( - "Invalid value for `_from` ({0}), must be one of {1}".format(_from, allowed_values) # noqa: E501 + "Invalid value for `_from` ({0}), must be one of {1}" # noqa: E501 + .format(_from, allowed_values) ) self.__from = _from @@ -160,10 +152,11 @@ def to(self, to): """ 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 - allowed_values = ["spot", "margin", "futures", "delivery", "cross_margin"] # noqa: E501 + allowed_values = ["spot", "margin", "futures", "delivery", "options"] # noqa: E501 if self.local_vars_configuration.client_side_validation and to not in allowed_values: # noqa: E501 raise ValueError( - "Invalid value for `to` ({0}), must be one of {1}".format(to, allowed_values) # noqa: E501 + "Invalid value for `to` ({0}), must be one of {1}" # noqa: E501 + .format(to, allowed_values) ) self._to = to @@ -197,7 +190,7 @@ def amount(self, amount): def currency_pair(self): """Gets the currency_pair of this Transfer. # noqa: E501 - Margin currency pair. Required if transfer from or to margin account # noqa: E501 + Margin trading pair. Required when transferring to or from margin account # noqa: E501 :return: The currency_pair of this Transfer. # noqa: E501 :rtype: str @@ -208,7 +201,7 @@ def currency_pair(self): def currency_pair(self, currency_pair): """Sets the currency_pair of this Transfer. - Margin currency pair. Required if transfer from or to margin account # noqa: E501 + Margin trading pair. Required when transferring to or from margin account # noqa: E501 :param currency_pair: The currency_pair of this Transfer. # noqa: E501 :type: str @@ -220,7 +213,7 @@ def currency_pair(self, currency_pair): def settle(self): """Gets the settle of this Transfer. # noqa: E501 - Futures settle currency. Required if `currency` is `POINT` # noqa: E501 + Contract settlement currency. Required when transferring to or from contract account # noqa: E501 :return: The settle of this Transfer. # noqa: E501 :rtype: str @@ -231,7 +224,7 @@ def settle(self): def settle(self, settle): """Sets the settle of this Transfer. - Futures settle currency. Required if `currency` is `POINT` # noqa: E501 + Contract settlement currency. Required when transferring to or from contract account # noqa: E501 :param settle: The settle of this Transfer. # noqa: E501 :type: str @@ -246,16 +239,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/transfer_order_status.py b/gate_api/models/transfer_order_status.py new file mode 100644 index 0000000..527b77a --- /dev/null +++ b/gate_api/models/transfer_order_status.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 TransferOrderStatus(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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' + } + + attribute_map = { + 'tx_id': 'tx_id', + 'status': 'status' + } + + def __init__(self, tx_id=None, status=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """TransferOrderStatus - a 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.discriminator = None + + if tx_id is not None: + self.tx_id = tx_id + if status is not None: + self.status = status + + @property + def tx_id(self): + """Gets the tx_id of this TransferOrderStatus. # noqa: E501 + + Order ID # noqa: E501 + + :return: The tx_id of this TransferOrderStatus. # noqa: E501 + :rtype: str + """ + return self._tx_id + + @tx_id.setter + def tx_id(self, tx_id): + """Sets the tx_id of this TransferOrderStatus. + + Order ID # noqa: E501 + + :param tx_id: The tx_id of this TransferOrderStatus. # noqa: E501 + :type: str + """ + + self._tx_id = tx_id + + @property + def status(self): + """Gets the status of this TransferOrderStatus. # noqa: E501 + + Transfer status: PENDING - Processing, SUCCESS - Transfer successful, FAIL - Transfer failed, PARTIAL_SUCCESS - Partially successful (this status appears when transferring between sub-accounts) # noqa: E501 + + :return: The status of this TransferOrderStatus. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this TransferOrderStatus. + + Transfer status: PENDING - Processing, SUCCESS - Transfer successful, FAIL - Transfer failed, PARTIAL_SUCCESS - Partially successful (this status appears when transferring between sub-accounts) # noqa: E501 + + :param status: The status of this TransferOrderStatus. # 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, TransferOrderStatus): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, TransferOrderStatus): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/cross_margin_repay_request.py b/gate_api/models/transferables_result.py similarity index 53% rename from gate_api/models/cross_margin_repay_request.py rename to gate_api/models/transferables_result.py index 078dcbd..a2659ba 100644 --- a/gate_api/models/cross_margin_repay_request.py +++ b/gate_api/models/transferables_result.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -18,7 +18,7 @@ from gate_api.configuration import Configuration -class CrossMarginRepayRequest(object): +class TransferablesResult(object): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -32,13 +32,19 @@ class CrossMarginRepayRequest(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {'currency': 'str', 'amount': 'str'} + openapi_types = { + 'currency': 'str', + 'amount': 'str' + } - attribute_map = {'currency': 'currency', 'amount': 'amount'} + attribute_map = { + 'currency': 'currency', + 'amount': 'amount' + } def __init__(self, currency=None, amount=None, local_vars_configuration=None): # noqa: E501 # type: (str, str, Configuration) -> None - """CrossMarginRepayRequest - a model defined in OpenAPI""" # noqa: E501 + """TransferablesResult - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() self.local_vars_configuration = local_vars_configuration @@ -47,56 +53,54 @@ def __init__(self, currency=None, amount=None, local_vars_configuration=None): self._amount = None self.discriminator = None - self.currency = currency - self.amount = amount + if currency is not None: + self.currency = currency + if amount is not None: + self.amount = amount @property def currency(self): - """Gets the currency of this CrossMarginRepayRequest. # noqa: E501 + """Gets the currency of this TransferablesResult. # noqa: E501 - Repayment currency # noqa: E501 + Currency detail # noqa: E501 - :return: The currency of this CrossMarginRepayRequest. # noqa: E501 + :return: The currency of this TransferablesResult. # noqa: E501 :rtype: str """ return self._currency @currency.setter def currency(self, currency): - """Sets the currency of this CrossMarginRepayRequest. + """Sets the currency of this TransferablesResult. - Repayment currency # noqa: E501 + Currency detail # noqa: E501 - :param currency: The currency of this CrossMarginRepayRequest. # noqa: E501 + :param currency: The currency of this TransferablesResult. # 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 CrossMarginRepayRequest. # noqa: E501 + """Gets the amount of this TransferablesResult. # noqa: E501 - Repayment amount # noqa: E501 + Maximum transferable amount # noqa: E501 - :return: The amount of this CrossMarginRepayRequest. # noqa: E501 + :return: The amount of this TransferablesResult. # noqa: E501 :rtype: str """ return self._amount @amount.setter def amount(self, amount): - """Sets the amount of this CrossMarginRepayRequest. + """Sets the amount of this TransferablesResult. - Repayment amount # noqa: E501 + Maximum transferable amount # noqa: E501 - :param amount: The amount of this CrossMarginRepayRequest. # noqa: E501 + :param amount: The amount of this TransferablesResult. # 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 @@ -107,16 +111,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value @@ -132,14 +138,14 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, CrossMarginRepayRequest): + if not isinstance(other, TransferablesResult): return False return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - if not isinstance(other, CrossMarginRepayRequest): + if not isinstance(other, TransferablesResult): return True return self.to_dict() != other.to_dict() diff --git a/gate_api/models/trigger_order_response.py b/gate_api/models/trigger_order_response.py index 6d1ec7c..2e0b560 100644 --- a/gate_api/models/trigger_order_response.py +++ b/gate_api/models/trigger_order_response.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -32,9 +32,13 @@ class TriggerOrderResponse(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {'id': 'int'} + openapi_types = { + 'id': 'int' + } - attribute_map = {'id': 'id'} + attribute_map = { + 'id': 'id' + } def __init__(self, id=None, local_vars_configuration=None): # noqa: E501 # type: (int, Configuration) -> None @@ -79,16 +83,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/trigger_time.py b/gate_api/models/trigger_time.py new file mode 100644 index 0000000..6b7c80d --- /dev/null +++ b/gate_api/models/trigger_time.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 TriggerTime(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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_time': 'int' + } + + attribute_map = { + 'trigger_time': 'triggerTime' + } + + def __init__(self, trigger_time=None, local_vars_configuration=None): # noqa: E501 + # type: (int, Configuration) -> None + """TriggerTime - a 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_time = None + self.discriminator = None + + if trigger_time is not None: + self.trigger_time = trigger_time + + @property + def trigger_time(self): + """Gets the trigger_time of this TriggerTime. # noqa: E501 + + Timestamp when countdown ends, in milliseconds # noqa: E501 + + :return: The trigger_time of this TriggerTime. # noqa: E501 + :rtype: int + """ + return self._trigger_time + + @trigger_time.setter + def trigger_time(self, trigger_time): + """Sets the trigger_time of this TriggerTime. + + Timestamp when countdown ends, in milliseconds # noqa: E501 + + :param trigger_time: The trigger_time of this TriggerTime. # noqa: E501 + :type: int + """ + + self._trigger_time = trigger_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, TriggerTime): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, TriggerTime): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/uid_push_order.py b/gate_api/models/uid_push_order.py new file mode 100644 index 0000000..eb36625 --- /dev/null +++ b/gate_api/models/uid_push_order.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 UidPushOrder(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'push_uid': 'int', + 'receive_uid': 'int', + 'currency': 'str', + 'amount': 'str', + 'create_time': 'int', + 'status': 'str', + 'message': 'str', + 'transaction_type': 'str' + } + + attribute_map = { + 'id': 'id', + 'push_uid': 'push_uid', + 'receive_uid': 'receive_uid', + 'currency': 'currency', + 'amount': 'amount', + 'create_time': 'create_time', + 'status': 'status', + 'message': 'message', + 'transaction_type': 'transaction_type' + } + + def __init__(self, id=None, push_uid=None, receive_uid=None, currency=None, amount=None, create_time=None, status=None, message=None, transaction_type=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, int, str, str, int, str, str, str, Configuration) -> None + """UidPushOrder - a 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._push_uid = None + self._receive_uid = None + self._currency = None + self._amount = None + self._create_time = None + self._status = None + self._message = None + self._transaction_type = None + self.discriminator = None + + if id is not None: + self.id = id + if push_uid is not None: + self.push_uid = push_uid + if receive_uid is not None: + self.receive_uid = receive_uid + if currency is not None: + self.currency = currency + if amount is not None: + self.amount = amount + if create_time is not None: + self.create_time = create_time + if status is not None: + self.status = status + if message is not None: + self.message = message + if transaction_type is not None: + self.transaction_type = transaction_type + + @property + def id(self): + """Gets the id of this UidPushOrder. # noqa: E501 + + Order ID # noqa: E501 + + :return: The id of this UidPushOrder. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this UidPushOrder. + + Order ID # noqa: E501 + + :param id: The id of this UidPushOrder. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def push_uid(self): + """Gets the push_uid of this UidPushOrder. # noqa: E501 + + Initiator User ID # noqa: E501 + + :return: The push_uid of this UidPushOrder. # noqa: E501 + :rtype: int + """ + return self._push_uid + + @push_uid.setter + def push_uid(self, push_uid): + """Sets the push_uid of this UidPushOrder. + + Initiator User ID # noqa: E501 + + :param push_uid: The push_uid of this UidPushOrder. # noqa: E501 + :type: int + """ + + self._push_uid = push_uid + + @property + def receive_uid(self): + """Gets the receive_uid of this UidPushOrder. # noqa: E501 + + Recipient User ID # noqa: E501 + + :return: The receive_uid of this UidPushOrder. # noqa: E501 + :rtype: int + """ + return self._receive_uid + + @receive_uid.setter + def receive_uid(self, receive_uid): + """Sets the receive_uid of this UidPushOrder. + + Recipient User ID # noqa: E501 + + :param receive_uid: The receive_uid of this UidPushOrder. # noqa: E501 + :type: int + """ + + self._receive_uid = receive_uid + + @property + def currency(self): + """Gets the currency of this UidPushOrder. # noqa: E501 + + Currency name # noqa: E501 + + :return: The currency of this UidPushOrder. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this UidPushOrder. + + Currency name # noqa: E501 + + :param currency: The currency of this UidPushOrder. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def amount(self): + """Gets the amount of this UidPushOrder. # noqa: E501 + + Transfer amount # noqa: E501 + + :return: The amount of this UidPushOrder. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this UidPushOrder. + + Transfer amount # noqa: E501 + + :param amount: The amount of this UidPushOrder. # noqa: E501 + :type: str + """ + + self._amount = amount + + @property + def create_time(self): + """Gets the create_time of this UidPushOrder. # noqa: E501 + + Created time # noqa: E501 + + :return: The create_time of this UidPushOrder. # noqa: E501 + :rtype: int + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this UidPushOrder. + + Created time # noqa: E501 + + :param create_time: The create_time of this UidPushOrder. # noqa: E501 + :type: int + """ + + self._create_time = create_time + + @property + def status(self): + """Gets the status of this UidPushOrder. # noqa: E501 + + Withdrawal status: - CREATING: Creating - PENDING: Waiting for recipient (Please contact the recipient to accept the transfer on Gate official website) - CANCELLING: Cancelling - CANCELLED: Cancelled - REFUSING: Refusing - REFUSED: Refused - RECEIVING: Receiving - RECEIVED: Success # noqa: E501 + + :return: The status of this UidPushOrder. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this UidPushOrder. + + Withdrawal status: - CREATING: Creating - PENDING: Waiting for recipient (Please contact the recipient to accept the transfer on Gate official website) - CANCELLING: Cancelling - CANCELLED: Cancelled - REFUSING: Refusing - REFUSED: Refused - RECEIVING: Receiving - RECEIVED: Success # noqa: E501 + + :param status: The status of this UidPushOrder. # noqa: E501 + :type: str + """ + + self._status = status + + @property + def message(self): + """Gets the message of this UidPushOrder. # noqa: E501 + + PENDING reason tips # noqa: E501 + + :return: The message of this UidPushOrder. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this UidPushOrder. + + PENDING reason tips # noqa: E501 + + :param message: The message of this UidPushOrder. # noqa: E501 + :type: str + """ + + self._message = message + + @property + def transaction_type(self): + """Gets the transaction_type of this UidPushOrder. # noqa: E501 + + Order Type # noqa: E501 + + :return: The transaction_type of this UidPushOrder. # noqa: E501 + :rtype: str + """ + return self._transaction_type + + @transaction_type.setter + def transaction_type(self, transaction_type): + """Sets the transaction_type of this UidPushOrder. + + Order Type # noqa: E501 + + :param transaction_type: The transaction_type of this UidPushOrder. # noqa: E501 + :type: str + """ + + self._transaction_type = transaction_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, UidPushOrder): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UidPushOrder): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/uid_push_withdrawal.py b/gate_api/models/uid_push_withdrawal.py new file mode 100644 index 0000000..da15f5c --- /dev/null +++ b/gate_api/models/uid_push_withdrawal.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 UidPushWithdrawal(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'receive_uid': 'int', + 'currency': 'str', + 'amount': 'str' + } + + attribute_map = { + 'receive_uid': 'receive_uid', + 'currency': 'currency', + 'amount': 'amount' + } + + def __init__(self, receive_uid=None, currency=None, amount=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, str, Configuration) -> None + """UidPushWithdrawal - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._receive_uid = None + self._currency = None + self._amount = None + self.discriminator = None + + self.receive_uid = receive_uid + self.currency = currency + self.amount = amount + + @property + def receive_uid(self): + """Gets the receive_uid of this UidPushWithdrawal. # noqa: E501 + + Recipient UID # noqa: E501 + + :return: The receive_uid of this UidPushWithdrawal. # noqa: E501 + :rtype: int + """ + return self._receive_uid + + @receive_uid.setter + def receive_uid(self, receive_uid): + """Sets the receive_uid of this UidPushWithdrawal. + + Recipient UID # noqa: E501 + + :param receive_uid: The receive_uid of this UidPushWithdrawal. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and receive_uid is None: # noqa: E501 + raise ValueError("Invalid value for `receive_uid`, must not be `None`") # noqa: E501 + + self._receive_uid = receive_uid + + @property + def currency(self): + """Gets the currency of this UidPushWithdrawal. # noqa: E501 + + Currency name # noqa: E501 + + :return: The currency of this UidPushWithdrawal. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this UidPushWithdrawal. + + Currency name # noqa: E501 + + :param currency: The currency of this UidPushWithdrawal. # 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 UidPushWithdrawal. # noqa: E501 + + Transfer amount # noqa: E501 + + :return: The amount of this UidPushWithdrawal. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this UidPushWithdrawal. + + Transfer amount # noqa: E501 + + :param amount: The amount of this UidPushWithdrawal. # 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, UidPushWithdrawal): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UidPushWithdrawal): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/uid_push_withdrawal_resp.py b/gate_api/models/uid_push_withdrawal_resp.py new file mode 100644 index 0000000..7afe6eb --- /dev/null +++ b/gate_api/models/uid_push_withdrawal_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 UidPushWithdrawalResp(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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' + } + + attribute_map = { + 'id': 'id' + } + + def __init__(self, id=None, local_vars_configuration=None): # noqa: E501 + # type: (int, Configuration) -> None + """UidPushWithdrawalResp - a 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 UidPushWithdrawalResp. # noqa: E501 + + Order ID # noqa: E501 + + :return: The id of this UidPushWithdrawalResp. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this UidPushWithdrawalResp. + + Order ID # noqa: E501 + + :param id: The id of this UidPushWithdrawalResp. # noqa: E501 + :type: int + """ + + 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, UidPushWithdrawalResp): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UidPushWithdrawalResp): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/uni_currency.py b/gate_api/models/uni_currency.py new file mode 100644 index 0000000..eee7b2c --- /dev/null +++ b/gate_api/models/uni_currency.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 UniCurrency(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'min_lend_amount': 'str', + 'max_lend_amount': 'str', + 'max_rate': 'str', + 'min_rate': 'str' + } + + attribute_map = { + 'currency': 'currency', + 'min_lend_amount': 'min_lend_amount', + 'max_lend_amount': 'max_lend_amount', + 'max_rate': 'max_rate', + 'min_rate': 'min_rate' + } + + def __init__(self, currency=None, min_lend_amount=None, max_lend_amount=None, max_rate=None, min_rate=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, Configuration) -> None + """UniCurrency - a 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._min_lend_amount = None + self._max_lend_amount = None + self._max_rate = None + self._min_rate = None + self.discriminator = None + + if currency is not None: + self.currency = currency + if min_lend_amount is not None: + self.min_lend_amount = min_lend_amount + if max_lend_amount is not None: + self.max_lend_amount = max_lend_amount + if max_rate is not None: + self.max_rate = max_rate + if min_rate is not None: + self.min_rate = min_rate + + @property + def currency(self): + """Gets the currency of this UniCurrency. # noqa: E501 + + Currency name # noqa: E501 + + :return: The currency of this UniCurrency. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this UniCurrency. + + Currency name # noqa: E501 + + :param currency: The currency of this UniCurrency. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def min_lend_amount(self): + """Gets the min_lend_amount of this UniCurrency. # noqa: E501 + + The minimum lending amount, in the unit of the currency # noqa: E501 + + :return: The min_lend_amount of this UniCurrency. # 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 UniCurrency. + + The minimum lending amount, in the unit of the currency # noqa: E501 + + :param min_lend_amount: The min_lend_amount of this UniCurrency. # noqa: E501 + :type: str + """ + + self._min_lend_amount = min_lend_amount + + @property + def max_lend_amount(self): + """Gets the max_lend_amount of this UniCurrency. # noqa: E501 + + The total maximum lending amount, in USDT # noqa: E501 + + :return: The max_lend_amount of this UniCurrency. # noqa: E501 + :rtype: str + """ + return self._max_lend_amount + + @max_lend_amount.setter + def max_lend_amount(self, max_lend_amount): + """Sets the max_lend_amount of this UniCurrency. + + The total maximum lending amount, in USDT # noqa: E501 + + :param max_lend_amount: The max_lend_amount of this UniCurrency. # noqa: E501 + :type: str + """ + + self._max_lend_amount = max_lend_amount + + @property + def max_rate(self): + """Gets the max_rate of this UniCurrency. # noqa: E501 + + Maximum rate (Hourly) # noqa: E501 + + :return: The max_rate of this UniCurrency. # noqa: E501 + :rtype: str + """ + return self._max_rate + + @max_rate.setter + def max_rate(self, max_rate): + """Sets the max_rate of this UniCurrency. + + Maximum rate (Hourly) # noqa: E501 + + :param max_rate: The max_rate of this UniCurrency. # noqa: E501 + :type: str + """ + + self._max_rate = max_rate + + @property + def min_rate(self): + """Gets the min_rate of this UniCurrency. # noqa: E501 + + Minimum rate (Hourly) # noqa: E501 + + :return: The min_rate of this UniCurrency. # noqa: E501 + :rtype: str + """ + return self._min_rate + + @min_rate.setter + def min_rate(self, min_rate): + """Sets the min_rate of this UniCurrency. + + Minimum rate (Hourly) # noqa: E501 + + :param min_rate: The min_rate of this UniCurrency. # noqa: E501 + :type: str + """ + + self._min_rate = min_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, UniCurrency): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UniCurrency): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/uni_currency_interest.py b/gate_api/models/uni_currency_interest.py new file mode 100644 index 0000000..525ec59 --- /dev/null +++ b/gate_api/models/uni_currency_interest.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 UniCurrencyInterest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'interest_status': 'str' + } + + attribute_map = { + 'currency': 'currency', + 'interest_status': 'interest_status' + } + + def __init__(self, currency=None, interest_status=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """UniCurrencyInterest - a 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._interest_status = None + self.discriminator = None + + if currency is not None: + self.currency = currency + if interest_status is not None: + self.interest_status = interest_status + + @property + def currency(self): + """Gets the currency of this UniCurrencyInterest. # noqa: E501 + + Currency # noqa: E501 + + :return: The currency of this UniCurrencyInterest. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this UniCurrencyInterest. + + Currency # noqa: E501 + + :param currency: The currency of this UniCurrencyInterest. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def interest_status(self): + """Gets the interest_status of this UniCurrencyInterest. # noqa: E501 + + Interest status: interest_dividend - Normal dividend, interest_reinvest - Interest reinvestment # noqa: E501 + + :return: The interest_status of this UniCurrencyInterest. # noqa: E501 + :rtype: str + """ + return self._interest_status + + @interest_status.setter + def interest_status(self, interest_status): + """Sets the interest_status of this UniCurrencyInterest. + + Interest status: interest_dividend - Normal dividend, interest_reinvest - Interest reinvestment # noqa: E501 + + :param interest_status: The interest_status of this UniCurrencyInterest. # noqa: E501 + :type: str + """ + + self._interest_status = interest_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, UniCurrencyInterest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UniCurrencyInterest): + 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 new file mode 100644 index 0000000..362d6b1 --- /dev/null +++ b/gate_api/models/uni_currency_pair.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 UniCurrencyPair(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'base_min_borrow_amount': 'str', + 'quote_min_borrow_amount': 'str', + 'leverage': 'str' + } + + attribute_map = { + 'currency_pair': 'currency_pair', + 'base_min_borrow_amount': 'base_min_borrow_amount', + 'quote_min_borrow_amount': 'quote_min_borrow_amount', + 'leverage': 'leverage' + } + + def __init__(self, currency_pair=None, base_min_borrow_amount=None, quote_min_borrow_amount=None, leverage=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, Configuration) -> None + """UniCurrencyPair - a 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._base_min_borrow_amount = None + self._quote_min_borrow_amount = None + self._leverage = None + self.discriminator = None + + if currency_pair is not None: + self.currency_pair = currency_pair + if base_min_borrow_amount is not None: + self.base_min_borrow_amount = base_min_borrow_amount + if quote_min_borrow_amount is not None: + self.quote_min_borrow_amount = quote_min_borrow_amount + if leverage is not None: + self.leverage = leverage + + @property + def currency_pair(self): + """Gets the currency_pair of this UniCurrencyPair. # noqa: E501 + + Currency pair # noqa: E501 + + :return: The currency_pair of this UniCurrencyPair. # noqa: E501 + :rtype: str + """ + return self._currency_pair + + @currency_pair.setter + def currency_pair(self, currency_pair): + """Sets the currency_pair of this UniCurrencyPair. + + Currency pair # noqa: E501 + + :param currency_pair: The currency_pair of this UniCurrencyPair. # noqa: E501 + :type: str + """ + + self._currency_pair = currency_pair + + @property + def base_min_borrow_amount(self): + """Gets the base_min_borrow_amount of this UniCurrencyPair. # noqa: E501 + + Minimum borrow amount of base currency # noqa: E501 + + :return: The base_min_borrow_amount of this UniCurrencyPair. # noqa: E501 + :rtype: str + """ + return self._base_min_borrow_amount + + @base_min_borrow_amount.setter + def base_min_borrow_amount(self, base_min_borrow_amount): + """Sets the base_min_borrow_amount of this UniCurrencyPair. + + Minimum borrow amount of base currency # noqa: E501 + + :param base_min_borrow_amount: The base_min_borrow_amount of this UniCurrencyPair. # noqa: E501 + :type: str + """ + + self._base_min_borrow_amount = base_min_borrow_amount + + @property + def quote_min_borrow_amount(self): + """Gets the quote_min_borrow_amount of this UniCurrencyPair. # noqa: E501 + + Minimum borrow amount of quote currency # noqa: E501 + + :return: The quote_min_borrow_amount of this UniCurrencyPair. # noqa: E501 + :rtype: str + """ + return self._quote_min_borrow_amount + + @quote_min_borrow_amount.setter + def quote_min_borrow_amount(self, quote_min_borrow_amount): + """Sets the quote_min_borrow_amount of this UniCurrencyPair. + + Minimum borrow amount of quote currency # noqa: E501 + + :param quote_min_borrow_amount: The quote_min_borrow_amount of this UniCurrencyPair. # noqa: E501 + :type: str + """ + + self._quote_min_borrow_amount = quote_min_borrow_amount + + @property + def leverage(self): + """Gets the leverage of this UniCurrencyPair. # noqa: E501 + + Position leverage # noqa: E501 + + :return: The leverage of this UniCurrencyPair. # noqa: E501 + :rtype: str + """ + return self._leverage + + @leverage.setter + def leverage(self, leverage): + """Sets the leverage of this UniCurrencyPair. + + Position leverage # noqa: E501 + + :param leverage: The leverage of this UniCurrencyPair. # 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, UniCurrencyPair): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UniCurrencyPair): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/uni_interest_record.py b/gate_api/models/uni_interest_record.py new file mode 100644 index 0000000..f06d5fd --- /dev/null +++ b/gate_api/models/uni_interest_record.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 UniInterestRecord(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'currency': 'str', + 'actual_rate': 'str', + 'interest': 'str', + 'interest_status': 'str', + 'create_time': 'int' + } + + attribute_map = { + 'status': 'status', + 'currency': 'currency', + 'actual_rate': 'actual_rate', + 'interest': 'interest', + 'interest_status': 'interest_status', + 'create_time': 'create_time' + } + + def __init__(self, status=None, currency=None, actual_rate=None, interest=None, interest_status=None, create_time=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, str, str, str, int, Configuration) -> None + """UniInterestRecord - a 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._currency = None + self._actual_rate = None + self._interest = None + self._interest_status = None + self._create_time = None + self.discriminator = None + + if status is not None: + self.status = status + if currency is not None: + self.currency = currency + if actual_rate is not None: + self.actual_rate = actual_rate + if interest is not None: + self.interest = interest + if interest_status is not None: + self.interest_status = interest_status + if create_time is not None: + self.create_time = create_time + + @property + def status(self): + """Gets the status of this UniInterestRecord. # noqa: E501 + + Status: 0 - fail, 1 - success # noqa: E501 + + :return: The status of this UniInterestRecord. # noqa: E501 + :rtype: int + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this UniInterestRecord. + + Status: 0 - fail, 1 - success # noqa: E501 + + :param status: The status of this UniInterestRecord. # noqa: E501 + :type: int + """ + + self._status = status + + @property + def currency(self): + """Gets the currency of this UniInterestRecord. # noqa: E501 + + Currency # noqa: E501 + + :return: The currency of this UniInterestRecord. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this UniInterestRecord. + + Currency # noqa: E501 + + :param currency: The currency of this UniInterestRecord. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def actual_rate(self): + """Gets the actual_rate of this UniInterestRecord. # noqa: E501 + + Actual Rate # noqa: E501 + + :return: The actual_rate of this UniInterestRecord. # noqa: E501 + :rtype: str + """ + return self._actual_rate + + @actual_rate.setter + def actual_rate(self, actual_rate): + """Sets the actual_rate of this UniInterestRecord. + + Actual Rate # noqa: E501 + + :param actual_rate: The actual_rate of this UniInterestRecord. # noqa: E501 + :type: str + """ + + self._actual_rate = actual_rate + + @property + def interest(self): + """Gets the interest of this UniInterestRecord. # noqa: E501 + + Interest # noqa: E501 + + :return: The interest of this UniInterestRecord. # noqa: E501 + :rtype: str + """ + return self._interest + + @interest.setter + def interest(self, interest): + """Sets the interest of this UniInterestRecord. + + Interest # noqa: E501 + + :param interest: The interest of this UniInterestRecord. # noqa: E501 + :type: str + """ + + self._interest = interest + + @property + def interest_status(self): + """Gets the interest_status of this UniInterestRecord. # noqa: E501 + + Interest status: interest_dividend - Normal dividend, interest_reinvest - Interest reinvestment # noqa: E501 + + :return: The interest_status of this UniInterestRecord. # noqa: E501 + :rtype: str + """ + return self._interest_status + + @interest_status.setter + def interest_status(self, interest_status): + """Sets the interest_status of this UniInterestRecord. + + Interest status: interest_dividend - Normal dividend, interest_reinvest - Interest reinvestment # noqa: E501 + + :param interest_status: The interest_status of this UniInterestRecord. # noqa: E501 + :type: str + """ + + self._interest_status = interest_status + + @property + def create_time(self): + """Gets the create_time of this UniInterestRecord. # noqa: E501 + + Created time # noqa: E501 + + :return: The create_time of this UniInterestRecord. # noqa: E501 + :rtype: int + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this UniInterestRecord. + + Created time # noqa: E501 + + :param create_time: The create_time of this UniInterestRecord. # 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, UniInterestRecord): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UniInterestRecord): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/uni_lend.py b/gate_api/models/uni_lend.py new file mode 100644 index 0000000..8c00a50 --- /dev/null +++ b/gate_api/models/uni_lend.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 UniLend(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'current_amount': 'str', + 'amount': 'str', + 'lent_amount': 'str', + 'frozen_amount': 'str', + 'min_rate': 'str', + 'interest_status': 'str', + 'reinvest_left_amount': 'str', + 'create_time': 'int', + 'update_time': 'int' + } + + attribute_map = { + 'currency': 'currency', + 'current_amount': 'current_amount', + 'amount': 'amount', + 'lent_amount': 'lent_amount', + 'frozen_amount': 'frozen_amount', + 'min_rate': 'min_rate', + 'interest_status': 'interest_status', + 'reinvest_left_amount': 'reinvest_left_amount', + 'create_time': 'create_time', + 'update_time': 'update_time' + } + + def __init__(self, currency=None, current_amount=None, amount=None, lent_amount=None, frozen_amount=None, min_rate=None, interest_status=None, reinvest_left_amount=None, create_time=None, update_time=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, str, int, int, Configuration) -> None + """UniLend - a 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._current_amount = None + self._amount = None + self._lent_amount = None + self._frozen_amount = None + self._min_rate = None + self._interest_status = None + self._reinvest_left_amount = None + self._create_time = None + self._update_time = None + self.discriminator = None + + if currency is not None: + self.currency = currency + if current_amount is not None: + self.current_amount = current_amount + if amount is not None: + self.amount = amount + if lent_amount is not None: + self.lent_amount = lent_amount + if frozen_amount is not None: + self.frozen_amount = frozen_amount + if min_rate is not None: + self.min_rate = min_rate + if interest_status is not None: + self.interest_status = interest_status + if reinvest_left_amount is not None: + self.reinvest_left_amount = reinvest_left_amount + if create_time is not None: + self.create_time = create_time + if update_time is not None: + self.update_time = update_time + + @property + def currency(self): + """Gets the currency of this UniLend. # noqa: E501 + + Currency # noqa: E501 + + :return: The currency of this UniLend. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this UniLend. + + Currency # noqa: E501 + + :param currency: The currency of this UniLend. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def current_amount(self): + """Gets the current_amount of this UniLend. # noqa: E501 + + Current amount # noqa: E501 + + :return: The current_amount of this UniLend. # noqa: E501 + :rtype: str + """ + return self._current_amount + + @current_amount.setter + def current_amount(self, current_amount): + """Sets the current_amount of this UniLend. + + Current amount # noqa: E501 + + :param current_amount: The current_amount of this UniLend. # noqa: E501 + :type: str + """ + + self._current_amount = current_amount + + @property + def amount(self): + """Gets the amount of this UniLend. # noqa: E501 + + Total Lending Amount # noqa: E501 + + :return: The amount of this UniLend. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this UniLend. + + Total Lending Amount # noqa: E501 + + :param amount: The amount of this UniLend. # noqa: E501 + :type: str + """ + + self._amount = amount + + @property + def lent_amount(self): + """Gets the lent_amount of this UniLend. # noqa: E501 + + Lent Amount # noqa: E501 + + :return: The lent_amount of this UniLend. # noqa: E501 + :rtype: str + """ + return self._lent_amount + + @lent_amount.setter + def lent_amount(self, lent_amount): + """Sets the lent_amount of this UniLend. + + Lent Amount # noqa: E501 + + :param lent_amount: The lent_amount of this UniLend. # noqa: E501 + :type: str + """ + + self._lent_amount = lent_amount + + @property + def frozen_amount(self): + """Gets the frozen_amount of this UniLend. # noqa: E501 + + Pending Redemption Amount # noqa: E501 + + :return: The frozen_amount of this UniLend. # noqa: E501 + :rtype: str + """ + return self._frozen_amount + + @frozen_amount.setter + def frozen_amount(self, frozen_amount): + """Sets the frozen_amount of this UniLend. + + Pending Redemption Amount # noqa: E501 + + :param frozen_amount: The frozen_amount of this UniLend. # noqa: E501 + :type: str + """ + + self._frozen_amount = frozen_amount + + @property + def min_rate(self): + """Gets the min_rate of this UniLend. # noqa: E501 + + Minimum interest rate # noqa: E501 + + :return: The min_rate of this UniLend. # noqa: E501 + :rtype: str + """ + return self._min_rate + + @min_rate.setter + def min_rate(self, min_rate): + """Sets the min_rate of this UniLend. + + Minimum interest rate # noqa: E501 + + :param min_rate: The min_rate of this UniLend. # noqa: E501 + :type: str + """ + + self._min_rate = min_rate + + @property + def interest_status(self): + """Gets the interest_status of this UniLend. # noqa: E501 + + Interest status: interest_dividend - Normal dividend, interest_reinvest - Interest reinvestment # noqa: E501 + + :return: The interest_status of this UniLend. # noqa: E501 + :rtype: str + """ + return self._interest_status + + @interest_status.setter + def interest_status(self, interest_status): + """Sets the interest_status of this UniLend. + + Interest status: interest_dividend - Normal dividend, interest_reinvest - Interest reinvestment # noqa: E501 + + :param interest_status: The interest_status of this UniLend. # noqa: E501 + :type: str + """ + + self._interest_status = interest_status + + @property + def reinvest_left_amount(self): + """Gets the reinvest_left_amount of this UniLend. # noqa: E501 + + Non-reinvested Amount # noqa: E501 + + :return: The reinvest_left_amount of this UniLend. # noqa: E501 + :rtype: str + """ + return self._reinvest_left_amount + + @reinvest_left_amount.setter + def reinvest_left_amount(self, reinvest_left_amount): + """Sets the reinvest_left_amount of this UniLend. + + Non-reinvested Amount # noqa: E501 + + :param reinvest_left_amount: The reinvest_left_amount of this UniLend. # noqa: E501 + :type: str + """ + + self._reinvest_left_amount = reinvest_left_amount + + @property + def create_time(self): + """Gets the create_time of this UniLend. # noqa: E501 + + Lending Order Creation Time # noqa: E501 + + :return: The create_time of this UniLend. # noqa: E501 + :rtype: int + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this UniLend. + + Lending Order Creation Time # noqa: E501 + + :param create_time: The create_time of this UniLend. # noqa: E501 + :type: int + """ + + self._create_time = create_time + + @property + def update_time(self): + """Gets the update_time of this UniLend. # noqa: E501 + + Lending Order Last Update Time # noqa: E501 + + :return: The update_time of this UniLend. # noqa: E501 + :rtype: int + """ + return self._update_time + + @update_time.setter + def update_time(self, update_time): + """Sets the update_time of this UniLend. + + Lending Order Last Update Time # noqa: E501 + + :param update_time: The update_time of this UniLend. # noqa: E501 + :type: int + """ + + 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, UniLend): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UniLend): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/uni_lend_interest.py b/gate_api/models/uni_lend_interest.py new file mode 100644 index 0000000..80f3a0a --- /dev/null +++ b/gate_api/models/uni_lend_interest.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 UniLendInterest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'interest': 'str' + } + + attribute_map = { + 'currency': 'currency', + 'interest': 'interest' + } + + def __init__(self, currency=None, interest=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """UniLendInterest - a 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._interest = None + self.discriminator = None + + if currency is not None: + self.currency = currency + if interest is not None: + self.interest = interest + + @property + def currency(self): + """Gets the currency of this UniLendInterest. # noqa: E501 + + Currency # noqa: E501 + + :return: The currency of this UniLendInterest. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this UniLendInterest. + + Currency # noqa: E501 + + :param currency: The currency of this UniLendInterest. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def interest(self): + """Gets the interest of this UniLendInterest. # noqa: E501 + + Interest income # noqa: E501 + + :return: The interest of this UniLendInterest. # noqa: E501 + :rtype: str + """ + return self._interest + + @interest.setter + def interest(self, interest): + """Sets the interest of this UniLendInterest. + + Interest income # noqa: E501 + + :param interest: The interest of this UniLendInterest. # noqa: E501 + :type: str + """ + + self._interest = 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, UniLendInterest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UniLendInterest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/uni_lend_record.py b/gate_api/models/uni_lend_record.py new file mode 100644 index 0000000..a435111 --- /dev/null +++ b/gate_api/models/uni_lend_record.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 UniLendRecord(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'amount': 'str', + 'last_wallet_amount': 'str', + 'last_lent_amount': 'str', + 'last_frozen_amount': 'str', + 'type': 'str', + 'create_time': 'int' + } + + attribute_map = { + 'currency': 'currency', + 'amount': 'amount', + 'last_wallet_amount': 'last_wallet_amount', + 'last_lent_amount': 'last_lent_amount', + 'last_frozen_amount': 'last_frozen_amount', + 'type': 'type', + 'create_time': 'create_time' + } + + def __init__(self, currency=None, amount=None, last_wallet_amount=None, last_lent_amount=None, last_frozen_amount=None, type=None, create_time=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, int, Configuration) -> None + """UniLendRecord - a 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._last_wallet_amount = None + self._last_lent_amount = None + self._last_frozen_amount = None + self._type = None + self._create_time = None + self.discriminator = None + + if currency is not None: + self.currency = currency + if amount is not None: + self.amount = amount + if last_wallet_amount is not None: + self.last_wallet_amount = last_wallet_amount + if last_lent_amount is not None: + self.last_lent_amount = last_lent_amount + if last_frozen_amount is not None: + self.last_frozen_amount = last_frozen_amount + if type is not None: + self.type = type + if create_time is not None: + self.create_time = create_time + + @property + def currency(self): + """Gets the currency of this UniLendRecord. # noqa: E501 + + Currency name # noqa: E501 + + :return: The currency of this UniLendRecord. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this UniLendRecord. + + Currency name # noqa: E501 + + :param currency: The currency of this UniLendRecord. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def amount(self): + """Gets the amount of this UniLendRecord. # noqa: E501 + + Current Amount # noqa: E501 + + :return: The amount of this UniLendRecord. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this UniLendRecord. + + Current Amount # noqa: E501 + + :param amount: The amount of this UniLendRecord. # noqa: E501 + :type: str + """ + + self._amount = amount + + @property + def last_wallet_amount(self): + """Gets the last_wallet_amount of this UniLendRecord. # noqa: E501 + + Previous Available Amount # noqa: E501 + + :return: The last_wallet_amount of this UniLendRecord. # noqa: E501 + :rtype: str + """ + return self._last_wallet_amount + + @last_wallet_amount.setter + def last_wallet_amount(self, last_wallet_amount): + """Sets the last_wallet_amount of this UniLendRecord. + + Previous Available Amount # noqa: E501 + + :param last_wallet_amount: The last_wallet_amount of this UniLendRecord. # noqa: E501 + :type: str + """ + + self._last_wallet_amount = last_wallet_amount + + @property + def last_lent_amount(self): + """Gets the last_lent_amount of this UniLendRecord. # noqa: E501 + + Previous Lent Amount # noqa: E501 + + :return: The last_lent_amount of this UniLendRecord. # noqa: E501 + :rtype: str + """ + return self._last_lent_amount + + @last_lent_amount.setter + def last_lent_amount(self, last_lent_amount): + """Sets the last_lent_amount of this UniLendRecord. + + Previous Lent Amount # noqa: E501 + + :param last_lent_amount: The last_lent_amount of this UniLendRecord. # noqa: E501 + :type: str + """ + + self._last_lent_amount = last_lent_amount + + @property + def last_frozen_amount(self): + """Gets the last_frozen_amount of this UniLendRecord. # noqa: E501 + + Previous Frozen Amount # noqa: E501 + + :return: The last_frozen_amount of this UniLendRecord. # noqa: E501 + :rtype: str + """ + return self._last_frozen_amount + + @last_frozen_amount.setter + def last_frozen_amount(self, last_frozen_amount): + """Sets the last_frozen_amount of this UniLendRecord. + + Previous Frozen Amount # noqa: E501 + + :param last_frozen_amount: The last_frozen_amount of this UniLendRecord. # noqa: E501 + :type: str + """ + + self._last_frozen_amount = last_frozen_amount + + @property + def type(self): + """Gets the type of this UniLendRecord. # noqa: E501 + + Record Type: lend - Lend, redeem - Redeem # noqa: E501 + + :return: The type of this UniLendRecord. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this UniLendRecord. + + Record Type: lend - Lend, redeem - Redeem # noqa: E501 + + :param type: The type of this UniLendRecord. # noqa: E501 + :type: str + """ + + self._type = type + + @property + def create_time(self): + """Gets the create_time of this UniLendRecord. # noqa: E501 + + Created time # noqa: E501 + + :return: The create_time of this UniLendRecord. # noqa: E501 + :rtype: int + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this UniLendRecord. + + Created time # noqa: E501 + + :param create_time: The create_time of this UniLendRecord. # 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, UniLendRecord): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UniLendRecord): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/uni_loan.py b/gate_api/models/uni_loan.py new file mode 100644 index 0000000..0010ef5 --- /dev/null +++ b/gate_api/models/uni_loan.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 UniLoan(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'currency_pair': 'str', + 'amount': 'str', + 'type': 'str', + 'create_time': 'int', + 'update_time': 'int' + } + + attribute_map = { + 'currency': 'currency', + 'currency_pair': 'currency_pair', + 'amount': 'amount', + 'type': 'type', + 'create_time': 'create_time', + 'update_time': 'update_time' + } + + def __init__(self, currency=None, currency_pair=None, amount=None, type=None, create_time=None, update_time=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, int, int, Configuration) -> None + """UniLoan - a 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._currency_pair = None + self._amount = None + self._type = None + self._create_time = None + self._update_time = None + self.discriminator = None + + if currency is not None: + self.currency = currency + if currency_pair is not None: + self.currency_pair = currency_pair + if amount is not None: + self.amount = amount + if type is not None: + self.type = 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 currency(self): + """Gets the currency of this UniLoan. # noqa: E501 + + Currency # noqa: E501 + + :return: The currency of this UniLoan. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this UniLoan. + + Currency # noqa: E501 + + :param currency: The currency of this UniLoan. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def currency_pair(self): + """Gets the currency_pair of this UniLoan. # noqa: E501 + + Currency pair # noqa: E501 + + :return: The currency_pair of this UniLoan. # noqa: E501 + :rtype: str + """ + return self._currency_pair + + @currency_pair.setter + def currency_pair(self, currency_pair): + """Sets the currency_pair of this UniLoan. + + Currency pair # noqa: E501 + + :param currency_pair: The currency_pair of this UniLoan. # noqa: E501 + :type: str + """ + + self._currency_pair = currency_pair + + @property + def amount(self): + """Gets the amount of this UniLoan. # noqa: E501 + + Amount to Repay # noqa: E501 + + :return: The amount of this UniLoan. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this UniLoan. + + Amount to Repay # noqa: E501 + + :param amount: The amount of this UniLoan. # noqa: E501 + :type: str + """ + + self._amount = amount + + @property + def type(self): + """Gets the type of this UniLoan. # noqa: E501 + + Loan type: platform borrowing - platform, margin borrowing - margin # noqa: E501 + + :return: The type of this UniLoan. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this UniLoan. + + Loan type: platform borrowing - platform, margin borrowing - margin # noqa: E501 + + :param type: The type of this UniLoan. # noqa: E501 + :type: str + """ + + self._type = type + + @property + def create_time(self): + """Gets the create_time of this UniLoan. # noqa: E501 + + Created time # noqa: E501 + + :return: The create_time of this UniLoan. # noqa: E501 + :rtype: int + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this UniLoan. + + Created time # noqa: E501 + + :param create_time: The create_time of this UniLoan. # noqa: E501 + :type: int + """ + + self._create_time = create_time + + @property + def update_time(self): + """Gets the update_time of this UniLoan. # noqa: E501 + + Last Update Time # noqa: E501 + + :return: The update_time of this UniLoan. # noqa: E501 + :rtype: int + """ + return self._update_time + + @update_time.setter + def update_time(self, update_time): + """Sets the update_time of this UniLoan. + + Last Update Time # noqa: E501 + + :param update_time: The update_time of this UniLoan. # noqa: E501 + :type: int + """ + + 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, UniLoan): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UniLoan): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/uni_loan_interest_record.py b/gate_api/models/uni_loan_interest_record.py new file mode 100644 index 0000000..537866f --- /dev/null +++ b/gate_api/models/uni_loan_interest_record.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 UniLoanInterestRecord(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'currency_pair': 'str', + 'actual_rate': 'str', + 'interest': 'str', + 'status': 'int', + 'type': 'str', + 'create_time': 'int' + } + + attribute_map = { + 'currency': 'currency', + 'currency_pair': 'currency_pair', + 'actual_rate': 'actual_rate', + 'interest': 'interest', + 'status': 'status', + 'type': 'type', + 'create_time': 'create_time' + } + + def __init__(self, currency=None, currency_pair=None, actual_rate=None, interest=None, status=None, type=None, create_time=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, int, str, int, Configuration) -> None + """UniLoanInterestRecord - a 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._currency_pair = None + self._actual_rate = None + self._interest = None + self._status = None + self._type = None + self._create_time = None + self.discriminator = None + + if currency is not None: + self.currency = currency + if currency_pair is not None: + self.currency_pair = currency_pair + if actual_rate is not None: + self.actual_rate = actual_rate + if interest is not None: + self.interest = interest + if status is not None: + self.status = status + if type is not None: + self.type = type + if create_time is not None: + self.create_time = create_time + + @property + def currency(self): + """Gets the currency of this UniLoanInterestRecord. # noqa: E501 + + Currency name # noqa: E501 + + :return: The currency of this UniLoanInterestRecord. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this UniLoanInterestRecord. + + Currency name # noqa: E501 + + :param currency: The currency of this UniLoanInterestRecord. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def currency_pair(self): + """Gets the currency_pair of this UniLoanInterestRecord. # noqa: E501 + + Currency pair # noqa: E501 + + :return: The currency_pair of this UniLoanInterestRecord. # noqa: E501 + :rtype: str + """ + return self._currency_pair + + @currency_pair.setter + def currency_pair(self, currency_pair): + """Sets the currency_pair of this UniLoanInterestRecord. + + Currency pair # noqa: E501 + + :param currency_pair: The currency_pair of this UniLoanInterestRecord. # noqa: E501 + :type: str + """ + + self._currency_pair = currency_pair + + @property + def actual_rate(self): + """Gets the actual_rate of this UniLoanInterestRecord. # noqa: E501 + + Actual Rate # noqa: E501 + + :return: The actual_rate of this UniLoanInterestRecord. # noqa: E501 + :rtype: str + """ + return self._actual_rate + + @actual_rate.setter + def actual_rate(self, actual_rate): + """Sets the actual_rate of this UniLoanInterestRecord. + + Actual Rate # noqa: E501 + + :param actual_rate: The actual_rate of this UniLoanInterestRecord. # noqa: E501 + :type: str + """ + + self._actual_rate = actual_rate + + @property + def interest(self): + """Gets the interest of this UniLoanInterestRecord. # noqa: E501 + + Interest # noqa: E501 + + :return: The interest of this UniLoanInterestRecord. # noqa: E501 + :rtype: str + """ + return self._interest + + @interest.setter + def interest(self, interest): + """Sets the interest of this UniLoanInterestRecord. + + Interest # noqa: E501 + + :param interest: The interest of this UniLoanInterestRecord. # noqa: E501 + :type: str + """ + + self._interest = interest + + @property + def status(self): + """Gets the status of this UniLoanInterestRecord. # noqa: E501 + + Status: 0 - fail, 1 - success # noqa: E501 + + :return: The status of this UniLoanInterestRecord. # noqa: E501 + :rtype: int + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this UniLoanInterestRecord. + + Status: 0 - fail, 1 - success # noqa: E501 + + :param status: The status of this UniLoanInterestRecord. # noqa: E501 + :type: int + """ + + self._status = status + + @property + def type(self): + """Gets the type of this UniLoanInterestRecord. # noqa: E501 + + Type: platform - Platform borrowing, margin - Margin borrowing # noqa: E501 + + :return: The type of this UniLoanInterestRecord. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this UniLoanInterestRecord. + + Type: platform - Platform borrowing, margin - Margin borrowing # noqa: E501 + + :param type: The type of this UniLoanInterestRecord. # noqa: E501 + :type: str + """ + + self._type = type + + @property + def create_time(self): + """Gets the create_time of this UniLoanInterestRecord. # noqa: E501 + + Created time # noqa: E501 + + :return: The create_time of this UniLoanInterestRecord. # noqa: E501 + :rtype: int + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this UniLoanInterestRecord. + + Created time # noqa: E501 + + :param create_time: The create_time of this UniLoanInterestRecord. # 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, UniLoanInterestRecord): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UniLoanInterestRecord): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/uni_loan_record.py b/gate_api/models/uni_loan_record.py new file mode 100644 index 0000000..460120b --- /dev/null +++ b/gate_api/models/uni_loan_record.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 UniLoanRecord(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'currency_pair': 'str', + 'currency': 'str', + 'amount': 'str', + 'create_time': 'int' + } + + attribute_map = { + 'type': 'type', + 'currency_pair': 'currency_pair', + 'currency': 'currency', + 'amount': 'amount', + 'create_time': 'create_time' + } + + def __init__(self, type=None, currency_pair=None, currency=None, amount=None, create_time=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, int, Configuration) -> None + """UniLoanRecord - a 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._currency_pair = None + self._currency = None + self._amount = None + self._create_time = None + self.discriminator = None + + if type is not None: + self.type = type + if currency_pair is not None: + self.currency_pair = currency_pair + if currency is not None: + self.currency = currency + if amount is not None: + self.amount = amount + if create_time is not None: + self.create_time = create_time + + @property + def type(self): + """Gets the type of this UniLoanRecord. # noqa: E501 + + Type: `borrow` - borrow, `repay` - repay # noqa: E501 + + :return: The type of this UniLoanRecord. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this UniLoanRecord. + + Type: `borrow` - borrow, `repay` - repay # noqa: E501 + + :param type: The type of this UniLoanRecord. # noqa: E501 + :type: str + """ + + self._type = type + + @property + def currency_pair(self): + """Gets the currency_pair of this UniLoanRecord. # noqa: E501 + + Currency pair # noqa: E501 + + :return: The currency_pair of this UniLoanRecord. # noqa: E501 + :rtype: str + """ + return self._currency_pair + + @currency_pair.setter + def currency_pair(self, currency_pair): + """Sets the currency_pair of this UniLoanRecord. + + Currency pair # noqa: E501 + + :param currency_pair: The currency_pair of this UniLoanRecord. # noqa: E501 + :type: str + """ + + self._currency_pair = currency_pair + + @property + def currency(self): + """Gets the currency of this UniLoanRecord. # noqa: E501 + + Currency # noqa: E501 + + :return: The currency of this UniLoanRecord. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this UniLoanRecord. + + Currency # noqa: E501 + + :param currency: The currency of this UniLoanRecord. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def amount(self): + """Gets the amount of this UniLoanRecord. # noqa: E501 + + Borrow or repayment amount # noqa: E501 + + :return: The amount of this UniLoanRecord. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this UniLoanRecord. + + Borrow or repayment amount # noqa: E501 + + :param amount: The amount of this UniLoanRecord. # noqa: E501 + :type: str + """ + + self._amount = amount + + @property + def create_time(self): + """Gets the create_time of this UniLoanRecord. # noqa: E501 + + Created time # noqa: E501 + + :return: The create_time of this UniLoanRecord. # noqa: E501 + :rtype: int + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this UniLoanRecord. + + Created time # noqa: E501 + + :param create_time: The create_time of this UniLoanRecord. # 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, UniLoanRecord): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UniLoanRecord): + 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 new file mode 100644 index 0000000..7c3f5e4 --- /dev/null +++ b/gate_api/models/unified_account.py @@ -0,0 +1,653 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class UnifiedAccount(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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': 'int', + 'refresh_time': 'int', + 'locked': 'bool', + 'balances': 'dict(str, UnifiedBalance)', + 'total': 'str', + 'borrowed': 'str', + 'total_initial_margin': 'str', + 'total_margin_balance': 'str', + 'total_maintenance_margin': 'str', + 'total_initial_margin_rate': 'str', + 'total_maintenance_margin_rate': 'str', + 'total_available_margin': 'str', + 'unified_account_total': 'str', + 'unified_account_total_liab': 'str', + 'unified_account_total_equity': 'str', + 'leverage': 'str', + 'spot_order_loss': 'str', + 'spot_hedge': 'bool', + 'use_funding': 'bool', + 'is_all_collateral': 'bool' + } + + attribute_map = { + 'user_id': 'user_id', + 'refresh_time': 'refresh_time', + 'locked': 'locked', + 'balances': 'balances', + 'total': 'total', + 'borrowed': 'borrowed', + 'total_initial_margin': 'total_initial_margin', + 'total_margin_balance': 'total_margin_balance', + 'total_maintenance_margin': 'total_maintenance_margin', + 'total_initial_margin_rate': 'total_initial_margin_rate', + 'total_maintenance_margin_rate': 'total_maintenance_margin_rate', + 'total_available_margin': 'total_available_margin', + 'unified_account_total': 'unified_account_total', + 'unified_account_total_liab': 'unified_account_total_liab', + 'unified_account_total_equity': 'unified_account_total_equity', + 'leverage': 'leverage', + 'spot_order_loss': 'spot_order_loss', + 'spot_hedge': 'spot_hedge', + 'use_funding': 'use_funding', + '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, 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, 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._user_id = None + self._refresh_time = None + self._locked = None + self._balances = None + self._total = None + self._borrowed = None + self._total_initial_margin = None + self._total_margin_balance = None + self._total_maintenance_margin = None + self._total_initial_margin_rate = None + self._total_maintenance_margin_rate = None + self._total_available_margin = None + self._unified_account_total = None + self._unified_account_total_liab = None + self._unified_account_total_equity = None + self._leverage = None + self._spot_order_loss = None + self._spot_hedge = None + self._use_funding = None + self._is_all_collateral = None + self.discriminator = None + + if user_id is not None: + self.user_id = user_id + if refresh_time is not None: + self.refresh_time = refresh_time + if locked is not None: + self.locked = locked + if balances is not None: + self.balances = balances + if total is not None: + self.total = total + if borrowed is not None: + self.borrowed = borrowed + if total_initial_margin is not None: + self.total_initial_margin = total_initial_margin + if total_margin_balance is not None: + self.total_margin_balance = total_margin_balance + if total_maintenance_margin is not None: + self.total_maintenance_margin = total_maintenance_margin + if total_initial_margin_rate is not None: + self.total_initial_margin_rate = total_initial_margin_rate + if total_maintenance_margin_rate is not None: + self.total_maintenance_margin_rate = total_maintenance_margin_rate + if total_available_margin is not None: + self.total_available_margin = total_available_margin + if unified_account_total is not None: + self.unified_account_total = unified_account_total + if unified_account_total_liab is not None: + self.unified_account_total_liab = unified_account_total_liab + if unified_account_total_equity is not None: + self.unified_account_total_equity = unified_account_total_equity + if leverage is not None: + self.leverage = leverage + if spot_order_loss is not None: + self.spot_order_loss = spot_order_loss + if spot_hedge is not None: + self.spot_hedge = spot_hedge + if use_funding is not None: + self.use_funding = use_funding + if is_all_collateral is not None: + self.is_all_collateral = is_all_collateral + + @property + def user_id(self): + """Gets the user_id of this UnifiedAccount. # noqa: E501 + + User ID # noqa: E501 + + :return: The user_id of this UnifiedAccount. # noqa: E501 + :rtype: int + """ + return self._user_id + + @user_id.setter + def user_id(self, user_id): + """Sets the user_id of this UnifiedAccount. + + User ID # noqa: E501 + + :param user_id: The user_id of this UnifiedAccount. # noqa: E501 + :type: int + """ + + self._user_id = user_id + + @property + def refresh_time(self): + """Gets the refresh_time of this UnifiedAccount. # noqa: E501 + + Last refresh time # noqa: E501 + + :return: The refresh_time of this UnifiedAccount. # noqa: E501 + :rtype: int + """ + return self._refresh_time + + @refresh_time.setter + def refresh_time(self, refresh_time): + """Sets the refresh_time of this UnifiedAccount. + + Last refresh time # noqa: E501 + + :param refresh_time: The refresh_time of this UnifiedAccount. # noqa: E501 + :type: int + """ + + self._refresh_time = refresh_time + + @property + def locked(self): + """Gets the locked of this UnifiedAccount. # noqa: E501 + + Whether the account is locked, valid in cross-currency margin/combined margin mode, false in other modes such as single-currency margin mode # noqa: E501 + + :return: The locked of this UnifiedAccount. # noqa: E501 + :rtype: bool + """ + return self._locked + + @locked.setter + def locked(self, locked): + """Sets the locked of this UnifiedAccount. + + Whether the account is locked, valid in cross-currency margin/combined margin mode, false in other modes such as single-currency margin mode # noqa: E501 + + :param locked: The locked of this UnifiedAccount. # noqa: E501 + :type: bool + """ + + self._locked = locked + + @property + def balances(self): + """Gets the balances of this UnifiedAccount. # noqa: E501 + + + :return: The balances of this UnifiedAccount. # noqa: E501 + :rtype: dict(str, UnifiedBalance) + """ + return self._balances + + @balances.setter + def balances(self, balances): + """Sets the balances of this UnifiedAccount. + + + :param balances: The balances of this UnifiedAccount. # noqa: E501 + :type: dict(str, UnifiedBalance) + """ + + self._balances = balances + + @property + def total(self): + """Gets the total of this UnifiedAccount. # noqa: E501 + + 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) # noqa: E501 + + :return: The total of this UnifiedAccount. # noqa: E501 + :rtype: str + """ + return self._total + + @total.setter + def total(self, total): + """Sets the total of this UnifiedAccount. + + 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) # noqa: E501 + + :param total: The total of this UnifiedAccount. # noqa: E501 + :type: str + """ + + self._total = total + + @property + def borrowed(self): + """Gets the borrowed of this UnifiedAccount. # noqa: E501 + + 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 # noqa: E501 + + :return: The borrowed of this UnifiedAccount. # noqa: E501 + :rtype: str + """ + return self._borrowed + + @borrowed.setter + def borrowed(self, borrowed): + """Sets the borrowed of this UnifiedAccount. + + 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 # noqa: E501 + + :param borrowed: The borrowed of this UnifiedAccount. # noqa: E501 + :type: str + """ + + self._borrowed = borrowed + + @property + 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 + + :return: The total_initial_margin of this UnifiedAccount. # noqa: E501 + :rtype: str + """ + return self._total_initial_margin + + @total_initial_margin.setter + 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 + + :param total_initial_margin: The total_initial_margin of this UnifiedAccount. # noqa: E501 + :type: str + """ + + self._total_initial_margin = total_initial_margin + + @property + 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 + + :return: The total_margin_balance of this UnifiedAccount. # noqa: E501 + :rtype: str + """ + return self._total_margin_balance + + @total_margin_balance.setter + 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 + + :param total_margin_balance: The total_margin_balance of this UnifiedAccount. # noqa: E501 + :type: str + """ + + self._total_margin_balance = total_margin_balance + + @property + 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 + + :return: The total_maintenance_margin of this UnifiedAccount. # noqa: E501 + :rtype: str + """ + return self._total_maintenance_margin + + @total_maintenance_margin.setter + 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 + + :param total_maintenance_margin: The total_maintenance_margin of this UnifiedAccount. # noqa: E501 + :type: str + """ + + self._total_maintenance_margin = total_maintenance_margin + + @property + 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 + + :return: The total_initial_margin_rate of this UnifiedAccount. # noqa: E501 + :rtype: str + """ + return self._total_initial_margin_rate + + @total_initial_margin_rate.setter + 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 + + :param total_initial_margin_rate: The total_initial_margin_rate of this UnifiedAccount. # noqa: E501 + :type: str + """ + + self._total_initial_margin_rate = total_initial_margin_rate + + @property + 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 + + :return: The total_maintenance_margin_rate of this UnifiedAccount. # noqa: E501 + :rtype: str + """ + return self._total_maintenance_margin_rate + + @total_maintenance_margin_rate.setter + 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 + + :param total_maintenance_margin_rate: The total_maintenance_margin_rate of this UnifiedAccount. # noqa: E501 + :type: str + """ + + self._total_maintenance_margin_rate = total_maintenance_margin_rate + + @property + def total_available_margin(self): + """Gets the total_available_margin of this UnifiedAccount. # noqa: E501 + + Available margin amount, valid in cross-currency margin/combined margin mode, 0 in other modes such as single-currency margin mode # noqa: E501 + + :return: The total_available_margin of this UnifiedAccount. # noqa: E501 + :rtype: str + """ + return self._total_available_margin + + @total_available_margin.setter + def total_available_margin(self, total_available_margin): + """Sets the total_available_margin of this UnifiedAccount. + + Available margin amount, valid in cross-currency margin/combined margin mode, 0 in other modes such as single-currency margin mode # noqa: E501 + + :param total_available_margin: The total_available_margin of this UnifiedAccount. # noqa: E501 + :type: str + """ + + self._total_available_margin = total_available_margin + + @property + 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 + + :return: The unified_account_total of this UnifiedAccount. # noqa: E501 + :rtype: str + """ + return self._unified_account_total + + @unified_account_total.setter + 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 + + :param unified_account_total: The unified_account_total of this UnifiedAccount. # noqa: E501 + :type: str + """ + + self._unified_account_total = unified_account_total + + @property + 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 + + :return: The unified_account_total_liab of this UnifiedAccount. # noqa: E501 + :rtype: str + """ + return self._unified_account_total_liab + + @unified_account_total_liab.setter + 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 + + :param unified_account_total_liab: The unified_account_total_liab of this UnifiedAccount. # noqa: E501 + :type: str + """ + + self._unified_account_total_liab = unified_account_total_liab + + @property + 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 + + :return: The unified_account_total_equity of this UnifiedAccount. # noqa: E501 + :rtype: str + """ + return self._unified_account_total_equity + + @unified_account_total_equity.setter + 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 + + :param unified_account_total_equity: The unified_account_total_equity of this UnifiedAccount. # noqa: E501 + :type: str + """ + + self._unified_account_total_equity = unified_account_total_equity + + @property + def leverage(self): + """Gets the leverage of this UnifiedAccount. # noqa: E501 + + Actual leverage ratio, valid in cross-currency margin/combined margin mode # noqa: E501 + + :return: The leverage of this UnifiedAccount. # noqa: E501 + :rtype: str + """ + return self._leverage + + @leverage.setter + def leverage(self, leverage): + """Sets the leverage of this UnifiedAccount. + + Actual leverage ratio, valid in cross-currency margin/combined margin mode # noqa: E501 + + :param leverage: The leverage of this UnifiedAccount. # noqa: E501 + :type: str + """ + + self._leverage = leverage + + @property + def spot_order_loss(self): + """Gets the spot_order_loss of this UnifiedAccount. # noqa: E501 + + Total pending order loss, in USDT, valid in cross-currency margin/combined margin mode, 0 in other modes such as single-currency margin mode # noqa: E501 + + :return: The spot_order_loss of this UnifiedAccount. # noqa: E501 + :rtype: str + """ + return self._spot_order_loss + + @spot_order_loss.setter + def spot_order_loss(self, spot_order_loss): + """Sets the spot_order_loss of this UnifiedAccount. + + Total pending order loss, in USDT, valid in cross-currency margin/combined margin mode, 0 in other modes such as single-currency margin mode # noqa: E501 + + :param spot_order_loss: The spot_order_loss of this UnifiedAccount. # noqa: E501 + :type: str + """ + + self._spot_order_loss = spot_order_loss + + @property + def spot_hedge(self): + """Gets the spot_hedge of this UnifiedAccount. # noqa: E501 + + Spot hedging status: true - enabled, false - disabled # noqa: E501 + + :return: The spot_hedge of this UnifiedAccount. # noqa: E501 + :rtype: bool + """ + return self._spot_hedge + + @spot_hedge.setter + def spot_hedge(self, spot_hedge): + """Sets the spot_hedge of this UnifiedAccount. + + Spot hedging status: true - enabled, false - disabled # noqa: E501 + + :param spot_hedge: The spot_hedge of this UnifiedAccount. # noqa: E501 + :type: bool + """ + + self._spot_hedge = spot_hedge + + @property + def use_funding(self): + """Gets the use_funding of this UnifiedAccount. # noqa: E501 + + Whether to use Earn funds as margin # noqa: E501 + + :return: The use_funding of this UnifiedAccount. # noqa: E501 + :rtype: bool + """ + return self._use_funding + + @use_funding.setter + def use_funding(self, use_funding): + """Sets the use_funding of this UnifiedAccount. + + Whether to use Earn funds as margin # noqa: E501 + + :param use_funding: The use_funding of this UnifiedAccount. # noqa: E501 + :type: bool + """ + + self._use_funding = use_funding + + @property + def is_all_collateral(self): + """Gets the is_all_collateral of this UnifiedAccount. # noqa: E501 + + Whether all currencies are used as margin: true - all currencies as margin, false - no # noqa: E501 + + :return: The is_all_collateral of this UnifiedAccount. # noqa: E501 + :rtype: bool + """ + return self._is_all_collateral + + @is_all_collateral.setter + def is_all_collateral(self, is_all_collateral): + """Sets the is_all_collateral of this UnifiedAccount. + + Whether all currencies are used as margin: true - all currencies as margin, false - no # noqa: E501 + + :param is_all_collateral: The is_all_collateral of this UnifiedAccount. # noqa: E501 + :type: bool + """ + + self._is_all_collateral = is_all_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, UnifiedAccount): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UnifiedAccount): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/unified_balance.py b/gate_api/models/unified_balance.py new file mode 100644 index 0000000..1d7171a --- /dev/null +++ b/gate_api/models/unified_balance.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 UnifiedBalance(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'available': 'str', + 'freeze': 'str', + 'borrowed': 'str', + 'negative_liab': 'str', + 'futures_pos_liab': 'str', + 'equity': 'str', + 'total_freeze': 'str', + 'total_liab': 'str', + 'spot_in_use': 'str', + 'funding': 'str', + 'funding_version': 'str', + 'cross_balance': 'str', + 'iso_balance': 'str', + 'im': 'str', + 'mm': 'str', + 'imr': 'str', + 'mmr': 'str', + 'margin_balance': 'str', + 'available_margin': 'str', + 'enabled_collateral': 'bool' + } + + attribute_map = { + 'available': 'available', + 'freeze': 'freeze', + 'borrowed': 'borrowed', + 'negative_liab': 'negative_liab', + 'futures_pos_liab': 'futures_pos_liab', + 'equity': 'equity', + 'total_freeze': 'total_freeze', + 'total_liab': 'total_liab', + 'spot_in_use': 'spot_in_use', + 'funding': 'funding', + 'funding_version': 'funding_version', + 'cross_balance': 'cross_balance', + 'iso_balance': 'iso_balance', + 'im': 'im', + 'mm': 'mm', + 'imr': 'imr', + 'mmr': 'mmr', + 'margin_balance': 'margin_balance', + 'available_margin': 'available_margin', + 'enabled_collateral': 'enabled_collateral' + } + + 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 + """UnifiedBalance - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._available = None + self._freeze = None + self._borrowed = None + self._negative_liab = None + self._futures_pos_liab = None + self._equity = None + self._total_freeze = None + self._total_liab = None + self._spot_in_use = None + self._funding = None + self._funding_version = None + self._cross_balance = None + self._iso_balance = None + self._im = None + self._mm = None + self._imr = None + self._mmr = None + self._margin_balance = None + self._available_margin = None + self._enabled_collateral = None + self.discriminator = None + + if available is not None: + self.available = available + if freeze is not None: + self.freeze = freeze + if borrowed is not None: + self.borrowed = borrowed + if negative_liab is not None: + self.negative_liab = negative_liab + if futures_pos_liab is not None: + self.futures_pos_liab = futures_pos_liab + if equity is not None: + self.equity = equity + if total_freeze is not None: + self.total_freeze = total_freeze + if total_liab is not None: + self.total_liab = total_liab + if spot_in_use is not None: + self.spot_in_use = spot_in_use + if funding is not None: + self.funding = funding + if funding_version is not None: + self.funding_version = funding_version + if cross_balance is not None: + self.cross_balance = cross_balance + if iso_balance is not None: + self.iso_balance = iso_balance + if im is not None: + self.im = im + if mm is not None: + self.mm = mm + if imr is not None: + self.imr = imr + if mmr is not None: + self.mmr = mmr + if margin_balance is not None: + self.margin_balance = margin_balance + if available_margin is not None: + self.available_margin = available_margin + if enabled_collateral is not None: + self.enabled_collateral = enabled_collateral + + @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 + + :return: The available of this UnifiedBalance. # noqa: E501 + :rtype: str + """ + return self._available + + @available.setter + 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 + + :param available: The available of this UnifiedBalance. # noqa: E501 + :type: str + """ + + self._available = available + + @property + 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 + + :return: The freeze of this UnifiedBalance. # noqa: E501 + :rtype: str + """ + return self._freeze + + @freeze.setter + 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 + + :param freeze: The freeze of this UnifiedBalance. # noqa: E501 + :type: str + """ + + self._freeze = freeze + + @property + def borrowed(self): + """Gets the borrowed of this UnifiedBalance. # noqa: E501 + + Borrowed amount, valid in cross-currency margin/combined margin mode, 0 in other modes such as single-currency margin mode # noqa: E501 + + :return: The borrowed of this UnifiedBalance. # noqa: E501 + :rtype: str + """ + return self._borrowed + + @borrowed.setter + def borrowed(self, borrowed): + """Sets the borrowed of this UnifiedBalance. + + Borrowed amount, valid in cross-currency margin/combined margin mode, 0 in other modes such as single-currency margin mode # noqa: E501 + + :param borrowed: The borrowed of this UnifiedBalance. # noqa: E501 + :type: str + """ + + self._borrowed = borrowed + + @property + def negative_liab(self): + """Gets the negative_liab of this UnifiedBalance. # noqa: E501 + + Negative balance borrowing, valid in cross-currency margin/combined margin mode, 0 in other modes such as single-currency margin mode # noqa: E501 + + :return: The negative_liab of this UnifiedBalance. # noqa: E501 + :rtype: str + """ + return self._negative_liab + + @negative_liab.setter + def negative_liab(self, negative_liab): + """Sets the negative_liab of this UnifiedBalance. + + Negative balance borrowing, valid in cross-currency margin/combined margin mode, 0 in other modes such as single-currency margin mode # noqa: E501 + + :param negative_liab: The negative_liab of this UnifiedBalance. # noqa: E501 + :type: str + """ + + self._negative_liab = negative_liab + + @property + def futures_pos_liab(self): + """Gets the futures_pos_liab of this UnifiedBalance. # noqa: E501 + + Contract opening position borrowing currency (abandoned, to be offline field) # noqa: E501 + + :return: The futures_pos_liab of this UnifiedBalance. # noqa: E501 + :rtype: str + """ + return self._futures_pos_liab + + @futures_pos_liab.setter + def futures_pos_liab(self, futures_pos_liab): + """Sets the futures_pos_liab of this UnifiedBalance. + + Contract opening position borrowing currency (abandoned, to be offline field) # noqa: E501 + + :param futures_pos_liab: The futures_pos_liab of this UnifiedBalance. # noqa: E501 + :type: str + """ + + self._futures_pos_liab = futures_pos_liab + + @property + 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 + + :return: The equity of this UnifiedBalance. # noqa: E501 + :rtype: str + """ + return self._equity + + @equity.setter + def equity(self, equity): + """Sets the equity of this UnifiedBalance. + + Equity, valid in single currency margin/cross currency margin/combined margin mode # noqa: E501 + + :param equity: The equity of this UnifiedBalance. # noqa: E501 + :type: str + """ + + self._equity = equity + + @property + def total_freeze(self): + """Gets the total_freeze of this UnifiedBalance. # noqa: E501 + + Total frozen (deprecated, to be removed) # noqa: E501 + + :return: The total_freeze of this UnifiedBalance. # noqa: E501 + :rtype: str + """ + return self._total_freeze + + @total_freeze.setter + def total_freeze(self, total_freeze): + """Sets the total_freeze of this UnifiedBalance. + + Total frozen (deprecated, to be removed) # noqa: E501 + + :param total_freeze: The total_freeze of this UnifiedBalance. # noqa: E501 + :type: str + """ + + self._total_freeze = total_freeze + + @property + def total_liab(self): + """Gets the total_liab of this UnifiedBalance. # noqa: E501 + + Total borrowed amount, valid in cross-currency margin/combined margin mode, 0 in other modes such as single-currency margin mode # noqa: E501 + + :return: The total_liab of this UnifiedBalance. # noqa: E501 + :rtype: str + """ + return self._total_liab + + @total_liab.setter + def total_liab(self, total_liab): + """Sets the total_liab of this UnifiedBalance. + + Total borrowed amount, valid in cross-currency margin/combined margin mode, 0 in other modes such as single-currency margin mode # noqa: E501 + + :param total_liab: The total_liab of this UnifiedBalance. # noqa: E501 + :type: str + """ + + self._total_liab = total_liab + + @property + def spot_in_use(self): + """Gets the spot_in_use of this UnifiedBalance. # noqa: E501 + + 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 # noqa: E501 + + :return: The spot_in_use of this UnifiedBalance. # noqa: E501 + :rtype: str + """ + return self._spot_in_use + + @spot_in_use.setter + def spot_in_use(self, spot_in_use): + """Sets the spot_in_use of this UnifiedBalance. + + 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 # noqa: E501 + + :param spot_in_use: The spot_in_use of this UnifiedBalance. # noqa: E501 + :type: str + """ + + self._spot_in_use = spot_in_use + + @property + def funding(self): + """Gets the funding of this UnifiedBalance. # noqa: E501 + + Uniloan financial management amount, effective when turned on as a unified account margin switch # noqa: E501 + + :return: The funding of this UnifiedBalance. # noqa: E501 + :rtype: str + """ + return self._funding + + @funding.setter + def funding(self, funding): + """Sets the funding of this UnifiedBalance. + + Uniloan financial management amount, effective when turned on as a unified account margin switch # noqa: E501 + + :param funding: The funding of this UnifiedBalance. # noqa: E501 + :type: str + """ + + self._funding = funding + + @property + def funding_version(self): + """Gets the funding_version of this UnifiedBalance. # noqa: E501 + + Funding version # noqa: E501 + + :return: The funding_version of this UnifiedBalance. # noqa: E501 + :rtype: str + """ + return self._funding_version + + @funding_version.setter + def funding_version(self, funding_version): + """Sets the funding_version of this UnifiedBalance. + + Funding version # noqa: E501 + + :param funding_version: The funding_version of this UnifiedBalance. # noqa: E501 + :type: str + """ + + self._funding_version = funding_version + + @property + def cross_balance(self): + """Gets the cross_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 + + :return: The cross_balance of this UnifiedBalance. # noqa: E501 + :rtype: str + """ + return self._cross_balance + + @cross_balance.setter + def cross_balance(self, cross_balance): + """Sets the cross_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 + + :param cross_balance: The cross_balance of this UnifiedBalance. # noqa: E501 + :type: str + """ + + self._cross_balance = cross_balance + + @property + def iso_balance(self): + """Gets the iso_balance of this UnifiedBalance. # noqa: E501 + + Isolated 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 + + :return: The iso_balance of this UnifiedBalance. # noqa: E501 + :rtype: str + """ + return self._iso_balance + + @iso_balance.setter + def iso_balance(self, iso_balance): + """Sets the iso_balance of this UnifiedBalance. + + Isolated 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 + + :param iso_balance: The iso_balance of this UnifiedBalance. # noqa: E501 + :type: str + """ + + self._iso_balance = iso_balance + + @property + 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 + + :return: The im of this UnifiedBalance. # noqa: E501 + :rtype: str + """ + return self._im + + @im.setter + 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 + + :param im: The im of this UnifiedBalance. # noqa: E501 + :type: str + """ + + self._im = im + + @property + 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 + + :return: The mm of this UnifiedBalance. # noqa: E501 + :rtype: str + """ + return self._mm + + @mm.setter + 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 + + :param mm: The mm of this UnifiedBalance. # noqa: E501 + :type: str + """ + + self._mm = mm + + @property + 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 + + :return: The imr of this UnifiedBalance. # noqa: E501 + :rtype: str + """ + return self._imr + + @imr.setter + 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 + + :param imr: The imr of this UnifiedBalance. # noqa: E501 + :type: str + """ + + self._imr = imr + + @property + 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 + + :return: The mmr of this UnifiedBalance. # noqa: E501 + :rtype: str + """ + return self._mmr + + @mmr.setter + 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 + + :param mmr: The mmr of this UnifiedBalance. # noqa: E501 + :type: str + """ + + self._mmr = mmr + + @property + 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 + + :return: The margin_balance of this UnifiedBalance. # noqa: E501 + :rtype: str + """ + return self._margin_balance + + @margin_balance.setter + 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 + + :param margin_balance: The margin_balance of this UnifiedBalance. # noqa: E501 + :type: str + """ + + self._margin_balance = margin_balance + + @property + 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 + + :return: The available_margin of this UnifiedBalance. # noqa: E501 + :rtype: str + """ + return self._available_margin + + @available_margin.setter + 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 + + :param available_margin: The available_margin of this UnifiedBalance. # noqa: E501 + :type: str + """ + + self._available_margin = available_margin + + @property + def enabled_collateral(self): + """Gets the enabled_collateral of this UnifiedBalance. # noqa: E501 + + Currency enabled as margin: true - Enabled, false - Disabled # noqa: E501 + + :return: The enabled_collateral of this UnifiedBalance. # noqa: E501 + :rtype: bool + """ + return self._enabled_collateral + + @enabled_collateral.setter + def enabled_collateral(self, enabled_collateral): + """Sets the enabled_collateral of this UnifiedBalance. + + Currency enabled as margin: true - Enabled, false - Disabled # noqa: E501 + + :param enabled_collateral: The enabled_collateral of this UnifiedBalance. # noqa: E501 + :type: bool + """ + + self._enabled_collateral = enabled_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, UnifiedBalance): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UnifiedBalance): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/cross_margin_borrowable.py b/gate_api/models/unified_borrowable.py similarity index 63% rename from gate_api/models/cross_margin_borrowable.py rename to gate_api/models/unified_borrowable.py index a5fe9c4..7201c76 100644 --- a/gate_api/models/cross_margin_borrowable.py +++ b/gate_api/models/unified_borrowable.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -18,7 +18,7 @@ from gate_api.configuration import Configuration -class CrossMarginBorrowable(object): +class UnifiedBorrowable(object): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -32,13 +32,19 @@ class CrossMarginBorrowable(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {'currency': 'str', 'amount': 'str'} + openapi_types = { + 'currency': 'str', + 'amount': 'str' + } - attribute_map = {'currency': 'currency', 'amount': 'amount'} + attribute_map = { + 'currency': 'currency', + 'amount': 'amount' + } def __init__(self, currency=None, amount=None, local_vars_configuration=None): # noqa: E501 # type: (str, str, Configuration) -> None - """CrossMarginBorrowable - a model defined in OpenAPI""" # noqa: E501 + """UnifiedBorrowable - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() self.local_vars_configuration = local_vars_configuration @@ -54,22 +60,22 @@ def __init__(self, currency=None, amount=None, local_vars_configuration=None): @property def currency(self): - """Gets the currency of this CrossMarginBorrowable. # noqa: E501 + """Gets the currency of this UnifiedBorrowable. # noqa: E501 Currency detail # noqa: E501 - :return: The currency of this CrossMarginBorrowable. # noqa: E501 + :return: The currency of this UnifiedBorrowable. # noqa: E501 :rtype: str """ return self._currency @currency.setter def currency(self, currency): - """Sets the currency of this CrossMarginBorrowable. + """Sets the currency of this UnifiedBorrowable. Currency detail # noqa: E501 - :param currency: The currency of this CrossMarginBorrowable. # noqa: E501 + :param currency: The currency of this UnifiedBorrowable. # noqa: E501 :type: str """ @@ -77,22 +83,22 @@ def currency(self, currency): @property def amount(self): - """Gets the amount of this CrossMarginBorrowable. # noqa: E501 + """Gets the amount of this UnifiedBorrowable. # noqa: E501 Max borrowable amount # noqa: E501 - :return: The amount of this CrossMarginBorrowable. # noqa: E501 + :return: The amount of this UnifiedBorrowable. # noqa: E501 :rtype: str """ return self._amount @amount.setter def amount(self, amount): - """Sets the amount of this CrossMarginBorrowable. + """Sets the amount of this UnifiedBorrowable. Max borrowable amount # noqa: E501 - :param amount: The amount of this CrossMarginBorrowable. # noqa: E501 + :param amount: The amount of this UnifiedBorrowable. # noqa: E501 :type: str """ @@ -105,16 +111,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value @@ -130,14 +138,14 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, CrossMarginBorrowable): + if not isinstance(other, UnifiedBorrowable): return False return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - if not isinstance(other, CrossMarginBorrowable): + if not isinstance(other, UnifiedBorrowable): return True return self.to_dict() != other.to_dict() diff --git a/gate_api/models/cross_margin_transferable.py b/gate_api/models/unified_borrowable1.py similarity index 61% rename from gate_api/models/cross_margin_transferable.py rename to gate_api/models/unified_borrowable1.py index f38d641..626d1af 100644 --- a/gate_api/models/cross_margin_transferable.py +++ b/gate_api/models/unified_borrowable1.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -18,7 +18,7 @@ from gate_api.configuration import Configuration -class CrossMarginTransferable(object): +class UnifiedBorrowable1(object): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -32,13 +32,19 @@ class CrossMarginTransferable(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {'currency': 'str', 'amount': 'str'} + openapi_types = { + 'currency': 'str', + 'amount': 'str' + } - attribute_map = {'currency': 'currency', 'amount': 'amount'} + attribute_map = { + 'currency': 'currency', + 'amount': 'amount' + } def __init__(self, currency=None, amount=None, local_vars_configuration=None): # noqa: E501 # type: (str, str, Configuration) -> None - """CrossMarginTransferable - a model defined in OpenAPI""" # noqa: E501 + """UnifiedBorrowable1 - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() self.local_vars_configuration = local_vars_configuration @@ -54,22 +60,22 @@ def __init__(self, currency=None, amount=None, local_vars_configuration=None): @property def currency(self): - """Gets the currency of this CrossMarginTransferable. # noqa: E501 + """Gets the currency of this UnifiedBorrowable1. # noqa: E501 Currency detail # noqa: E501 - :return: The currency of this CrossMarginTransferable. # noqa: E501 + :return: The currency of this UnifiedBorrowable1. # noqa: E501 :rtype: str """ return self._currency @currency.setter def currency(self, currency): - """Sets the currency of this CrossMarginTransferable. + """Sets the currency of this UnifiedBorrowable1. Currency detail # noqa: E501 - :param currency: The currency of this CrossMarginTransferable. # noqa: E501 + :param currency: The currency of this UnifiedBorrowable1. # noqa: E501 :type: str """ @@ -77,22 +83,22 @@ def currency(self, currency): @property def amount(self): - """Gets the amount of this CrossMarginTransferable. # noqa: E501 + """Gets the amount of this UnifiedBorrowable1. # noqa: E501 - Max transferable amount # noqa: E501 + Maximum borrowable amount # noqa: E501 - :return: The amount of this CrossMarginTransferable. # noqa: E501 + :return: The amount of this UnifiedBorrowable1. # noqa: E501 :rtype: str """ return self._amount @amount.setter def amount(self, amount): - """Sets the amount of this CrossMarginTransferable. + """Sets the amount of this UnifiedBorrowable1. - Max transferable amount # noqa: E501 + Maximum borrowable amount # noqa: E501 - :param amount: The amount of this CrossMarginTransferable. # noqa: E501 + :param amount: The amount of this UnifiedBorrowable1. # noqa: E501 :type: str """ @@ -105,16 +111,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value @@ -130,14 +138,14 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, CrossMarginTransferable): + if not isinstance(other, UnifiedBorrowable1): return False return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - if not isinstance(other, CrossMarginTransferable): + if not isinstance(other, UnifiedBorrowable1): return True return self.to_dict() != other.to_dict() diff --git a/gate_api/models/unified_collateral_req.py b/gate_api/models/unified_collateral_req.py new file mode 100644 index 0000000..6e4c9c2 --- /dev/null +++ b/gate_api/models/unified_collateral_req.py @@ -0,0 +1,185 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class UnifiedCollateralReq(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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_type': 'int', + 'enable_list': 'list[str]', + 'disable_list': 'list[str]' + } + + attribute_map = { + 'collateral_type': 'collateral_type', + 'enable_list': 'enable_list', + 'disable_list': 'disable_list' + } + + def __init__(self, collateral_type=None, enable_list=None, disable_list=None, local_vars_configuration=None): # noqa: E501 + # type: (int, list[str], list[str], Configuration) -> None + """UnifiedCollateralReq - a 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_type = None + self._enable_list = None + self._disable_list = None + self.discriminator = None + + if collateral_type is not None: + self.collateral_type = collateral_type + if enable_list is not None: + self.enable_list = enable_list + if disable_list is not None: + self.disable_list = disable_list + + @property + def collateral_type(self): + """Gets the collateral_type of this UnifiedCollateralReq. # noqa: E501 + + User-set collateral mode: 0(all)-All currencies as collateral, 1(custom)-Custom currencies as collateral. When collateral_type is 0(all), enable_list and disable_list parameters are invalid # noqa: E501 + + :return: The collateral_type of this UnifiedCollateralReq. # noqa: E501 + :rtype: int + """ + return self._collateral_type + + @collateral_type.setter + def collateral_type(self, collateral_type): + """Sets the collateral_type of this UnifiedCollateralReq. + + User-set collateral mode: 0(all)-All currencies as collateral, 1(custom)-Custom currencies as collateral. When collateral_type is 0(all), enable_list and disable_list parameters are invalid # noqa: E501 + + :param collateral_type: The collateral_type of this UnifiedCollateralReq. # noqa: E501 + :type: int + """ + allowed_values = [0, 1] # noqa: E501 + if self.local_vars_configuration.client_side_validation and collateral_type not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `collateral_type` ({0}), must be one of {1}" # noqa: E501 + .format(collateral_type, allowed_values) + ) + + self._collateral_type = collateral_type + + @property + def enable_list(self): + """Gets the enable_list of this UnifiedCollateralReq. # noqa: E501 + + Currency list, where collateral_type=1(custom) indicates the addition logic # noqa: E501 + + :return: The enable_list of this UnifiedCollateralReq. # noqa: E501 + :rtype: list[str] + """ + return self._enable_list + + @enable_list.setter + def enable_list(self, enable_list): + """Sets the enable_list of this UnifiedCollateralReq. + + Currency list, where collateral_type=1(custom) indicates the addition logic # noqa: E501 + + :param enable_list: The enable_list of this UnifiedCollateralReq. # noqa: E501 + :type: list[str] + """ + + self._enable_list = enable_list + + @property + def disable_list(self): + """Gets the disable_list of this UnifiedCollateralReq. # noqa: E501 + + Disable list, indicating the disable logic # noqa: E501 + + :return: The disable_list of this UnifiedCollateralReq. # noqa: E501 + :rtype: list[str] + """ + return self._disable_list + + @disable_list.setter + def disable_list(self, disable_list): + """Sets the disable_list of this UnifiedCollateralReq. + + Disable list, indicating the disable logic # noqa: E501 + + :param disable_list: The disable_list of this UnifiedCollateralReq. # noqa: E501 + :type: list[str] + """ + + self._disable_list = disable_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, UnifiedCollateralReq): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UnifiedCollateralReq): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/unified_collateral_res.py b/gate_api/models/unified_collateral_res.py new file mode 100644 index 0000000..a1cd842 --- /dev/null +++ b/gate_api/models/unified_collateral_res.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 UnifiedCollateralRes(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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_success': 'bool' + } + + attribute_map = { + 'is_success': 'is_success' + } + + def __init__(self, is_success=None, local_vars_configuration=None): # noqa: E501 + # type: (bool, Configuration) -> None + """UnifiedCollateralRes - a 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_success = None + self.discriminator = None + + if is_success is not None: + self.is_success = is_success + + @property + def is_success(self): + """Gets the is_success of this UnifiedCollateralRes. # noqa: E501 + + Whether the setting was successful # noqa: E501 + + :return: The is_success of this UnifiedCollateralRes. # noqa: E501 + :rtype: bool + """ + return self._is_success + + @is_success.setter + def is_success(self, is_success): + """Sets the is_success of this UnifiedCollateralRes. + + Whether the setting was successful # noqa: E501 + + :param is_success: The is_success of this UnifiedCollateralRes. # noqa: E501 + :type: bool + """ + + self._is_success = is_success + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, UnifiedCollateralRes): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UnifiedCollateralRes): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/unified_currency.py b/gate_api/models/unified_currency.py new file mode 100644 index 0000000..1039e91 --- /dev/null +++ b/gate_api/models/unified_currency.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 UnifiedCurrency(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'prec': 'str', + 'min_borrow_amount': 'str', + 'user_max_borrow_amount': 'str', + 'total_max_borrow_amount': 'str', + 'loan_status': 'str' + } + + attribute_map = { + 'name': 'name', + 'prec': 'prec', + 'min_borrow_amount': 'min_borrow_amount', + 'user_max_borrow_amount': 'user_max_borrow_amount', + 'total_max_borrow_amount': 'total_max_borrow_amount', + 'loan_status': 'loan_status' + } + + def __init__(self, name=None, prec=None, min_borrow_amount=None, user_max_borrow_amount=None, total_max_borrow_amount=None, loan_status=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, Configuration) -> None + """UnifiedCurrency - a 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._prec = None + self._min_borrow_amount = None + self._user_max_borrow_amount = None + self._total_max_borrow_amount = None + self._loan_status = None + self.discriminator = None + + if name is not None: + self.name = name + if prec is not None: + self.prec = prec + if min_borrow_amount is not None: + self.min_borrow_amount = min_borrow_amount + if user_max_borrow_amount is not None: + self.user_max_borrow_amount = user_max_borrow_amount + if total_max_borrow_amount is not None: + self.total_max_borrow_amount = total_max_borrow_amount + if loan_status is not None: + self.loan_status = loan_status + + @property + def name(self): + """Gets the name of this UnifiedCurrency. # noqa: E501 + + Currency name # noqa: E501 + + :return: The name of this UnifiedCurrency. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this UnifiedCurrency. + + Currency name # noqa: E501 + + :param name: The name of this UnifiedCurrency. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def prec(self): + """Gets the prec of this UnifiedCurrency. # noqa: E501 + + Currency precision # noqa: E501 + + :return: The prec of this UnifiedCurrency. # noqa: E501 + :rtype: str + """ + return self._prec + + @prec.setter + def prec(self, prec): + """Sets the prec of this UnifiedCurrency. + + Currency precision # noqa: E501 + + :param prec: The prec of this UnifiedCurrency. # noqa: E501 + :type: str + """ + + self._prec = prec + + @property + def min_borrow_amount(self): + """Gets the min_borrow_amount of this UnifiedCurrency. # noqa: E501 + + Minimum borrowable limit, in currency units # noqa: E501 + + :return: The min_borrow_amount of this UnifiedCurrency. # 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 UnifiedCurrency. + + Minimum borrowable limit, in currency units # noqa: E501 + + :param min_borrow_amount: The min_borrow_amount of this UnifiedCurrency. # noqa: E501 + :type: str + """ + + self._min_borrow_amount = min_borrow_amount + + @property + def user_max_borrow_amount(self): + """Gets the user_max_borrow_amount of this UnifiedCurrency. # noqa: E501 + + User's maximum borrowable limit, in USDT # noqa: E501 + + :return: The user_max_borrow_amount of this UnifiedCurrency. # noqa: E501 + :rtype: str + """ + return self._user_max_borrow_amount + + @user_max_borrow_amount.setter + def user_max_borrow_amount(self, user_max_borrow_amount): + """Sets the user_max_borrow_amount of this UnifiedCurrency. + + User's maximum borrowable limit, in USDT # noqa: E501 + + :param user_max_borrow_amount: The user_max_borrow_amount of this UnifiedCurrency. # noqa: E501 + :type: str + """ + + self._user_max_borrow_amount = user_max_borrow_amount + + @property + def total_max_borrow_amount(self): + """Gets the total_max_borrow_amount of this UnifiedCurrency. # noqa: E501 + + Platform's maximum borrowable limit, in USDT # noqa: E501 + + :return: The total_max_borrow_amount of this UnifiedCurrency. # noqa: E501 + :rtype: str + """ + return self._total_max_borrow_amount + + @total_max_borrow_amount.setter + def total_max_borrow_amount(self, total_max_borrow_amount): + """Sets the total_max_borrow_amount of this UnifiedCurrency. + + Platform's maximum borrowable limit, in USDT # noqa: E501 + + :param total_max_borrow_amount: The total_max_borrow_amount of this UnifiedCurrency. # noqa: E501 + :type: str + """ + + self._total_max_borrow_amount = total_max_borrow_amount + + @property + def loan_status(self): + """Gets the loan_status of this UnifiedCurrency. # noqa: E501 + + Lending status - `disable` : Lending prohibited - `enable` : Lending supported # noqa: E501 + + :return: The loan_status of this UnifiedCurrency. # noqa: E501 + :rtype: str + """ + return self._loan_status + + @loan_status.setter + def loan_status(self, loan_status): + """Sets the loan_status of this UnifiedCurrency. + + Lending status - `disable` : Lending prohibited - `enable` : Lending supported # noqa: E501 + + :param loan_status: The loan_status of this UnifiedCurrency. # noqa: E501 + :type: str + """ + + self._loan_status = loan_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, UnifiedCurrency): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UnifiedCurrency): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/unified_discount.py b/gate_api/models/unified_discount.py new file mode 100644 index 0000000..27cad2c --- /dev/null +++ b/gate_api/models/unified_discount.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 UnifiedDiscount(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'discount_tiers': 'list[UnifiedDiscountTiers]' + } + + attribute_map = { + 'currency': 'currency', + 'discount_tiers': 'discount_tiers' + } + + def __init__(self, currency=None, discount_tiers=None, local_vars_configuration=None): # noqa: E501 + # type: (str, list[UnifiedDiscountTiers], Configuration) -> None + """UnifiedDiscount - a 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._discount_tiers = None + self.discriminator = None + + if currency is not None: + self.currency = currency + if discount_tiers is not None: + self.discount_tiers = discount_tiers + + @property + def currency(self): + """Gets the currency of this UnifiedDiscount. # noqa: E501 + + Currency name # noqa: E501 + + :return: The currency of this UnifiedDiscount. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this UnifiedDiscount. + + Currency name # noqa: E501 + + :param currency: The currency of this UnifiedDiscount. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def discount_tiers(self): + """Gets the discount_tiers of this UnifiedDiscount. # noqa: E501 + + Tiered discount # noqa: E501 + + :return: The discount_tiers of this UnifiedDiscount. # noqa: E501 + :rtype: list[UnifiedDiscountTiers] + """ + return self._discount_tiers + + @discount_tiers.setter + def discount_tiers(self, discount_tiers): + """Sets the discount_tiers of this UnifiedDiscount. + + Tiered discount # noqa: E501 + + :param discount_tiers: The discount_tiers of this UnifiedDiscount. # noqa: E501 + :type: list[UnifiedDiscountTiers] + """ + + self._discount_tiers = discount_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, UnifiedDiscount): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UnifiedDiscount): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/unified_discount_tiers.py b/gate_api/models/unified_discount_tiers.py new file mode 100644 index 0000000..1487ce8 --- /dev/null +++ b/gate_api/models/unified_discount_tiers.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 UnifiedDiscountTiers(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'tier': 'str', + 'discount': 'str', + 'lower_limit': 'str', + 'upper_limit': 'str', + 'leverage': 'str' + } + + attribute_map = { + 'tier': 'tier', + 'discount': 'discount', + 'lower_limit': 'lower_limit', + 'upper_limit': 'upper_limit', + 'leverage': 'leverage' + } + + def __init__(self, tier=None, discount=None, lower_limit=None, upper_limit=None, leverage=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, Configuration) -> None + """UnifiedDiscountTiers - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._tier = None + self._discount = None + self._lower_limit = None + self._upper_limit = None + self._leverage = None + self.discriminator = None + + if tier is not None: + self.tier = tier + if discount is not None: + self.discount = discount + if lower_limit is not None: + self.lower_limit = lower_limit + if upper_limit is not None: + self.upper_limit = upper_limit + if leverage is not None: + self.leverage = leverage + + @property + def tier(self): + """Gets the tier of this UnifiedDiscountTiers. # noqa: E501 + + Tier # noqa: E501 + + :return: The tier of this UnifiedDiscountTiers. # noqa: E501 + :rtype: str + """ + return self._tier + + @tier.setter + def tier(self, tier): + """Sets the tier of this UnifiedDiscountTiers. + + Tier # noqa: E501 + + :param tier: The tier of this UnifiedDiscountTiers. # noqa: E501 + :type: str + """ + + self._tier = tier + + @property + def discount(self): + """Gets the discount of this UnifiedDiscountTiers. # noqa: E501 + + Discount # noqa: E501 + + :return: The discount of this UnifiedDiscountTiers. # noqa: E501 + :rtype: str + """ + return self._discount + + @discount.setter + def discount(self, discount): + """Sets the discount of this UnifiedDiscountTiers. + + Discount # noqa: E501 + + :param discount: The discount of this UnifiedDiscountTiers. # noqa: E501 + :type: str + """ + + self._discount = discount + + @property + def lower_limit(self): + """Gets the lower_limit of this UnifiedDiscountTiers. # noqa: E501 + + Lower limit # noqa: E501 + + :return: The lower_limit of this UnifiedDiscountTiers. # noqa: E501 + :rtype: str + """ + return self._lower_limit + + @lower_limit.setter + def lower_limit(self, lower_limit): + """Sets the lower_limit of this UnifiedDiscountTiers. + + Lower limit # noqa: E501 + + :param lower_limit: The lower_limit of this UnifiedDiscountTiers. # noqa: E501 + :type: str + """ + + self._lower_limit = lower_limit + + @property + def upper_limit(self): + """Gets the upper_limit of this UnifiedDiscountTiers. # noqa: E501 + + Upper limit, + indicates positive infinity # noqa: E501 + + :return: The upper_limit of this UnifiedDiscountTiers. # noqa: E501 + :rtype: str + """ + return self._upper_limit + + @upper_limit.setter + def upper_limit(self, upper_limit): + """Sets the upper_limit of this UnifiedDiscountTiers. + + Upper limit, + indicates positive infinity # noqa: E501 + + :param upper_limit: The upper_limit of this UnifiedDiscountTiers. # noqa: E501 + :type: str + """ + + self._upper_limit = upper_limit + + @property + def leverage(self): + """Gets the leverage of this UnifiedDiscountTiers. # noqa: E501 + + Position leverage # noqa: E501 + + :return: The leverage of this UnifiedDiscountTiers. # noqa: E501 + :rtype: str + """ + return self._leverage + + @leverage.setter + def leverage(self, leverage): + """Sets the leverage of this UnifiedDiscountTiers. + + Position leverage # noqa: E501 + + :param leverage: The leverage of this UnifiedDiscountTiers. # 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, UnifiedDiscountTiers): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UnifiedDiscountTiers): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/unified_history_loan_rate.py b/gate_api/models/unified_history_loan_rate.py new file mode 100644 index 0000000..dd3edd2 --- /dev/null +++ b/gate_api/models/unified_history_loan_rate.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 UnifiedHistoryLoanRate(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'tier': 'str', + 'tier_up_rate': 'str', + 'rates': 'list[UnifiedHistoryLoanRateRates]' + } + + attribute_map = { + 'currency': 'currency', + 'tier': 'tier', + 'tier_up_rate': 'tier_up_rate', + 'rates': 'rates' + } + + def __init__(self, currency=None, tier=None, tier_up_rate=None, rates=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, list[UnifiedHistoryLoanRateRates], Configuration) -> None + """UnifiedHistoryLoanRate - a 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._tier = None + self._tier_up_rate = None + self._rates = None + self.discriminator = None + + if currency is not None: + self.currency = currency + if tier is not None: + self.tier = tier + if tier_up_rate is not None: + self.tier_up_rate = tier_up_rate + if rates is not None: + self.rates = rates + + @property + def currency(self): + """Gets the currency of this UnifiedHistoryLoanRate. # noqa: E501 + + Currency name # noqa: E501 + + :return: The currency of this UnifiedHistoryLoanRate. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this UnifiedHistoryLoanRate. + + Currency name # noqa: E501 + + :param currency: The currency of this UnifiedHistoryLoanRate. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def tier(self): + """Gets the tier of this UnifiedHistoryLoanRate. # noqa: E501 + + VIP level for the floating rate to be retrieved # noqa: E501 + + :return: The tier of this UnifiedHistoryLoanRate. # noqa: E501 + :rtype: str + """ + return self._tier + + @tier.setter + def tier(self, tier): + """Sets the tier of this UnifiedHistoryLoanRate. + + VIP level for the floating rate to be retrieved # noqa: E501 + + :param tier: The tier of this UnifiedHistoryLoanRate. # noqa: E501 + :type: str + """ + + self._tier = tier + + @property + def tier_up_rate(self): + """Gets the tier_up_rate of this UnifiedHistoryLoanRate. # noqa: E501 + + Floating rate corresponding to VIP level # noqa: E501 + + :return: The tier_up_rate of this UnifiedHistoryLoanRate. # noqa: E501 + :rtype: str + """ + return self._tier_up_rate + + @tier_up_rate.setter + def tier_up_rate(self, tier_up_rate): + """Sets the tier_up_rate of this UnifiedHistoryLoanRate. + + Floating rate corresponding to VIP level # noqa: E501 + + :param tier_up_rate: The tier_up_rate of this UnifiedHistoryLoanRate. # noqa: E501 + :type: str + """ + + self._tier_up_rate = tier_up_rate + + @property + def rates(self): + """Gets the rates of this UnifiedHistoryLoanRate. # noqa: E501 + + Historical interest rate information, one data point per hour, array size determined by page and limit parameters from the API request, sorted by time from recent to distant # noqa: E501 + + :return: The rates of this UnifiedHistoryLoanRate. # noqa: E501 + :rtype: list[UnifiedHistoryLoanRateRates] + """ + return self._rates + + @rates.setter + def rates(self, rates): + """Sets the rates of this UnifiedHistoryLoanRate. + + Historical interest rate information, one data point per hour, array size determined by page and limit parameters from the API request, sorted by time from recent to distant # noqa: E501 + + :param rates: The rates of this UnifiedHistoryLoanRate. # noqa: E501 + :type: list[UnifiedHistoryLoanRateRates] + """ + + self._rates = rates + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, UnifiedHistoryLoanRate): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UnifiedHistoryLoanRate): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/unified_history_loan_rate_rates.py b/gate_api/models/unified_history_loan_rate_rates.py new file mode 100644 index 0000000..100221f --- /dev/null +++ b/gate_api/models/unified_history_loan_rate_rates.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 UnifiedHistoryLoanRateRates(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'rate': 'str' + } + + attribute_map = { + 'time': 'time', + 'rate': 'rate' + } + + def __init__(self, time=None, rate=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, Configuration) -> None + """UnifiedHistoryLoanRateRates - a 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._rate = None + self.discriminator = None + + if time is not None: + self.time = time + if rate is not None: + self.rate = rate + + @property + def time(self): + """Gets the time of this UnifiedHistoryLoanRateRates. # noqa: E501 + + Hourly timestamp corresponding to this interest rate, in milliseconds # noqa: E501 + + :return: The time of this UnifiedHistoryLoanRateRates. # noqa: E501 + :rtype: int + """ + return self._time + + @time.setter + def time(self, time): + """Sets the time of this UnifiedHistoryLoanRateRates. + + Hourly timestamp corresponding to this interest rate, in milliseconds # noqa: E501 + + :param time: The time of this UnifiedHistoryLoanRateRates. # noqa: E501 + :type: int + """ + + self._time = time + + @property + def rate(self): + """Gets the rate of this UnifiedHistoryLoanRateRates. # noqa: E501 + + Historical interest rate for this hour # noqa: E501 + + :return: The rate of this UnifiedHistoryLoanRateRates. # noqa: E501 + :rtype: str + """ + return self._rate + + @rate.setter + def rate(self, rate): + """Sets the rate of this UnifiedHistoryLoanRateRates. + + Historical interest rate for this hour # noqa: E501 + + :param rate: The rate of this UnifiedHistoryLoanRateRates. # noqa: E501 + :type: str + """ + + self._rate = 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, UnifiedHistoryLoanRateRates): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UnifiedHistoryLoanRateRates): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/unified_leverage_config.py b/gate_api/models/unified_leverage_config.py new file mode 100644 index 0000000..1e4bf22 --- /dev/null +++ b/gate_api/models/unified_leverage_config.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 UnifiedLeverageConfig(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'current_leverage': 'str', + 'min_leverage': 'str', + 'max_leverage': 'str', + 'debit': 'str', + 'available_margin': 'str', + 'borrowable': 'str', + 'except_leverage_borrowable': 'str' + } + + attribute_map = { + 'current_leverage': 'current_leverage', + 'min_leverage': 'min_leverage', + 'max_leverage': 'max_leverage', + 'debit': 'debit', + 'available_margin': 'available_margin', + 'borrowable': 'borrowable', + 'except_leverage_borrowable': 'except_leverage_borrowable' + } + + def __init__(self, current_leverage=None, min_leverage=None, max_leverage=None, debit=None, available_margin=None, borrowable=None, except_leverage_borrowable=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, Configuration) -> None + """UnifiedLeverageConfig - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._current_leverage = None + self._min_leverage = None + self._max_leverage = None + self._debit = None + self._available_margin = None + self._borrowable = None + self._except_leverage_borrowable = None + self.discriminator = None + + if current_leverage is not None: + self.current_leverage = current_leverage + if min_leverage is not None: + self.min_leverage = min_leverage + if max_leverage is not None: + self.max_leverage = max_leverage + if debit is not None: + self.debit = debit + if available_margin is not None: + self.available_margin = available_margin + if borrowable is not None: + self.borrowable = borrowable + if except_leverage_borrowable is not None: + self.except_leverage_borrowable = except_leverage_borrowable + + @property + def current_leverage(self): + """Gets the current_leverage of this UnifiedLeverageConfig. # noqa: E501 + + Current leverage ratio # noqa: E501 + + :return: The current_leverage of this UnifiedLeverageConfig. # noqa: E501 + :rtype: str + """ + return self._current_leverage + + @current_leverage.setter + def current_leverage(self, current_leverage): + """Sets the current_leverage of this UnifiedLeverageConfig. + + Current leverage ratio # noqa: E501 + + :param current_leverage: The current_leverage of this UnifiedLeverageConfig. # noqa: E501 + :type: str + """ + + self._current_leverage = current_leverage + + @property + def min_leverage(self): + """Gets the min_leverage of this UnifiedLeverageConfig. # noqa: E501 + + Minimum adjustable leverage ratio # noqa: E501 + + :return: The min_leverage of this UnifiedLeverageConfig. # noqa: E501 + :rtype: str + """ + return self._min_leverage + + @min_leverage.setter + def min_leverage(self, min_leverage): + """Sets the min_leverage of this UnifiedLeverageConfig. + + Minimum adjustable leverage ratio # noqa: E501 + + :param min_leverage: The min_leverage of this UnifiedLeverageConfig. # noqa: E501 + :type: str + """ + + self._min_leverage = min_leverage + + @property + def max_leverage(self): + """Gets the max_leverage of this UnifiedLeverageConfig. # noqa: E501 + + Maximum adjustable leverage ratio # noqa: E501 + + :return: The max_leverage of this UnifiedLeverageConfig. # noqa: E501 + :rtype: str + """ + return self._max_leverage + + @max_leverage.setter + def max_leverage(self, max_leverage): + """Sets the max_leverage of this UnifiedLeverageConfig. + + Maximum adjustable leverage ratio # noqa: E501 + + :param max_leverage: The max_leverage of this UnifiedLeverageConfig. # noqa: E501 + :type: str + """ + + self._max_leverage = max_leverage + + @property + def debit(self): + """Gets the debit of this UnifiedLeverageConfig. # noqa: E501 + + Current liabilities # noqa: E501 + + :return: The debit of this UnifiedLeverageConfig. # noqa: E501 + :rtype: str + """ + return self._debit + + @debit.setter + def debit(self, debit): + """Sets the debit of this UnifiedLeverageConfig. + + Current liabilities # noqa: E501 + + :param debit: The debit of this UnifiedLeverageConfig. # noqa: E501 + :type: str + """ + + self._debit = debit + + @property + def available_margin(self): + """Gets the available_margin of this UnifiedLeverageConfig. # noqa: E501 + + Available Margin # noqa: E501 + + :return: The available_margin of this UnifiedLeverageConfig. # noqa: E501 + :rtype: str + """ + return self._available_margin + + @available_margin.setter + def available_margin(self, available_margin): + """Sets the available_margin of this UnifiedLeverageConfig. + + Available Margin # noqa: E501 + + :param available_margin: The available_margin of this UnifiedLeverageConfig. # noqa: E501 + :type: str + """ + + self._available_margin = available_margin + + @property + def borrowable(self): + """Gets the borrowable of this UnifiedLeverageConfig. # noqa: E501 + + Maximum borrowable amount at current leverage # noqa: E501 + + :return: The borrowable of this UnifiedLeverageConfig. # noqa: E501 + :rtype: str + """ + return self._borrowable + + @borrowable.setter + def borrowable(self, borrowable): + """Sets the borrowable of this UnifiedLeverageConfig. + + Maximum borrowable amount at current leverage # noqa: E501 + + :param borrowable: The borrowable of this UnifiedLeverageConfig. # noqa: E501 + :type: str + """ + + self._borrowable = borrowable + + @property + def except_leverage_borrowable(self): + """Gets the except_leverage_borrowable of this UnifiedLeverageConfig. # noqa: E501 + + Maximum borrowable from margin and maximum borrowable from Earn, whichever is smaller # noqa: E501 + + :return: The except_leverage_borrowable of this UnifiedLeverageConfig. # noqa: E501 + :rtype: str + """ + return self._except_leverage_borrowable + + @except_leverage_borrowable.setter + def except_leverage_borrowable(self, except_leverage_borrowable): + """Sets the except_leverage_borrowable of this UnifiedLeverageConfig. + + Maximum borrowable from margin and maximum borrowable from Earn, whichever is smaller # noqa: E501 + + :param except_leverage_borrowable: The except_leverage_borrowable of this UnifiedLeverageConfig. # noqa: E501 + :type: str + """ + + self._except_leverage_borrowable = except_leverage_borrowable + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, UnifiedLeverageConfig): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UnifiedLeverageConfig): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/unified_leverage_setting.py b/gate_api/models/unified_leverage_setting.py new file mode 100644 index 0000000..4ac92bb --- /dev/null +++ b/gate_api/models/unified_leverage_setting.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 UnifiedLeverageSetting(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'leverage': 'str' + } + + attribute_map = { + 'currency': 'currency', + 'leverage': 'leverage' + } + + def __init__(self, currency=None, leverage=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """UnifiedLeverageSetting - a 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._leverage = None + self.discriminator = None + + self.currency = currency + self.leverage = leverage + + @property + def currency(self): + """Gets the currency of this UnifiedLeverageSetting. # noqa: E501 + + Currency name # noqa: E501 + + :return: The currency of this UnifiedLeverageSetting. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this UnifiedLeverageSetting. + + Currency name # noqa: E501 + + :param currency: The currency of this UnifiedLeverageSetting. # 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 leverage(self): + """Gets the leverage of this UnifiedLeverageSetting. # noqa: E501 + + Multiplier # noqa: E501 + + :return: The leverage of this UnifiedLeverageSetting. # noqa: E501 + :rtype: str + """ + return self._leverage + + @leverage.setter + def leverage(self, leverage): + """Sets the leverage of this UnifiedLeverageSetting. + + Multiplier # noqa: E501 + + :param leverage: The leverage of this UnifiedLeverageSetting. # 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, UnifiedLeverageSetting): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UnifiedLeverageSetting): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/unified_loan.py b/gate_api/models/unified_loan.py new file mode 100644 index 0000000..d8d000c --- /dev/null +++ b/gate_api/models/unified_loan.py @@ -0,0 +1,244 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class UnifiedLoan(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'type': 'str', + 'amount': 'str', + 'repaid_all': 'bool', + 'text': 'str' + } + + attribute_map = { + 'currency': 'currency', + 'type': 'type', + 'amount': 'amount', + 'repaid_all': 'repaid_all', + 'text': 'text' + } + + def __init__(self, currency=None, type=None, amount=None, repaid_all=None, text=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, bool, str, Configuration) -> None + """UnifiedLoan - a 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._type = None + self._amount = None + self._repaid_all = None + self._text = None + self.discriminator = None + + self.currency = currency + self.type = type + self.amount = amount + if repaid_all is not None: + self.repaid_all = repaid_all + if text is not None: + self.text = text + + @property + def currency(self): + """Gets the currency of this UnifiedLoan. # noqa: E501 + + Currency # noqa: E501 + + :return: The currency of this UnifiedLoan. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this UnifiedLoan. + + Currency # noqa: E501 + + :param currency: The currency of this UnifiedLoan. # 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 type(self): + """Gets the type of this UnifiedLoan. # noqa: E501 + + Type: `borrow` - borrow, `repay` - repay # noqa: E501 + + :return: The type of this UnifiedLoan. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this UnifiedLoan. + + Type: `borrow` - borrow, `repay` - repay # noqa: E501 + + :param type: The type of this UnifiedLoan. # 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 = ["borrow", "repay"] # 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 amount(self): + """Gets the amount of this UnifiedLoan. # noqa: E501 + + Borrow or repayment amount # noqa: E501 + + :return: The amount of this UnifiedLoan. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this UnifiedLoan. + + Borrow or repayment amount # noqa: E501 + + :param amount: The amount of this UnifiedLoan. # 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 repaid_all(self): + """Gets the repaid_all of this UnifiedLoan. # noqa: E501 + + Full repayment, only used for repayment operations. When set to `true`, overrides `amount` and directly repays the full amount # noqa: E501 + + :return: The repaid_all of this UnifiedLoan. # noqa: E501 + :rtype: bool + """ + return self._repaid_all + + @repaid_all.setter + def repaid_all(self, repaid_all): + """Sets the repaid_all of this UnifiedLoan. + + Full repayment, only used for repayment operations. When set to `true`, overrides `amount` and directly repays the full amount # noqa: E501 + + :param repaid_all: The repaid_all of this UnifiedLoan. # noqa: E501 + :type: bool + """ + + self._repaid_all = repaid_all + + @property + def text(self): + """Gets the text of this UnifiedLoan. # noqa: E501 + + User defined custom ID # noqa: E501 + + :return: The text of this UnifiedLoan. # noqa: E501 + :rtype: str + """ + return self._text + + @text.setter + def text(self, text): + """Sets the text of this UnifiedLoan. + + User defined custom ID # noqa: E501 + + :param text: The text of this UnifiedLoan. # 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, UnifiedLoan): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UnifiedLoan): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/unified_loan_record.py b/gate_api/models/unified_loan_record.py new file mode 100644 index 0000000..4cce938 --- /dev/null +++ b/gate_api/models/unified_loan_record.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 UnifiedLoanRecord(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'repayment_type': 'str', + 'borrow_type': 'str', + 'currency_pair': 'str', + 'currency': 'str', + 'amount': 'str', + 'create_time': 'int' + } + + attribute_map = { + 'id': 'id', + 'type': 'type', + 'repayment_type': 'repayment_type', + 'borrow_type': 'borrow_type', + 'currency_pair': 'currency_pair', + 'currency': 'currency', + 'amount': 'amount', + 'create_time': 'create_time' + } + + def __init__(self, id=None, type=None, repayment_type=None, borrow_type=None, currency_pair=None, currency=None, amount=None, create_time=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, str, str, str, str, str, int, Configuration) -> None + """UnifiedLoanRecord - a 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._repayment_type = None + self._borrow_type = None + self._currency_pair = None + self._currency = None + self._amount = None + self._create_time = None + self.discriminator = None + + if id is not None: + self.id = id + if type is not None: + self.type = type + if repayment_type is not None: + self.repayment_type = repayment_type + if borrow_type is not None: + self.borrow_type = borrow_type + if currency_pair is not None: + self.currency_pair = currency_pair + if currency is not None: + self.currency = currency + if amount is not None: + self.amount = amount + if create_time is not None: + self.create_time = create_time + + @property + def id(self): + """Gets the id of this UnifiedLoanRecord. # noqa: E501 + + ID # noqa: E501 + + :return: The id of this UnifiedLoanRecord. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this UnifiedLoanRecord. + + ID # noqa: E501 + + :param id: The id of this UnifiedLoanRecord. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def type(self): + """Gets the type of this UnifiedLoanRecord. # noqa: E501 + + Type: `borrow` - borrow, `repay` - repay # noqa: E501 + + :return: The type of this UnifiedLoanRecord. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this UnifiedLoanRecord. + + Type: `borrow` - borrow, `repay` - repay # noqa: E501 + + :param type: The type of this UnifiedLoanRecord. # noqa: E501 + :type: str + """ + + self._type = type + + @property + def repayment_type(self): + """Gets the repayment_type of this UnifiedLoanRecord. # noqa: E501 + + Repayment type: none - No repayment type, manual_repay - Manual repayment, auto_repay - Automatic repayment, cancel_auto_repay - Automatic repayment after order cancellation, different_currencies_repayment - Cross-currency repayment # noqa: E501 + + :return: The repayment_type of this UnifiedLoanRecord. # noqa: E501 + :rtype: str + """ + return self._repayment_type + + @repayment_type.setter + def repayment_type(self, repayment_type): + """Sets the repayment_type of this UnifiedLoanRecord. + + Repayment type: none - No repayment type, manual_repay - Manual repayment, auto_repay - Automatic repayment, cancel_auto_repay - Automatic repayment after order cancellation, different_currencies_repayment - Cross-currency repayment # noqa: E501 + + :param repayment_type: The repayment_type of this UnifiedLoanRecord. # noqa: E501 + :type: str + """ + + self._repayment_type = repayment_type + + @property + def borrow_type(self): + """Gets the borrow_type of this UnifiedLoanRecord. # noqa: E501 + + Borrowing type, returned when querying loan records: manual_borrow - Manual borrowing, auto_borrow - Automatic borrowing # noqa: E501 + + :return: The borrow_type of this UnifiedLoanRecord. # noqa: E501 + :rtype: str + """ + return self._borrow_type + + @borrow_type.setter + def borrow_type(self, borrow_type): + """Sets the borrow_type of this UnifiedLoanRecord. + + Borrowing type, returned when querying loan records: manual_borrow - Manual borrowing, auto_borrow - Automatic borrowing # noqa: E501 + + :param borrow_type: The borrow_type of this UnifiedLoanRecord. # noqa: E501 + :type: str + """ + + self._borrow_type = borrow_type + + @property + def currency_pair(self): + """Gets the currency_pair of this UnifiedLoanRecord. # noqa: E501 + + Currency pair # noqa: E501 + + :return: The currency_pair of this UnifiedLoanRecord. # noqa: E501 + :rtype: str + """ + return self._currency_pair + + @currency_pair.setter + def currency_pair(self, currency_pair): + """Sets the currency_pair of this UnifiedLoanRecord. + + Currency pair # noqa: E501 + + :param currency_pair: The currency_pair of this UnifiedLoanRecord. # noqa: E501 + :type: str + """ + + self._currency_pair = currency_pair + + @property + def currency(self): + """Gets the currency of this UnifiedLoanRecord. # noqa: E501 + + Currency # noqa: E501 + + :return: The currency of this UnifiedLoanRecord. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this UnifiedLoanRecord. + + Currency # noqa: E501 + + :param currency: The currency of this UnifiedLoanRecord. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def amount(self): + """Gets the amount of this UnifiedLoanRecord. # noqa: E501 + + Borrow or repayment amount # noqa: E501 + + :return: The amount of this UnifiedLoanRecord. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this UnifiedLoanRecord. + + Borrow or repayment amount # noqa: E501 + + :param amount: The amount of this UnifiedLoanRecord. # noqa: E501 + :type: str + """ + + self._amount = amount + + @property + def create_time(self): + """Gets the create_time of this UnifiedLoanRecord. # noqa: E501 + + Created time # noqa: E501 + + :return: The create_time of this UnifiedLoanRecord. # noqa: E501 + :rtype: int + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this UnifiedLoanRecord. + + Created time # noqa: E501 + + :param create_time: The create_time of this UnifiedLoanRecord. # 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, UnifiedLoanRecord): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UnifiedLoanRecord): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/unified_loan_result.py b/gate_api/models/unified_loan_result.py new file mode 100644 index 0000000..58dced5 --- /dev/null +++ b/gate_api/models/unified_loan_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 UnifiedLoanResult(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'tran_id': 'int' + } + + attribute_map = { + 'tran_id': 'tran_id' + } + + def __init__(self, tran_id=None, local_vars_configuration=None): # noqa: E501 + # type: (int, Configuration) -> None + """UnifiedLoanResult - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._tran_id = None + self.discriminator = None + + if tran_id is not None: + self.tran_id = tran_id + + @property + def tran_id(self): + """Gets the tran_id of this UnifiedLoanResult. # noqa: E501 + + Transaction ID # noqa: E501 + + :return: The tran_id of this UnifiedLoanResult. # noqa: E501 + :rtype: int + """ + return self._tran_id + + @tran_id.setter + def tran_id(self, tran_id): + """Sets the tran_id of this UnifiedLoanResult. + + Transaction ID # noqa: E501 + + :param tran_id: The tran_id of this UnifiedLoanResult. # noqa: E501 + :type: int + """ + + self._tran_id = tran_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, UnifiedLoanResult): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UnifiedLoanResult): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/unified_margin_tiers.py b/gate_api/models/unified_margin_tiers.py new file mode 100644 index 0000000..8e61cbe --- /dev/null +++ b/gate_api/models/unified_margin_tiers.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 UnifiedMarginTiers(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'margin_tiers': 'list[MarginTiers]' + } + + attribute_map = { + 'currency': 'currency', + 'margin_tiers': 'margin_tiers' + } + + def __init__(self, currency=None, margin_tiers=None, local_vars_configuration=None): # noqa: E501 + # type: (str, list[MarginTiers], Configuration) -> None + """UnifiedMarginTiers - a 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._margin_tiers = None + self.discriminator = None + + if currency is not None: + self.currency = currency + if margin_tiers is not None: + self.margin_tiers = margin_tiers + + @property + def currency(self): + """Gets the currency of this UnifiedMarginTiers. # noqa: E501 + + Currency name # noqa: E501 + + :return: The currency of this UnifiedMarginTiers. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this UnifiedMarginTiers. + + Currency name # noqa: E501 + + :param currency: The currency of this UnifiedMarginTiers. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def margin_tiers(self): + """Gets the margin_tiers of this UnifiedMarginTiers. # noqa: E501 + + Tiered margin # noqa: E501 + + :return: The margin_tiers of this UnifiedMarginTiers. # noqa: E501 + :rtype: list[MarginTiers] + """ + return self._margin_tiers + + @margin_tiers.setter + def margin_tiers(self, margin_tiers): + """Sets the margin_tiers of this UnifiedMarginTiers. + + Tiered margin # noqa: E501 + + :param margin_tiers: The margin_tiers of this UnifiedMarginTiers. # noqa: E501 + :type: list[MarginTiers] + """ + + self._margin_tiers = margin_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, UnifiedMarginTiers): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UnifiedMarginTiers): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/unified_mode_set.py b/gate_api/models/unified_mode_set.py new file mode 100644 index 0000000..8fe6a71 --- /dev/null +++ b/gate_api/models/unified_mode_set.py @@ -0,0 +1,150 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class UnifiedModeSet(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'mode': 'str', + 'settings': 'UnifiedSettings' + } + + attribute_map = { + 'mode': 'mode', + 'settings': 'settings' + } + + def __init__(self, mode=None, settings=None, local_vars_configuration=None): # noqa: E501 + # type: (str, UnifiedSettings, Configuration) -> None + """UnifiedModeSet - a 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._settings = None + self.discriminator = None + + self.mode = mode + if settings is not None: + self.settings = settings + + @property + def mode(self): + """Gets the mode of this UnifiedModeSet. # noqa: E501 + + Unified account mode: - `classic`: Classic account mode - `multi_currency`: Cross-currency margin mode - `portfolio`: Portfolio margin mode - `single_currency`: Single-currency margin mode # noqa: E501 + + :return: The mode of this UnifiedModeSet. # noqa: E501 + :rtype: str + """ + return self._mode + + @mode.setter + def mode(self, mode): + """Sets the mode of this UnifiedModeSet. + + Unified account mode: - `classic`: Classic account mode - `multi_currency`: Cross-currency margin mode - `portfolio`: Portfolio margin mode - `single_currency`: Single-currency margin mode # noqa: E501 + + :param mode: The mode of this UnifiedModeSet. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and mode is None: # noqa: E501 + raise ValueError("Invalid value for `mode`, must not be `None`") # noqa: E501 + + self._mode = mode + + @property + def settings(self): + """Gets the settings of this UnifiedModeSet. # noqa: E501 + + + :return: The settings of this UnifiedModeSet. # noqa: E501 + :rtype: UnifiedSettings + """ + return self._settings + + @settings.setter + def settings(self, settings): + """Sets the settings of this UnifiedModeSet. + + + :param settings: The settings of this UnifiedModeSet. # noqa: E501 + :type: UnifiedSettings + """ + + self._settings = settings + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, UnifiedModeSet): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UnifiedModeSet): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/unified_portfolio_input.py b/gate_api/models/unified_portfolio_input.py new file mode 100644 index 0000000..57ca957 --- /dev/null +++ b/gate_api/models/unified_portfolio_input.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 UnifiedPortfolioInput(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'spot_balances': 'list[MockSpotBalance]', + 'spot_orders': 'list[MockSpotOrder]', + 'futures_positions': 'list[MockFuturesPosition]', + 'futures_orders': 'list[MockFuturesOrder]', + 'options_positions': 'list[MockOptionsPosition]', + 'options_orders': 'list[MockOptionsOrder]', + 'spot_hedge': 'bool' + } + + attribute_map = { + 'spot_balances': 'spot_balances', + 'spot_orders': 'spot_orders', + 'futures_positions': 'futures_positions', + 'futures_orders': 'futures_orders', + 'options_positions': 'options_positions', + 'options_orders': 'options_orders', + 'spot_hedge': 'spot_hedge' + } + + def __init__(self, spot_balances=None, spot_orders=None, futures_positions=None, futures_orders=None, options_positions=None, options_orders=None, spot_hedge=None, local_vars_configuration=None): # noqa: E501 + # type: (list[MockSpotBalance], list[MockSpotOrder], list[MockFuturesPosition], list[MockFuturesOrder], list[MockOptionsPosition], list[MockOptionsOrder], bool, Configuration) -> None + """UnifiedPortfolioInput - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._spot_balances = None + self._spot_orders = None + self._futures_positions = None + self._futures_orders = None + self._options_positions = None + self._options_orders = None + self._spot_hedge = None + self.discriminator = None + + if spot_balances is not None: + self.spot_balances = spot_balances + if spot_orders is not None: + self.spot_orders = spot_orders + if futures_positions is not None: + self.futures_positions = futures_positions + if futures_orders is not None: + self.futures_orders = futures_orders + if options_positions is not None: + self.options_positions = options_positions + if options_orders is not None: + self.options_orders = options_orders + if spot_hedge is not None: + self.spot_hedge = spot_hedge + + @property + def spot_balances(self): + """Gets the spot_balances of this UnifiedPortfolioInput. # noqa: E501 + + Spot # noqa: E501 + + :return: The spot_balances of this UnifiedPortfolioInput. # noqa: E501 + :rtype: list[MockSpotBalance] + """ + return self._spot_balances + + @spot_balances.setter + def spot_balances(self, spot_balances): + """Sets the spot_balances of this UnifiedPortfolioInput. + + Spot # noqa: E501 + + :param spot_balances: The spot_balances of this UnifiedPortfolioInput. # noqa: E501 + :type: list[MockSpotBalance] + """ + + self._spot_balances = spot_balances + + @property + def spot_orders(self): + """Gets the spot_orders of this UnifiedPortfolioInput. # noqa: E501 + + Spot orders # noqa: E501 + + :return: The spot_orders of this UnifiedPortfolioInput. # noqa: E501 + :rtype: list[MockSpotOrder] + """ + return self._spot_orders + + @spot_orders.setter + def spot_orders(self, spot_orders): + """Sets the spot_orders of this UnifiedPortfolioInput. + + Spot orders # noqa: E501 + + :param spot_orders: The spot_orders of this UnifiedPortfolioInput. # noqa: E501 + :type: list[MockSpotOrder] + """ + + self._spot_orders = spot_orders + + @property + def futures_positions(self): + """Gets the futures_positions of this UnifiedPortfolioInput. # noqa: E501 + + Futures positions # noqa: E501 + + :return: The futures_positions of this UnifiedPortfolioInput. # noqa: E501 + :rtype: list[MockFuturesPosition] + """ + return self._futures_positions + + @futures_positions.setter + def futures_positions(self, futures_positions): + """Sets the futures_positions of this UnifiedPortfolioInput. + + Futures positions # noqa: E501 + + :param futures_positions: The futures_positions of this UnifiedPortfolioInput. # noqa: E501 + :type: list[MockFuturesPosition] + """ + + self._futures_positions = futures_positions + + @property + def futures_orders(self): + """Gets the futures_orders of this UnifiedPortfolioInput. # noqa: E501 + + Futures order # noqa: E501 + + :return: The futures_orders of this UnifiedPortfolioInput. # noqa: E501 + :rtype: list[MockFuturesOrder] + """ + return self._futures_orders + + @futures_orders.setter + def futures_orders(self, futures_orders): + """Sets the futures_orders of this UnifiedPortfolioInput. + + Futures order # noqa: E501 + + :param futures_orders: The futures_orders of this UnifiedPortfolioInput. # noqa: E501 + :type: list[MockFuturesOrder] + """ + + self._futures_orders = futures_orders + + @property + def options_positions(self): + """Gets the options_positions of this UnifiedPortfolioInput. # noqa: E501 + + Options positions # noqa: E501 + + :return: The options_positions of this UnifiedPortfolioInput. # noqa: E501 + :rtype: list[MockOptionsPosition] + """ + return self._options_positions + + @options_positions.setter + def options_positions(self, options_positions): + """Sets the options_positions of this UnifiedPortfolioInput. + + Options positions # noqa: E501 + + :param options_positions: The options_positions of this UnifiedPortfolioInput. # noqa: E501 + :type: list[MockOptionsPosition] + """ + + self._options_positions = options_positions + + @property + def options_orders(self): + """Gets the options_orders of this UnifiedPortfolioInput. # noqa: E501 + + Option orders # noqa: E501 + + :return: The options_orders of this UnifiedPortfolioInput. # noqa: E501 + :rtype: list[MockOptionsOrder] + """ + return self._options_orders + + @options_orders.setter + def options_orders(self, options_orders): + """Sets the options_orders of this UnifiedPortfolioInput. + + Option orders # noqa: E501 + + :param options_orders: The options_orders of this UnifiedPortfolioInput. # noqa: E501 + :type: list[MockOptionsOrder] + """ + + self._options_orders = options_orders + + @property + def spot_hedge(self): + """Gets the spot_hedge of this UnifiedPortfolioInput. # noqa: E501 + + Whether to enable spot hedging # noqa: E501 + + :return: The spot_hedge of this UnifiedPortfolioInput. # noqa: E501 + :rtype: bool + """ + return self._spot_hedge + + @spot_hedge.setter + def spot_hedge(self, spot_hedge): + """Sets the spot_hedge of this UnifiedPortfolioInput. + + Whether to enable spot hedging # noqa: E501 + + :param spot_hedge: The spot_hedge of this UnifiedPortfolioInput. # noqa: E501 + :type: bool + """ + + self._spot_hedge = spot_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, UnifiedPortfolioInput): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UnifiedPortfolioInput): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/unified_portfolio_output.py b/gate_api/models/unified_portfolio_output.py new file mode 100644 index 0000000..ed08278 --- /dev/null +++ b/gate_api/models/unified_portfolio_output.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 UnifiedPortfolioOutput(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'maintain_margin_total': 'str', + 'initial_margin_total': 'str', + 'calculate_time': 'int', + 'risk_unit': 'list[MockRiskUnit]' + } + + attribute_map = { + 'maintain_margin_total': 'maintain_margin_total', + 'initial_margin_total': 'initial_margin_total', + 'calculate_time': 'calculate_time', + 'risk_unit': 'risk_unit' + } + + def __init__(self, maintain_margin_total=None, initial_margin_total=None, calculate_time=None, risk_unit=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, int, list[MockRiskUnit], Configuration) -> None + """UnifiedPortfolioOutput - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._maintain_margin_total = None + self._initial_margin_total = None + self._calculate_time = None + self._risk_unit = None + self.discriminator = None + + if maintain_margin_total is not None: + self.maintain_margin_total = maintain_margin_total + if initial_margin_total is not None: + self.initial_margin_total = initial_margin_total + if calculate_time is not None: + self.calculate_time = calculate_time + if risk_unit is not None: + self.risk_unit = risk_unit + + @property + def maintain_margin_total(self): + """Gets the maintain_margin_total of this UnifiedPortfolioOutput. # noqa: E501 + + Total maintenance margin, including only portfolio margin calculation results for positions in risk units, excluding borrowing margin. If borrowing exists, conventional borrowing margin requirements will still apply # noqa: E501 + + :return: The maintain_margin_total of this UnifiedPortfolioOutput. # noqa: E501 + :rtype: str + """ + return self._maintain_margin_total + + @maintain_margin_total.setter + def maintain_margin_total(self, maintain_margin_total): + """Sets the maintain_margin_total of this UnifiedPortfolioOutput. + + Total maintenance margin, including only portfolio margin calculation results for positions in risk units, excluding borrowing margin. If borrowing exists, conventional borrowing margin requirements will still apply # noqa: E501 + + :param maintain_margin_total: The maintain_margin_total of this UnifiedPortfolioOutput. # noqa: E501 + :type: str + """ + + self._maintain_margin_total = maintain_margin_total + + @property + def initial_margin_total(self): + """Gets the initial_margin_total of this UnifiedPortfolioOutput. # noqa: E501 + + Total initial margin, calculated as the maximum of the following three combinations: position, position + positive delta orders, position + negative delta orders # noqa: E501 + + :return: The initial_margin_total of this UnifiedPortfolioOutput. # noqa: E501 + :rtype: str + """ + return self._initial_margin_total + + @initial_margin_total.setter + def initial_margin_total(self, initial_margin_total): + """Sets the initial_margin_total of this UnifiedPortfolioOutput. + + Total initial margin, calculated as the maximum of the following three combinations: position, position + positive delta orders, position + negative delta orders # noqa: E501 + + :param initial_margin_total: The initial_margin_total of this UnifiedPortfolioOutput. # noqa: E501 + :type: str + """ + + self._initial_margin_total = initial_margin_total + + @property + def calculate_time(self): + """Gets the calculate_time of this UnifiedPortfolioOutput. # noqa: E501 + + Calculation time # noqa: E501 + + :return: The calculate_time of this UnifiedPortfolioOutput. # noqa: E501 + :rtype: int + """ + return self._calculate_time + + @calculate_time.setter + def calculate_time(self, calculate_time): + """Sets the calculate_time of this UnifiedPortfolioOutput. + + Calculation time # noqa: E501 + + :param calculate_time: The calculate_time of this UnifiedPortfolioOutput. # noqa: E501 + :type: int + """ + + self._calculate_time = calculate_time + + @property + def risk_unit(self): + """Gets the risk_unit of this UnifiedPortfolioOutput. # noqa: E501 + + Risk unit # noqa: E501 + + :return: The risk_unit of this UnifiedPortfolioOutput. # noqa: E501 + :rtype: list[MockRiskUnit] + """ + return self._risk_unit + + @risk_unit.setter + def risk_unit(self, risk_unit): + """Sets the risk_unit of this UnifiedPortfolioOutput. + + Risk unit # noqa: E501 + + :param risk_unit: The risk_unit of this UnifiedPortfolioOutput. # noqa: E501 + :type: list[MockRiskUnit] + """ + + self._risk_unit = risk_unit + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, UnifiedPortfolioOutput): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UnifiedPortfolioOutput): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/unified_risk_units.py b/gate_api/models/unified_risk_units.py new file mode 100644 index 0000000..7197a7e --- /dev/null +++ b/gate_api/models/unified_risk_units.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 UnifiedRiskUnits(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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': 'int', + 'spot_hedge': 'bool', + 'risk_units': 'list[RiskUnits]' + } + + attribute_map = { + 'user_id': 'user_id', + 'spot_hedge': 'spot_hedge', + 'risk_units': 'risk_units' + } + + def __init__(self, user_id=None, spot_hedge=None, risk_units=None, local_vars_configuration=None): # noqa: E501 + # type: (int, bool, list[RiskUnits], Configuration) -> None + """UnifiedRiskUnits - a 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._spot_hedge = None + self._risk_units = None + self.discriminator = None + + if user_id is not None: + self.user_id = user_id + if spot_hedge is not None: + self.spot_hedge = spot_hedge + if risk_units is not None: + self.risk_units = risk_units + + @property + def user_id(self): + """Gets the user_id of this UnifiedRiskUnits. # noqa: E501 + + User ID # noqa: E501 + + :return: The user_id of this UnifiedRiskUnits. # noqa: E501 + :rtype: int + """ + return self._user_id + + @user_id.setter + def user_id(self, user_id): + """Sets the user_id of this UnifiedRiskUnits. + + User ID # noqa: E501 + + :param user_id: The user_id of this UnifiedRiskUnits. # noqa: E501 + :type: int + """ + + self._user_id = user_id + + @property + def spot_hedge(self): + """Gets the spot_hedge of this UnifiedRiskUnits. # noqa: E501 + + Spot hedging status: true - enabled, false - disabled # noqa: E501 + + :return: The spot_hedge of this UnifiedRiskUnits. # noqa: E501 + :rtype: bool + """ + return self._spot_hedge + + @spot_hedge.setter + def spot_hedge(self, spot_hedge): + """Sets the spot_hedge of this UnifiedRiskUnits. + + Spot hedging status: true - enabled, false - disabled # noqa: E501 + + :param spot_hedge: The spot_hedge of this UnifiedRiskUnits. # noqa: E501 + :type: bool + """ + + self._spot_hedge = spot_hedge + + @property + def risk_units(self): + """Gets the risk_units of this UnifiedRiskUnits. # noqa: E501 + + Risk unit # noqa: E501 + + :return: The risk_units of this UnifiedRiskUnits. # noqa: E501 + :rtype: list[RiskUnits] + """ + return self._risk_units + + @risk_units.setter + def risk_units(self, risk_units): + """Sets the risk_units of this UnifiedRiskUnits. + + Risk unit # noqa: E501 + + :param risk_units: The risk_units of this UnifiedRiskUnits. # noqa: E501 + :type: list[RiskUnits] + """ + + self._risk_units = risk_units + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, UnifiedRiskUnits): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UnifiedRiskUnits): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/unified_settings.py b/gate_api/models/unified_settings.py new file mode 100644 index 0000000..7ab84b4 --- /dev/null +++ b/gate_api/models/unified_settings.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 UnifiedSettings(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'usdt_futures': 'bool', + 'spot_hedge': 'bool', + 'use_funding': 'bool', + 'options': 'bool' + } + + attribute_map = { + 'usdt_futures': 'usdt_futures', + 'spot_hedge': 'spot_hedge', + 'use_funding': 'use_funding', + 'options': 'options' + } + + def __init__(self, usdt_futures=None, spot_hedge=None, use_funding=None, options=None, local_vars_configuration=None): # noqa: E501 + # type: (bool, bool, bool, bool, Configuration) -> None + """UnifiedSettings - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._usdt_futures = None + self._spot_hedge = None + self._use_funding = None + self._options = None + self.discriminator = None + + if usdt_futures is not None: + self.usdt_futures = usdt_futures + if spot_hedge is not None: + self.spot_hedge = spot_hedge + if use_funding is not None: + self.use_funding = use_funding + if options is not None: + self.options = options + + @property + def usdt_futures(self): + """Gets the usdt_futures of this UnifiedSettings. # noqa: E501 + + USDT futures switch. In cross-currency margin mode, can only be enabled and cannot be disabled # noqa: E501 + + :return: The usdt_futures of this UnifiedSettings. # noqa: E501 + :rtype: bool + """ + return self._usdt_futures + + @usdt_futures.setter + def usdt_futures(self, usdt_futures): + """Sets the usdt_futures of this UnifiedSettings. + + USDT futures switch. In cross-currency margin mode, can only be enabled and cannot be disabled # noqa: E501 + + :param usdt_futures: The usdt_futures of this UnifiedSettings. # noqa: E501 + :type: bool + """ + + self._usdt_futures = usdt_futures + + @property + def spot_hedge(self): + """Gets the spot_hedge of this UnifiedSettings. # noqa: E501 + + Spot hedging switch # noqa: E501 + + :return: The spot_hedge of this UnifiedSettings. # noqa: E501 + :rtype: bool + """ + return self._spot_hedge + + @spot_hedge.setter + def spot_hedge(self, spot_hedge): + """Sets the spot_hedge of this UnifiedSettings. + + Spot hedging switch # noqa: E501 + + :param spot_hedge: The spot_hedge of this UnifiedSettings. # noqa: E501 + :type: bool + """ + + self._spot_hedge = spot_hedge + + @property + def use_funding(self): + """Gets the use_funding of this UnifiedSettings. # noqa: E501 + + Earn switch, when mode is cross-currency margin mode, whether to use Earn funds as margin # noqa: E501 + + :return: The use_funding of this UnifiedSettings. # noqa: E501 + :rtype: bool + """ + return self._use_funding + + @use_funding.setter + def use_funding(self, use_funding): + """Sets the use_funding of this UnifiedSettings. + + Earn switch, when mode is cross-currency margin mode, whether to use Earn funds as margin # noqa: E501 + + :param use_funding: The use_funding of this UnifiedSettings. # noqa: E501 + :type: bool + """ + + self._use_funding = use_funding + + @property + def options(self): + """Gets the options of this UnifiedSettings. # noqa: E501 + + Options switch. In cross-currency margin mode, can only be enabled and cannot be disabled # noqa: E501 + + :return: The options of this UnifiedSettings. # noqa: E501 + :rtype: bool + """ + return self._options + + @options.setter + def options(self, options): + """Sets the options of this UnifiedSettings. + + Options switch. In cross-currency margin mode, can only be enabled and cannot be disabled # noqa: E501 + + :param options: The options of this UnifiedSettings. # noqa: E501 + :type: bool + """ + + self._options = options + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, UnifiedSettings): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UnifiedSettings): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/unified_transferable.py b/gate_api/models/unified_transferable.py new file mode 100644 index 0000000..e4b5311 --- /dev/null +++ b/gate_api/models/unified_transferable.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 UnifiedTransferable(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'amount': 'str' + } + + attribute_map = { + 'currency': 'currency', + 'amount': 'amount' + } + + def __init__(self, currency=None, amount=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """UnifiedTransferable - a 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.discriminator = None + + if currency is not None: + self.currency = currency + if amount is not None: + self.amount = amount + + @property + def currency(self): + """Gets the currency of this UnifiedTransferable. # noqa: E501 + + Currency detail # noqa: E501 + + :return: The currency of this UnifiedTransferable. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this UnifiedTransferable. + + Currency detail # noqa: E501 + + :param currency: The currency of this UnifiedTransferable. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def amount(self): + """Gets the amount of this UnifiedTransferable. # noqa: E501 + + Maximum transferable amount # noqa: E501 + + :return: The amount of this UnifiedTransferable. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this UnifiedTransferable. + + Maximum transferable amount # noqa: E501 + + :param amount: The amount of this UnifiedTransferable. # noqa: E501 + :type: str + """ + + 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, UnifiedTransferable): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UnifiedTransferable): + 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 new file mode 100644 index 0000000..e56f15a --- /dev/null +++ b/gate_api/models/user_ltv_info.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 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/user_sub.py b/gate_api/models/user_sub.py new file mode 100644 index 0000000..d3728b1 --- /dev/null +++ b/gate_api/models/user_sub.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 UserSub(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'belong': 'str', + 'type': 'int', + 'ref_uid': 'int' + } + + attribute_map = { + 'uid': 'uid', + 'belong': 'belong', + 'type': 'type', + 'ref_uid': 'ref_uid' + } + + def __init__(self, uid=None, belong=None, type=None, ref_uid=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, int, int, Configuration) -> None + """UserSub - a 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._belong = None + self._type = None + self._ref_uid = None + self.discriminator = None + + if uid is not None: + self.uid = uid + if belong is not None: + self.belong = belong + if type is not None: + self.type = type + if ref_uid is not None: + self.ref_uid = ref_uid + + @property + def uid(self): + """Gets the uid of this UserSub. # noqa: E501 + + User ID # noqa: E501 + + :return: The uid of this UserSub. # noqa: E501 + :rtype: int + """ + return self._uid + + @uid.setter + def uid(self, uid): + """Sets the uid of this UserSub. + + User ID # noqa: E501 + + :param uid: The uid of this UserSub. # noqa: E501 + :type: int + """ + + self._uid = uid + + @property + def belong(self): + """Gets the belong of this UserSub. # noqa: E501 + + User's system affiliation (partner/referral). Empty means not belonging to any system # noqa: E501 + + :return: The belong of this UserSub. # noqa: E501 + :rtype: str + """ + return self._belong + + @belong.setter + def belong(self, belong): + """Sets the belong of this UserSub. + + User's system affiliation (partner/referral). Empty means not belonging to any system # noqa: E501 + + :param belong: The belong of this UserSub. # noqa: E501 + :type: str + """ + + self._belong = belong + + @property + def type(self): + """Gets the type of this UserSub. # noqa: E501 + + Type (0-Not in system 1-Direct subordinate agent 2-Indirect subordinate agent 3-Direct direct customer 4-Indirect direct customer 5-Regular user) # noqa: E501 + + :return: The type of this UserSub. # noqa: E501 + :rtype: int + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this UserSub. + + Type (0-Not in system 1-Direct subordinate agent 2-Indirect subordinate agent 3-Direct direct customer 4-Indirect direct customer 5-Regular user) # noqa: E501 + + :param type: The type of this UserSub. # noqa: E501 + :type: int + """ + + self._type = type + + @property + def ref_uid(self): + """Gets the ref_uid of this UserSub. # noqa: E501 + + Inviter user ID # noqa: E501 + + :return: The ref_uid of this UserSub. # noqa: E501 + :rtype: int + """ + return self._ref_uid + + @ref_uid.setter + def ref_uid(self, ref_uid): + """Sets the ref_uid of this UserSub. + + Inviter user ID # noqa: E501 + + :param ref_uid: The ref_uid of this UserSub. # noqa: E501 + :type: int + """ + + self._ref_uid = ref_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, UserSub): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UserSub): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/user_sub_relation.py b/gate_api/models/user_sub_relation.py new file mode 100644 index 0000000..533e250 --- /dev/null +++ b/gate_api/models/user_sub_relation.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 UserSubRelation(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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[UserSub]' + } + + attribute_map = { + 'list': 'list' + } + + def __init__(self, list=None, local_vars_configuration=None): # noqa: E501 + # type: (list[UserSub], Configuration) -> None + """UserSubRelation - a 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 UserSubRelation. # noqa: E501 + + Subordinate relationship list # noqa: E501 + + :return: The list of this UserSubRelation. # noqa: E501 + :rtype: list[UserSub] + """ + return self._list + + @list.setter + def list(self, list): + """Sets the list of this UserSubRelation. + + Subordinate relationship list # noqa: E501 + + :param list: The list of this UserSubRelation. # noqa: E501 + :type: list[UserSub] + """ + + 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, UserSubRelation): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UserSubRelation): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/user_total_amount.py b/gate_api/models/user_total_amount.py new file mode 100644 index 0000000..759f31e --- /dev/null +++ b/gate_api/models/user_total_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 UserTotalAmount(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'borrow_amount': 'str', + 'collateral_amount': 'str' + } + + attribute_map = { + 'borrow_amount': 'borrow_amount', + 'collateral_amount': 'collateral_amount' + } + + def __init__(self, borrow_amount=None, collateral_amount=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """UserTotalAmount - a 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.discriminator = None + + if borrow_amount is not None: + self.borrow_amount = borrow_amount + if collateral_amount is not None: + self.collateral_amount = collateral_amount + + @property + def borrow_amount(self): + """Gets the borrow_amount of this UserTotalAmount. # noqa: E501 + + Total borrowing amount in USDT # noqa: E501 + + :return: The borrow_amount of this UserTotalAmount. # noqa: E501 + :rtype: str + """ + return self._borrow_amount + + @borrow_amount.setter + def borrow_amount(self, borrow_amount): + """Sets the borrow_amount of this UserTotalAmount. + + Total borrowing amount in USDT # noqa: E501 + + :param borrow_amount: The borrow_amount of this UserTotalAmount. # noqa: E501 + :type: str + """ + + self._borrow_amount = borrow_amount + + @property + def collateral_amount(self): + """Gets the collateral_amount of this UserTotalAmount. # noqa: E501 + + Total collateral amount in USDT # noqa: E501 + + :return: The collateral_amount of this UserTotalAmount. # noqa: E501 + :rtype: str + """ + return self._collateral_amount + + @collateral_amount.setter + def collateral_amount(self, collateral_amount): + """Sets the collateral_amount of this UserTotalAmount. + + Total collateral amount in USDT # noqa: E501 + + :param collateral_amount: The collateral_amount of this UserTotalAmount. # noqa: E501 + :type: str + """ + + self._collateral_amount = collateral_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, UserTotalAmount): + return 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): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/withdraw_status.py b/gate_api/models/withdraw_status.py index 6badeab..8803fc9 100644 --- a/gate_api/models/withdraw_status.py +++ b/gate_api/models/withdraw_status.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -44,6 +44,7 @@ class WithdrawStatus(object): 'withdraw_day_limit_remain': 'str', 'withdraw_eachtime_limit': 'str', 'withdraw_fix_on_chains': 'dict(str, str)', + 'withdraw_percent_on_chains': 'dict(str, str)' } attribute_map = { @@ -58,24 +59,11 @@ class WithdrawStatus(object): 'withdraw_day_limit_remain': 'withdraw_day_limit_remain', 'withdraw_eachtime_limit': 'withdraw_eachtime_limit', 'withdraw_fix_on_chains': 'withdraw_fix_on_chains', + 'withdraw_percent_on_chains': 'withdraw_percent_on_chains' } - def __init__( - self, - currency=None, - name=None, - name_cn=None, - deposit=None, - withdraw_percent=None, - withdraw_fix=None, - withdraw_day_limit=None, - withdraw_amount_mini=None, - withdraw_day_limit_remain=None, - withdraw_eachtime_limit=None, - withdraw_fix_on_chains=None, - local_vars_configuration=None, - ): # noqa: E501 - # type: (str, str, str, str, str, str, str, str, str, str, dict(str, str), Configuration) -> None + def __init__(self, currency=None, name=None, name_cn=None, deposit=None, withdraw_percent=None, withdraw_fix=None, withdraw_day_limit=None, withdraw_amount_mini=None, withdraw_day_limit_remain=None, withdraw_eachtime_limit=None, withdraw_fix_on_chains=None, withdraw_percent_on_chains=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, str, str, str, dict(str, str), dict(str, str), Configuration) -> None """WithdrawStatus - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -92,6 +80,7 @@ def __init__( self._withdraw_day_limit_remain = None self._withdraw_eachtime_limit = None self._withdraw_fix_on_chains = None + self._withdraw_percent_on_chains = None self.discriminator = None if currency is not None: @@ -116,6 +105,8 @@ def __init__( self.withdraw_eachtime_limit = withdraw_eachtime_limit if withdraw_fix_on_chains is not None: self.withdraw_fix_on_chains = withdraw_fix_on_chains + if withdraw_percent_on_chains is not None: + self.withdraw_percent_on_chains = withdraw_percent_on_chains @property def currency(self): @@ -190,7 +181,7 @@ def name_cn(self, name_cn): def deposit(self): """Gets the deposit of this WithdrawStatus. # noqa: E501 - Deposits fee # noqa: E501 + Deposit fee # noqa: E501 :return: The deposit of this WithdrawStatus. # noqa: E501 :rtype: str @@ -201,7 +192,7 @@ def deposit(self): def deposit(self, deposit): """Sets the deposit of this WithdrawStatus. - Deposits fee # noqa: E501 + Deposit fee # noqa: E501 :param deposit: The deposit of this WithdrawStatus. # noqa: E501 :type: str @@ -370,6 +361,29 @@ def withdraw_fix_on_chains(self, withdraw_fix_on_chains): self._withdraw_fix_on_chains = withdraw_fix_on_chains + @property + def withdraw_percent_on_chains(self): + """Gets the withdraw_percent_on_chains of this WithdrawStatus. # noqa: E501 + + Percentage withdrawal fee on multiple chains # noqa: E501 + + :return: The withdraw_percent_on_chains of this WithdrawStatus. # noqa: E501 + :rtype: dict(str, str) + """ + return self._withdraw_percent_on_chains + + @withdraw_percent_on_chains.setter + def withdraw_percent_on_chains(self, withdraw_percent_on_chains): + """Sets the withdraw_percent_on_chains of this WithdrawStatus. + + Percentage withdrawal fee on multiple chains # noqa: E501 + + :param withdraw_percent_on_chains: The withdraw_percent_on_chains of this WithdrawStatus. # noqa: E501 + :type: dict(str, str) + """ + + self._withdraw_percent_on_chains = withdraw_percent_on_chains + def to_dict(self): """Returns the model properties as a dict""" result = {} @@ -377,16 +391,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/gate_api/models/withdrawal_record.py b/gate_api/models/withdrawal_record.py new file mode 100644 index 0000000..ee0cf4c --- /dev/null +++ b/gate_api/models/withdrawal_record.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 WithdrawalRecord(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + 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', + 'txid': 'str', + 'block_number': 'str', + 'withdraw_order_id': 'str', + 'timestamp': 'str', + 'amount': 'str', + 'fee': 'str', + 'currency': 'str', + 'address': 'str', + 'fail_reason': 'str', + 'timestamp2': 'str', + 'memo': 'str', + 'status': 'str', + 'chain': 'str' + } + + attribute_map = { + 'id': 'id', + 'txid': 'txid', + 'block_number': 'block_number', + 'withdraw_order_id': 'withdraw_order_id', + 'timestamp': 'timestamp', + 'amount': 'amount', + 'fee': 'fee', + 'currency': 'currency', + 'address': 'address', + 'fail_reason': 'fail_reason', + 'timestamp2': 'timestamp2', + 'memo': 'memo', + 'status': 'status', + 'chain': 'chain' + } + + def __init__(self, id=None, txid=None, block_number=None, withdraw_order_id=None, timestamp=None, amount=None, fee=None, currency=None, address=None, fail_reason=None, timestamp2=None, memo=None, status=None, chain=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, str, str, str, str, str, str, str, Configuration) -> None + """WithdrawalRecord - a 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._txid = None + self._block_number = None + self._withdraw_order_id = None + self._timestamp = None + self._amount = None + self._fee = None + self._currency = None + self._address = None + self._fail_reason = None + self._timestamp2 = None + self._memo = None + self._status = None + self._chain = None + self.discriminator = None + + if id is not None: + self.id = id + if txid is not None: + self.txid = txid + if block_number is not None: + self.block_number = block_number + if withdraw_order_id is not None: + self.withdraw_order_id = withdraw_order_id + if timestamp is not None: + self.timestamp = timestamp + self.amount = amount + if fee is not None: + self.fee = fee + self.currency = currency + if address is not None: + self.address = address + if fail_reason is not None: + self.fail_reason = fail_reason + if timestamp2 is not None: + self.timestamp2 = timestamp2 + if memo is not None: + self.memo = memo + if status is not None: + self.status = status + self.chain = chain + + @property + def id(self): + """Gets the id of this WithdrawalRecord. # noqa: E501 + + Record ID # noqa: E501 + + :return: The id of this WithdrawalRecord. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this WithdrawalRecord. + + Record ID # noqa: E501 + + :param id: The id of this WithdrawalRecord. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def txid(self): + """Gets the txid of this WithdrawalRecord. # noqa: E501 + + Hash record of the withdrawal # noqa: E501 + + :return: The txid of this WithdrawalRecord. # noqa: E501 + :rtype: str + """ + return self._txid + + @txid.setter + def txid(self, txid): + """Sets the txid of this WithdrawalRecord. + + Hash record of the withdrawal # noqa: E501 + + :param txid: The txid of this WithdrawalRecord. # noqa: E501 + :type: str + """ + + self._txid = txid + + @property + def block_number(self): + """Gets the block_number of this WithdrawalRecord. # noqa: E501 + + Block Number # noqa: E501 + + :return: The block_number of this WithdrawalRecord. # noqa: E501 + :rtype: str + """ + return self._block_number + + @block_number.setter + def block_number(self, block_number): + """Sets the block_number of this WithdrawalRecord. + + Block Number # noqa: E501 + + :param block_number: The block_number of this WithdrawalRecord. # noqa: E501 + :type: str + """ + + self._block_number = block_number + + @property + def withdraw_order_id(self): + """Gets the withdraw_order_id of this WithdrawalRecord. # noqa: E501 + + Client order id, up to 32 length and can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) # noqa: E501 + + :return: The withdraw_order_id of this WithdrawalRecord. # noqa: E501 + :rtype: str + """ + return self._withdraw_order_id + + @withdraw_order_id.setter + def withdraw_order_id(self, withdraw_order_id): + """Sets the withdraw_order_id of this WithdrawalRecord. + + Client order id, up to 32 length and can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) # noqa: E501 + + :param withdraw_order_id: The withdraw_order_id of this WithdrawalRecord. # noqa: E501 + :type: str + """ + + self._withdraw_order_id = withdraw_order_id + + @property + def timestamp(self): + """Gets the timestamp of this WithdrawalRecord. # noqa: E501 + + Operation time # noqa: E501 + + :return: The timestamp of this WithdrawalRecord. # noqa: E501 + :rtype: str + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this WithdrawalRecord. + + Operation time # noqa: E501 + + :param timestamp: The timestamp of this WithdrawalRecord. # noqa: E501 + :type: str + """ + + self._timestamp = timestamp + + @property + def amount(self): + """Gets the amount of this WithdrawalRecord. # noqa: E501 + + Token amount # noqa: E501 + + :return: The amount of this WithdrawalRecord. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this WithdrawalRecord. + + Token amount # noqa: E501 + + :param amount: The amount of this WithdrawalRecord. # 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 fee(self): + """Gets the fee of this WithdrawalRecord. # noqa: E501 + + fee # noqa: E501 + + :return: The fee of this WithdrawalRecord. # noqa: E501 + :rtype: str + """ + return self._fee + + @fee.setter + def fee(self, fee): + """Sets the fee of this WithdrawalRecord. + + fee # noqa: E501 + + :param fee: The fee of this WithdrawalRecord. # noqa: E501 + :type: str + """ + + self._fee = fee + + @property + def currency(self): + """Gets the currency of this WithdrawalRecord. # noqa: E501 + + Currency name # noqa: E501 + + :return: The currency of this WithdrawalRecord. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this WithdrawalRecord. + + Currency name # noqa: E501 + + :param currency: The currency of this WithdrawalRecord. # 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 address(self): + """Gets the address of this WithdrawalRecord. # noqa: E501 + + Withdrawal address # noqa: E501 + + :return: The address of this WithdrawalRecord. # noqa: E501 + :rtype: str + """ + return self._address + + @address.setter + def address(self, address): + """Sets the address of this WithdrawalRecord. + + Withdrawal address # noqa: E501 + + :param address: The address of this WithdrawalRecord. # noqa: E501 + :type: str + """ + + self._address = address + + @property + def fail_reason(self): + """Gets the fail_reason of this WithdrawalRecord. # noqa: E501 + + Reason for withdrawal failure. Has a value when status = CANCEL, empty for all other statuses # noqa: E501 + + :return: The fail_reason of this WithdrawalRecord. # noqa: E501 + :rtype: str + """ + return self._fail_reason + + @fail_reason.setter + def fail_reason(self, fail_reason): + """Sets the fail_reason of this WithdrawalRecord. + + Reason for withdrawal failure. Has a value when status = CANCEL, empty for all other statuses # noqa: E501 + + :param fail_reason: The fail_reason of this WithdrawalRecord. # noqa: E501 + :type: str + """ + + self._fail_reason = fail_reason + + @property + 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 + + :return: The timestamp2 of this WithdrawalRecord. # noqa: E501 + :rtype: str + """ + return self._timestamp2 + + @timestamp2.setter + 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 + + :param timestamp2: The timestamp2 of this WithdrawalRecord. # noqa: E501 + :type: str + """ + + self._timestamp2 = timestamp2 + + @property + def memo(self): + """Gets the memo of this WithdrawalRecord. # noqa: E501 + + Additional remarks with regards to the withdrawal # noqa: E501 + + :return: The memo of this WithdrawalRecord. # noqa: E501 + :rtype: str + """ + return self._memo + + @memo.setter + def memo(self, memo): + """Sets the memo of this WithdrawalRecord. + + Additional remarks with regards to the withdrawal # noqa: E501 + + :param memo: The memo of this WithdrawalRecord. # noqa: E501 + :type: str + """ + + self._memo = memo + + @property + def status(self): + """Gets the status of this WithdrawalRecord. # noqa: E501 + + Transaction status - DONE: Completed (block_number > 0 is considered to be truly completed) - CANCEL: Canceled - REQUEST: Requesting - MANUAL: Pending manual review - BCODE: Recharge code operation - EXTPEND: Sent awaiting confirmation - FAIL: Failure on the chain awaiting confirmation - INVALID: Invalid order - VERIFY: Verifying - PROCES: Processing - PEND: Processing - DMOVE: pending manual review - REVIEW: Under review # noqa: E501 + + :return: The status of this WithdrawalRecord. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this WithdrawalRecord. + + Transaction status - DONE: Completed (block_number > 0 is considered to be truly completed) - CANCEL: Canceled - REQUEST: Requesting - MANUAL: Pending manual review - BCODE: Recharge code operation - EXTPEND: Sent awaiting confirmation - FAIL: Failure on the chain awaiting confirmation - INVALID: Invalid order - VERIFY: Verifying - PROCES: Processing - PEND: Processing - DMOVE: pending manual review - REVIEW: Under review # noqa: E501 + + :param status: The status of this WithdrawalRecord. # noqa: E501 + :type: str + """ + + self._status = status + + @property + def chain(self): + """Gets the chain of this WithdrawalRecord. # noqa: E501 + + Name of the chain used in withdrawals # noqa: E501 + + :return: The chain of this WithdrawalRecord. # noqa: E501 + :rtype: str + """ + return self._chain + + @chain.setter + def chain(self, chain): + """Sets the chain of this WithdrawalRecord. + + Name of the chain used in withdrawals # noqa: E501 + + :param chain: The chain of this WithdrawalRecord. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and chain is None: # noqa: E501 + raise ValueError("Invalid value for `chain`, must not be `None`") # noqa: E501 + + 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, WithdrawalRecord): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, WithdrawalRecord): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/rest.py b/gate_api/rest.py index b505e8b..8781e1b 100644 --- a/gate_api/rest.py +++ b/gate_api/rest.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -19,7 +19,6 @@ import ssl import certifi - # python 2 and python 3 compatibility library import six from six.moves.urllib.parse import urlencode @@ -32,6 +31,7 @@ class RESTResponse(io.IOBase): + def __init__(self, resp): self.urllib3_response = resp self.status = resp.status @@ -48,6 +48,7 @@ def getheader(self, name, default=None): class RESTClientObject(object): + def __init__(self, configuration, pools_size=4, maxsize=None): # urllib3.PoolManager will pass all kw parameters to connectionpool # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 @@ -105,17 +106,9 @@ def __init__(self, configuration, pools_size=4, maxsize=None): **addition_pool_args ) - def request( - self, - method, - url, - query_params=None, - headers=None, - body=None, - post_params=None, - _preload_content=True, - _request_timeout=None, - ): + def request(self, method, url, query_params=None, headers=None, + body=None, post_params=None, _preload_content=True, + _request_timeout=None): """Perform requests. :param method: http request method @@ -135,20 +128,25 @@ def request( (connection, read) timeouts. """ method = method.upper() - assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', 'PATCH', 'OPTIONS'] + assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', + 'PATCH', 'OPTIONS'] if post_params and body: - raise ApiValueError("body parameter cannot be used with post_params parameter.") + raise ApiValueError( + "body parameter cannot be used with post_params parameter." + ) post_params = post_params or {} headers = headers or {} timeout = None if _request_timeout: - if isinstance(_request_timeout, (int,) if six.PY3 else (int, long)): # noqa: E501,F821 + if isinstance(_request_timeout, (int, ) if six.PY3 else (int, long)): # noqa: E501,F821 timeout = urllib3.Timeout(total=_request_timeout) - elif isinstance(_request_timeout, tuple) and len(_request_timeout) == 2: - timeout = urllib3.Timeout(connect=_request_timeout[0], read=_request_timeout[1]) + elif (isinstance(_request_timeout, tuple) and + len(_request_timeout) == 2): + timeout = urllib3.Timeout( + connect=_request_timeout[0], read=_request_timeout[1]) if 'Content-Type' not in headers: headers['Content-Type'] = 'application/json' @@ -163,50 +161,42 @@ def request( if body is not None: request_body = json.dumps(body) r = self.pool_manager.request( - method, - url, + method, url, body=request_body, preload_content=_preload_content, timeout=timeout, - headers=headers, - ) + headers=headers) elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 r = self.pool_manager.request( - method, - url, + method, url, fields=post_params, encode_multipart=False, preload_content=_preload_content, timeout=timeout, - headers=headers, - ) + headers=headers) elif headers['Content-Type'] == 'multipart/form-data': # must del headers['Content-Type'], or the correct # Content-Type which generated by urllib3 will be # overwritten. del headers['Content-Type'] r = self.pool_manager.request( - method, - url, + method, url, fields=post_params, encode_multipart=True, preload_content=_preload_content, timeout=timeout, - headers=headers, - ) + headers=headers) # Pass a `string` parameter directly in the body to support # other content types than Json when `body` argument is # provided in serialized form elif isinstance(body, str) or isinstance(body, bytes): request_body = body r = self.pool_manager.request( - method, - url, + method, url, body=request_body, preload_content=_preload_content, timeout=timeout, - headers=headers, - ) + headers=headers) else: # Cannot generate the request from given parameters msg = """Cannot prepare a request message for provided @@ -215,9 +205,11 @@ def request( raise ApiException(status=0, reason=msg) # For `GET`, `HEAD` else: - r = self.pool_manager.request( - method, url, fields=query_params, preload_content=_preload_content, timeout=timeout, headers=headers - ) + r = self.pool_manager.request(method, url, + fields=query_params, + preload_content=_preload_content, + timeout=timeout, + headers=headers) except urllib3.exceptions.SSLError as e: msg = "{0}\n{1}".format(type(e).__name__, str(e)) raise ApiException(status=0, reason=msg) @@ -233,117 +225,67 @@ def request( return r - def GET(self, url, headers=None, query_params=None, _preload_content=True, _request_timeout=None): - return self.request( - "GET", - url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params, - ) - - def HEAD(self, url, headers=None, query_params=None, _preload_content=True, _request_timeout=None): - return self.request( - "HEAD", - url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params, - ) - - def OPTIONS( - self, - url, - headers=None, - query_params=None, - post_params=None, - body=None, - _preload_content=True, - _request_timeout=None, - ): - return self.request( - "OPTIONS", - url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, - ) - - def DELETE(self, url, headers=None, query_params=None, body=None, _preload_content=True, _request_timeout=None): - return self.request( - "DELETE", - url, - headers=headers, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, - ) - - def POST( - self, - url, - headers=None, - query_params=None, - post_params=None, - body=None, - _preload_content=True, - _request_timeout=None, - ): - return self.request( - "POST", - url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, - ) - - def PUT( - self, - url, - headers=None, - query_params=None, - post_params=None, - body=None, - _preload_content=True, - _request_timeout=None, - ): - return self.request( - "PUT", - url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, - ) - - def PATCH( - self, - url, - headers=None, - query_params=None, - post_params=None, - body=None, - _preload_content=True, - _request_timeout=None, - ): - return self.request( - "PATCH", - url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, - ) + def GET(self, url, headers=None, query_params=None, _preload_content=True, + _request_timeout=None): + return self.request("GET", url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params) + + def HEAD(self, url, headers=None, query_params=None, _preload_content=True, + _request_timeout=None): + return self.request("HEAD", url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params) + + def OPTIONS(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("OPTIONS", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def DELETE(self, url, headers=None, query_params=None, body=None, + _preload_content=True, _request_timeout=None): + return self.request("DELETE", url, + headers=headers, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def POST(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("POST", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def PUT(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("PUT", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def PATCH(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("PATCH", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) diff --git a/setup.cfg b/setup.cfg index 4d8daf3..1d2fcfb 100644 --- a/setup.cfg +++ b/setup.cfg @@ -6,8 +6,8 @@ classifiers: Programming Language :: Python :: 2 Programming Language :: Python :: 2.7 Programming Language :: Python :: 3 -maintainer = gateio -maintainer_email = dev@mail.gate.io +maintainer = gate +maintainer_email = dev@mail.gate.com [flake8] max-line-length=99 diff --git a/setup.py b/setup.py index 8694e4b..d0fc88e 100644 --- a/setup.py +++ b/setup.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - Gate API v4 + Gate API - Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - Contact: support@mail.gate.io + Contact: support@mail.gate.com Generated by: https://openapi-generator.tech """ @@ -13,7 +13,7 @@ from setuptools import setup, find_packages # noqa: H301 NAME = "gate-api" -VERSION = "4.22.4" +VERSION = "7.1.8" # To install the library, run the following # # python setup.py install @@ -26,11 +26,11 @@ setup( name=NAME, version=VERSION, - description="Gate API v4", + description="Gate API", author="Gate API support", - author_email="support@mail.gate.io", + author_email="support@mail.gate.com", url="https://github.com/gateio/gateapi-python", - keywords=["OpenAPI", "OpenAPI-Generator", "Gate API v4"], + keywords=["OpenAPI", "OpenAPI-Generator", "Gate API"], install_requires=REQUIRES, packages=find_packages(exclude=["test", "tests"]), include_package_data=True,