# 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 """ 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. You can refer to the [Formula](#portfolio-account) in the documentation # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_unified_accounts(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str currency: Retrieve data of the specified currency :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. You can refer to the [Formula](#portfolio-account) in the documentation # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_unified_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 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 about the maximum borrowing for the 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: 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.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 about the maximum borrowing for the 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: 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.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 about the maximum transferable for the 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: 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.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 about the maximum transferable for the 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: 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.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 can be transferred out at most for unified accounts; each currency is the maximum value. After the user withdraws the currency, the amount of transferable currency will be changed. # 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 can be transferred out at most for unified accounts; each currency is the maximum value. After the user withdraws the currency, the amount of transferable currency will be changed. # 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 can be borrowed up to a maximum # 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 the currency names for querying in an array, separated by commas, with a maximum of 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 can be borrowed up to a maximum # 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 the currency names for querying in an array, separated by commas, with a maximum of 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 """List 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: Retrieve data of the specified currency :param int page: Page number :param int limit: Maximum response items. Default: 100, minimum: 1, Maximum: 100 :param str type: Loan type, platform - platform, margin - 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 """List 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: Retrieve data of the specified currency :param int page: Page number :param int limit: Maximum response items. Default: 100, minimum: 1, Maximum: 100 :param str type: Loan type, platform - platform, margin - 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, it is essential to ensure that 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 the user. The interest on the loan will be automatically deducted from the account at regular intervals. It is the user's responsibility to manage the repayment of the borrowed amount. For repayment, the option to repay the entire borrowed amount is available by setting the parameter `repaid_all=true` # 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, it is essential to ensure that 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 the user. The interest on the loan will be automatically deducted from the account at regular intervals. It is the user's responsibility to manage the repayment of the borrowed amount. For repayment, the option to repay the entire borrowed amount is available by setting the parameter `repaid_all=true` # 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 """Get load 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: The types of lending records, borrow - indicates the action of borrowing funds, repay - indicates the action of repaying the borrowed funds :param str currency: Retrieve data of the specified currency :param int page: Page number :param int limit: Maximum response items. 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 """Get load 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: The types of lending records, borrow - indicates the action of borrowing funds, repay - indicates the action of repaying the borrowed funds :param str currency: Retrieve data of the specified currency :param int page: Page number :param int limit: Maximum response items. 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 """List interest 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: Retrieve data of the specified currency :param int page: Page number :param int limit: Maximum response items. Default: 100, minimum: 1, Maximum: 100 :param int _from: Start timestamp of the query :param int to: Time range ending, default to current time :param str type: Loan type, platform loan - platform, leverage loan - margin, if not passed, defaults to 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.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 """List interest 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: Retrieve data of the specified currency :param int page: Page number :param int limit: Maximum response items. Default: 100, minimum: 1, Maximum: 100 :param int _from: Start timestamp of the query :param int to: Time range ending, default to current time :param str type: Loan type, platform loan - platform, leverage loan - margin, if not passed, defaults to 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.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 Retrieve 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 Retrieve 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 mode of the unified account # noqa: E501 Switching each account mode only requires passing the parameters of the corresponding account mode, and supports turning on or off the configuration switch in the corresponding account mode when switching the account mode - When opening the classic account mode, mode=classic ``` PUT /unified/unified_mode { \"mode\": \"classic\" } ``` - Open the cross-currency margin mode, mode=multi_currency ``` PUT /unified/unified_mode { \"mode\": \"multi_currency\", \"settings\": { \"usdt_futures\": true } } ``` - When the portfolio margin mode is enabled, mode=portfolio ``` PUT /unified/unified_mode { \"mode\": \"portfolio\", \"settings\": { \"spot_hedge\": true } } ``` - When opening a 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 mode of the unified account # noqa: E501 Switching each account mode only requires passing the parameters of the corresponding account mode, and supports turning on or off the configuration switch in the corresponding account mode when switching the account mode - When opening the classic account mode, mode=classic ``` PUT /unified/unified_mode { \"mode\": \"classic\" } ``` - Open the cross-currency margin mode, mode=multi_currency ``` PUT /unified/unified_mode { \"mode\": \"multi_currency\", \"settings\": { \"usdt_futures\": true } } ``` - When the portfolio margin mode is enabled, mode=portfolio ``` PUT /unified/unified_mode { \"mode\": \"portfolio\", \"settings\": { \"spot_hedge\": true } } ``` - When opening a 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 """Get unified estimate rate # noqa: E501 Due to fluctuations in lending depth, hourly interest rates may vary, and thus, I cannot provide exact rates. 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 the currency names for querying in an array, separated by commas, with a maximum of 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 """Get unified estimate rate # noqa: E501 Due to fluctuations in lending depth, hourly interest rates may vary, and thus, I cannot provide exact rates. 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 the currency names for querying in an array, separated by commas, with a maximum of 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 """List currency discount 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.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 """List currency discount 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.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 """List loan margin 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.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 """List loan margin 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.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 a simulated position portfolio, 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 a simulated position portfolio, 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 """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 """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 the leverage multiple of the user currency # noqa: E501 Get the user's currency leverage. If currency is not passed, 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: 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 the leverage multiple of the user currency # noqa: E501 Get the user's currency leverage. If currency is not passed, 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(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='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 the 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 the 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: The VIP level of the floating rate that needs to be queried :param int page: Page number :param int limit: Maximum response items. 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: The VIP level of the floating rate that needs to be queried :param int page: Page number :param int limit: Maximum response items. 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 = ['apiv4'] # 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)