天择加密量化开放框架下载
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

924 lines
44 KiB

# 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 ApiTypeError, ApiValueError # noqa: F401
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
"""List currencies for lending # noqa: 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
"""List currencies for lending # noqa: 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
"""Get currency detail for lending # 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
"""Get currency detail for lending # 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 local_var_params['currency'] is None # noqa: E501
): # 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
"""List user's lending 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_user_uni_lends(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 _preload_content: if False, the urllib3.HTTPResponse object will
be returned without reading/decoding response
data. Default is True.
:param _request_timeout: timeout setting for 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
"""List user's lending 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_user_uni_lends_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 _return_http_data_only: response data without head status code
and headers
:param _preload_content: if False, the urllib3.HTTPResponse object will
be returned without reading/decoding response
data. Default is True.
:param _request_timeout: timeout setting for this 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
"""Lend or redeem # noqa: E501
`Lending`: The minimum interest rate is required in lending. The lending result is updated hourly and the interest profit is paid on the next hour. A high interest rate might lead to unsuccessful lending and no profit will be gained for that hour. If the funds are redeemed before the hourly settlement, no interest can be obtained for that hour. About priority: the orders created or amended first under the same interest rate will be lent out first `Redemption`: Funds that failed to be lent can be redeemed immediately. For the successfully lent funds, enjoy the hourly income, and the redemption will arrive at the next hour `Note`: Two minutes before and after the hour is the settlement time, 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
"""Lend or redeem # noqa: E501
`Lending`: The minimum interest rate is required in lending. The lending result is updated hourly and the interest profit is paid on the next hour. A high interest rate might lead to unsuccessful lending and no profit will be gained for that hour. If the funds are redeemed before the hourly settlement, no interest can be obtained for that hour. About priority: the orders created or amended first under the same interest rate will be lent out first `Redemption`: Funds that failed to be lent can be redeemed immediately. For the successfully lent funds, enjoy the hourly income, and the redemption will arrive at the next hour `Note`: Two minutes before and after the hour is the settlement time, 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 local_var_params['create_uni_lend'] is None # noqa: E501
): # 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 lending order # noqa: E501
Currently only supports amending the minimum interest rate (hour) # 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 lending order # noqa: E501
Currently only supports amending the minimum interest rate (hour) # 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 local_var_params['patch_uni_lend'] is None # noqa: E501
): # 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
"""List records of lending # noqa: 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: 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: 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
"""List records of lending # noqa: 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: 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: 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', '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 '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
"""Get the user's total interest income of 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
"""Get the user's total interest income of 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 local_var_params['currency'] is None # noqa: E501
): # 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
"""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_uni_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 _preload_content: if False, the urllib3.HTTPResponse object will
be returned without reading/decoding response
data. Default is True.
:param _request_timeout: timeout setting for 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
"""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_uni_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 _return_http_data_only: response data without head status code
and headers
:param _preload_content: if False, the urllib3.HTTPResponse object will
be returned without reading/decoding response
data. Default is True.
:param _request_timeout: timeout setting for this 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']
all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout'])
for k, 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
header_params = {}
form_params = []
local_var_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,
)