# 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 MarginUniApi(object):
|
|
"""NOTE: This class is auto generated by OpenAPI Generator
|
|
Ref: https://openapi-generator.tech
|
|
|
|
Do not edit the class manually.
|
|
"""
|
|
|
|
def __init__(self, api_client=None):
|
|
if api_client is None:
|
|
api_client = ApiClient()
|
|
self.api_client = api_client
|
|
|
|
def list_uni_currency_pairs(self, **kwargs): # noqa: E501
|
|
"""List lending markets # noqa: E501
|
|
|
|
This method makes a synchronous HTTP request by default. To make an
|
|
asynchronous HTTP request, please pass async_req=True
|
|
>>> thread = api.list_uni_currency_pairs(async_req=True)
|
|
>>> result = thread.get()
|
|
|
|
:param bool async_req: execute request asynchronously
|
|
:param _preload_content: if False, the urllib3.HTTPResponse object will
|
|
be returned without reading/decoding response
|
|
data. Default is True.
|
|
:param _request_timeout: timeout setting for this request. If one
|
|
number provided, it will be total request
|
|
timeout. It can also be a pair (tuple) of
|
|
(connection, read) timeouts.
|
|
:rtype: list[gate_api.UniCurrencyPair]
|
|
:return: If the method is called asynchronously,
|
|
returns the request thread.
|
|
"""
|
|
kwargs['_return_http_data_only'] = True
|
|
return self.list_uni_currency_pairs_with_http_info(**kwargs) # noqa: E501
|
|
|
|
def list_uni_currency_pairs_with_http_info(self, **kwargs): # noqa: E501
|
|
"""List lending markets # noqa: E501
|
|
|
|
This method makes a synchronous HTTP request by default. To make an
|
|
asynchronous HTTP request, please pass async_req=True
|
|
>>> thread = api.list_uni_currency_pairs_with_http_info(async_req=True)
|
|
>>> result = thread.get()
|
|
|
|
:param bool async_req: execute request asynchronously
|
|
:param _return_http_data_only: response data without head status code
|
|
and headers
|
|
:param _preload_content: if False, the urllib3.HTTPResponse object will
|
|
be returned without reading/decoding response
|
|
data. Default is True.
|
|
:param _request_timeout: timeout setting for this request. If one
|
|
number provided, it will be total request
|
|
timeout. It can also be a pair (tuple) of
|
|
(connection, read) timeouts.
|
|
:rtype: tuple(list[gate_api.UniCurrencyPair], status_code(int), headers(HTTPHeaderDict))
|
|
:return: If the method is called asynchronously,
|
|
returns the request thread.
|
|
"""
|
|
|
|
local_var_params = locals()
|
|
|
|
all_params = []
|
|
all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout'])
|
|
|
|
for k, v in six.iteritems(local_var_params['kwargs']):
|
|
if k not in all_params:
|
|
raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method list_uni_currency_pairs" % k)
|
|
local_var_params[k] = v
|
|
del local_var_params['kwargs']
|
|
|
|
collection_formats = {}
|
|
|
|
path_params = {}
|
|
|
|
query_params = []
|
|
|
|
header_params = {}
|
|
|
|
form_params = []
|
|
local_var_files = {}
|
|
|
|
body_params = None
|
|
# HTTP header `Accept`
|
|
header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501
|
|
|
|
# Authentication setting
|
|
auth_settings = [] # noqa: E501
|
|
|
|
return self.api_client.call_api(
|
|
'/margin/uni/currency_pairs',
|
|
'GET',
|
|
path_params,
|
|
query_params,
|
|
header_params,
|
|
body=body_params,
|
|
post_params=form_params,
|
|
files=local_var_files,
|
|
response_type='list[UniCurrencyPair]', # noqa: E501
|
|
auth_settings=auth_settings,
|
|
async_req=local_var_params.get('async_req'),
|
|
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
|
|
_preload_content=local_var_params.get('_preload_content', True),
|
|
_request_timeout=local_var_params.get('_request_timeout'),
|
|
collection_formats=collection_formats,
|
|
)
|
|
|
|
def get_uni_currency_pair(self, currency_pair, **kwargs): # noqa: E501
|
|
"""Get detail of lending market # noqa: E501
|
|
|
|
This method makes a synchronous HTTP request by default. To make an
|
|
asynchronous HTTP request, please pass async_req=True
|
|
>>> thread = api.get_uni_currency_pair(currency_pair, async_req=True)
|
|
>>> result = thread.get()
|
|
|
|
:param bool async_req: execute request asynchronously
|
|
:param str currency_pair: Currency pair (required)
|
|
:param _preload_content: if False, the urllib3.HTTPResponse object will
|
|
be returned without reading/decoding response
|
|
data. Default is True.
|
|
:param _request_timeout: timeout setting for this request. If one
|
|
number provided, it will be total request
|
|
timeout. It can also be a pair (tuple) of
|
|
(connection, read) timeouts.
|
|
:rtype: gate_api.UniCurrencyPair
|
|
:return: If the method is called asynchronously,
|
|
returns the request thread.
|
|
"""
|
|
kwargs['_return_http_data_only'] = True
|
|
return self.get_uni_currency_pair_with_http_info(currency_pair, **kwargs) # noqa: E501
|
|
|
|
def get_uni_currency_pair_with_http_info(self, currency_pair, **kwargs): # noqa: E501
|
|
"""Get detail of lending market # noqa: E501
|
|
|
|
This method makes a synchronous HTTP request by default. To make an
|
|
asynchronous HTTP request, please pass async_req=True
|
|
>>> thread = api.get_uni_currency_pair_with_http_info(currency_pair, async_req=True)
|
|
>>> result = thread.get()
|
|
|
|
:param bool async_req: execute request asynchronously
|
|
:param str currency_pair: Currency pair (required)
|
|
:param _return_http_data_only: response data without head status code
|
|
and headers
|
|
:param _preload_content: if False, the urllib3.HTTPResponse object will
|
|
be returned without reading/decoding response
|
|
data. Default is True.
|
|
:param _request_timeout: timeout setting for this request. If one
|
|
number provided, it will be total request
|
|
timeout. It can also be a pair (tuple) of
|
|
(connection, read) timeouts.
|
|
:rtype: tuple(gate_api.UniCurrencyPair, status_code(int), headers(HTTPHeaderDict))
|
|
:return: If the method is called asynchronously,
|
|
returns the request thread.
|
|
"""
|
|
|
|
local_var_params = locals()
|
|
|
|
all_params = ['currency_pair']
|
|
all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout'])
|
|
|
|
for k, v in six.iteritems(local_var_params['kwargs']):
|
|
if k not in all_params:
|
|
raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method get_uni_currency_pair" % k)
|
|
local_var_params[k] = v
|
|
del local_var_params['kwargs']
|
|
# verify the required parameter 'currency_pair' is set
|
|
if self.api_client.client_side_validation and (
|
|
'currency_pair' not in local_var_params or local_var_params['currency_pair'] is None # noqa: E501
|
|
): # noqa: E501
|
|
raise ApiValueError(
|
|
"Missing the required parameter `currency_pair` when calling `get_uni_currency_pair`"
|
|
) # noqa: E501
|
|
|
|
collection_formats = {}
|
|
|
|
path_params = {}
|
|
if 'currency_pair' in local_var_params:
|
|
path_params['currency_pair'] = local_var_params['currency_pair'] # noqa: E501
|
|
|
|
query_params = []
|
|
|
|
header_params = {}
|
|
|
|
form_params = []
|
|
local_var_files = {}
|
|
|
|
body_params = None
|
|
# HTTP header `Accept`
|
|
header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501
|
|
|
|
# Authentication setting
|
|
auth_settings = [] # noqa: E501
|
|
|
|
return self.api_client.call_api(
|
|
'/margin/uni/currency_pairs/{currency_pair}',
|
|
'GET',
|
|
path_params,
|
|
query_params,
|
|
header_params,
|
|
body=body_params,
|
|
post_params=form_params,
|
|
files=local_var_files,
|
|
response_type='UniCurrencyPair', # noqa: E501
|
|
auth_settings=auth_settings,
|
|
async_req=local_var_params.get('async_req'),
|
|
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
|
|
_preload_content=local_var_params.get('_preload_content', True),
|
|
_request_timeout=local_var_params.get('_request_timeout'),
|
|
collection_formats=collection_formats,
|
|
)
|
|
|
|
def list_uni_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_uni_loans(async_req=True)
|
|
>>> result = thread.get()
|
|
|
|
:param bool async_req: execute request asynchronously
|
|
:param str currency_pair: Currency pair
|
|
: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.UniLoan]
|
|
:return: If the method is called asynchronously,
|
|
returns the request thread.
|
|
"""
|
|
kwargs['_return_http_data_only'] = True
|
|
return self.list_uni_loans_with_http_info(**kwargs) # noqa: E501
|
|
|
|
def list_uni_loans_with_http_info(self, **kwargs): # noqa: E501
|
|
"""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_uni_loans_with_http_info(async_req=True)
|
|
>>> result = thread.get()
|
|
|
|
:param bool async_req: execute request asynchronously
|
|
:param str currency_pair: Currency pair
|
|
:param str currency: 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.UniLoan], status_code(int), headers(HTTPHeaderDict))
|
|
:return: If the method is called asynchronously,
|
|
returns the request thread.
|
|
"""
|
|
|
|
local_var_params = locals()
|
|
|
|
all_params = ['currency_pair', 'currency', 'page', 'limit']
|
|
all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout'])
|
|
|
|
for k, v in six.iteritems(local_var_params['kwargs']):
|
|
if k not in all_params:
|
|
raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method list_uni_loans" % k)
|
|
local_var_params[k] = v
|
|
del local_var_params['kwargs']
|
|
|
|
if (
|
|
self.api_client.client_side_validation and 'page' in local_var_params and local_var_params['page'] < 1
|
|
): # noqa: E501
|
|
raise ApiValueError(
|
|
"Invalid value for parameter `page` when calling `list_uni_loans`, must be a value greater than or equal to `1`"
|
|
) # noqa: E501
|
|
if (
|
|
self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 100
|
|
): # noqa: E501
|
|
raise ApiValueError(
|
|
"Invalid value for parameter `limit` when calling `list_uni_loans`, must be a value less than or equal to `100`"
|
|
) # noqa: E501
|
|
if (
|
|
self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1
|
|
): # noqa: E501
|
|
raise ApiValueError(
|
|
"Invalid value for parameter `limit` when calling `list_uni_loans`, must be a value greater than or equal to `1`"
|
|
) # noqa: E501
|
|
collection_formats = {}
|
|
|
|
path_params = {}
|
|
|
|
query_params = []
|
|
if 'currency_pair' in local_var_params and local_var_params['currency_pair'] is not None: # noqa: E501
|
|
query_params.append(('currency_pair', local_var_params['currency_pair'])) # noqa: E501
|
|
if 'currency' in local_var_params and local_var_params['currency'] is not None: # noqa: E501
|
|
query_params.append(('currency', local_var_params['currency'])) # noqa: E501
|
|
if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501
|
|
query_params.append(('page', local_var_params['page'])) # noqa: E501
|
|
if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501
|
|
query_params.append(('limit', local_var_params['limit'])) # noqa: E501
|
|
|
|
header_params = {}
|
|
|
|
form_params = []
|
|
local_var_files = {}
|
|
|
|
body_params = None
|
|
# HTTP header `Accept`
|
|
header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501
|
|
|
|
# Authentication setting
|
|
auth_settings = ['apiv4'] # noqa: E501
|
|
|
|
return self.api_client.call_api(
|
|
'/margin/uni/loans',
|
|
'GET',
|
|
path_params,
|
|
query_params,
|
|
header_params,
|
|
body=body_params,
|
|
post_params=form_params,
|
|
files=local_var_files,
|
|
response_type='list[UniLoan]', # noqa: E501
|
|
auth_settings=auth_settings,
|
|
async_req=local_var_params.get('async_req'),
|
|
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
|
|
_preload_content=local_var_params.get('_preload_content', True),
|
|
_request_timeout=local_var_params.get('_request_timeout'),
|
|
collection_formats=collection_formats,
|
|
)
|
|
|
|
def create_uni_loan(self, create_uni_loan, **kwargs): # noqa: E501
|
|
"""Borrow or repay # noqa: E501
|
|
|
|
This method makes a synchronous HTTP request by default. To make an
|
|
asynchronous HTTP request, please pass async_req=True
|
|
>>> thread = api.create_uni_loan(create_uni_loan, async_req=True)
|
|
>>> result = thread.get()
|
|
|
|
:param bool async_req: execute request asynchronously
|
|
:param CreateUniLoan create_uni_loan: (required)
|
|
:param _preload_content: if False, the urllib3.HTTPResponse object will
|
|
be returned without reading/decoding response
|
|
data. Default is True.
|
|
:param _request_timeout: timeout setting for this request. If one
|
|
number provided, it will be total request
|
|
timeout. It can also be a pair (tuple) of
|
|
(connection, read) timeouts.
|
|
:rtype: None
|
|
:return: If the method is called asynchronously,
|
|
returns the request thread.
|
|
"""
|
|
kwargs['_return_http_data_only'] = True
|
|
return self.create_uni_loan_with_http_info(create_uni_loan, **kwargs) # noqa: E501
|
|
|
|
def create_uni_loan_with_http_info(self, create_uni_loan, **kwargs): # noqa: E501
|
|
"""Borrow or repay # noqa: E501
|
|
|
|
This method makes a synchronous HTTP request by default. To make an
|
|
asynchronous HTTP request, please pass async_req=True
|
|
>>> thread = api.create_uni_loan_with_http_info(create_uni_loan, async_req=True)
|
|
>>> result = thread.get()
|
|
|
|
:param bool async_req: execute request asynchronously
|
|
:param CreateUniLoan create_uni_loan: (required)
|
|
:param _return_http_data_only: response data without head status code
|
|
and headers
|
|
:param _preload_content: if False, the urllib3.HTTPResponse object will
|
|
be returned without reading/decoding response
|
|
data. Default is True.
|
|
:param _request_timeout: timeout setting for this request. If one
|
|
number provided, it will be total request
|
|
timeout. It can also be a pair (tuple) of
|
|
(connection, read) timeouts.
|
|
:rtype: None
|
|
:return: If the method is called asynchronously,
|
|
returns the request thread.
|
|
"""
|
|
|
|
local_var_params = locals()
|
|
|
|
all_params = ['create_uni_loan']
|
|
all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout'])
|
|
|
|
for k, v in six.iteritems(local_var_params['kwargs']):
|
|
if k not in all_params:
|
|
raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method create_uni_loan" % k)
|
|
local_var_params[k] = v
|
|
del local_var_params['kwargs']
|
|
# verify the required parameter 'create_uni_loan' is set
|
|
if self.api_client.client_side_validation and (
|
|
'create_uni_loan' not in local_var_params or local_var_params['create_uni_loan'] is None # noqa: E501
|
|
): # noqa: E501
|
|
raise ApiValueError(
|
|
"Missing the required parameter `create_uni_loan` when calling `create_uni_loan`"
|
|
) # noqa: E501
|
|
|
|
collection_formats = {}
|
|
|
|
path_params = {}
|
|
|
|
query_params = []
|
|
|
|
header_params = {}
|
|
|
|
form_params = []
|
|
local_var_files = {}
|
|
|
|
body_params = None
|
|
if 'create_uni_loan' in local_var_params:
|
|
body_params = local_var_params['create_uni_loan']
|
|
# HTTP header `Content-Type`
|
|
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
|
['application/json']
|
|
) # noqa: E501
|
|
|
|
# Authentication setting
|
|
auth_settings = ['apiv4'] # noqa: E501
|
|
|
|
return self.api_client.call_api(
|
|
'/margin/uni/loans',
|
|
'POST',
|
|
path_params,
|
|
query_params,
|
|
header_params,
|
|
body=body_params,
|
|
post_params=form_params,
|
|
files=local_var_files,
|
|
response_type=None, # noqa: E501
|
|
auth_settings=auth_settings,
|
|
async_req=local_var_params.get('async_req'),
|
|
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
|
|
_preload_content=local_var_params.get('_preload_content', True),
|
|
_request_timeout=local_var_params.get('_request_timeout'),
|
|
collection_formats=collection_formats,
|
|
)
|
|
|
|
def list_uni_loan_records(self, **kwargs): # noqa: E501
|
|
"""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_uni_loan_records(async_req=True)
|
|
>>> result = thread.get()
|
|
|
|
:param bool async_req: execute request asynchronously
|
|
:param str type: type: borrow - borrow, repay - repay
|
|
:param str currency: Retrieve data of the specified currency
|
|
:param str currency_pair: Currency pair
|
|
: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.UniLoanRecord]
|
|
:return: If the method is called asynchronously,
|
|
returns the request thread.
|
|
"""
|
|
kwargs['_return_http_data_only'] = True
|
|
return self.list_uni_loan_records_with_http_info(**kwargs) # noqa: E501
|
|
|
|
def list_uni_loan_records_with_http_info(self, **kwargs): # noqa: E501
|
|
"""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_uni_loan_records_with_http_info(async_req=True)
|
|
>>> result = thread.get()
|
|
|
|
:param bool async_req: execute request asynchronously
|
|
:param str type: type: borrow - borrow, repay - repay
|
|
:param str currency: Retrieve data of the specified currency
|
|
:param str currency_pair: Currency pair
|
|
: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.UniLoanRecord], status_code(int), headers(HTTPHeaderDict))
|
|
:return: If the method is called asynchronously,
|
|
returns the request thread.
|
|
"""
|
|
|
|
local_var_params = locals()
|
|
|
|
all_params = ['type', 'currency', 'currency_pair', 'page', 'limit']
|
|
all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout'])
|
|
|
|
for k, v in six.iteritems(local_var_params['kwargs']):
|
|
if k not in all_params:
|
|
raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method list_uni_loan_records" % k)
|
|
local_var_params[k] = v
|
|
del local_var_params['kwargs']
|
|
|
|
if (
|
|
self.api_client.client_side_validation and 'page' in local_var_params and local_var_params['page'] < 1
|
|
): # noqa: E501
|
|
raise ApiValueError(
|
|
"Invalid value for parameter `page` when calling `list_uni_loan_records`, must be a value greater than or equal to `1`"
|
|
) # noqa: E501
|
|
if (
|
|
self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 100
|
|
): # noqa: E501
|
|
raise ApiValueError(
|
|
"Invalid value for parameter `limit` when calling `list_uni_loan_records`, must be a value less than or equal to `100`"
|
|
) # noqa: E501
|
|
if (
|
|
self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1
|
|
): # noqa: E501
|
|
raise ApiValueError(
|
|
"Invalid value for parameter `limit` when calling `list_uni_loan_records`, must be a value greater than or equal to `1`"
|
|
) # noqa: E501
|
|
collection_formats = {}
|
|
|
|
path_params = {}
|
|
|
|
query_params = []
|
|
if 'type' in local_var_params and local_var_params['type'] is not None: # noqa: E501
|
|
query_params.append(('type', local_var_params['type'])) # noqa: E501
|
|
if 'currency' in local_var_params and local_var_params['currency'] is not None: # noqa: E501
|
|
query_params.append(('currency', local_var_params['currency'])) # noqa: E501
|
|
if 'currency_pair' in local_var_params and local_var_params['currency_pair'] is not None: # noqa: E501
|
|
query_params.append(('currency_pair', local_var_params['currency_pair'])) # noqa: E501
|
|
if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501
|
|
query_params.append(('page', local_var_params['page'])) # noqa: E501
|
|
if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501
|
|
query_params.append(('limit', local_var_params['limit'])) # noqa: E501
|
|
|
|
header_params = {}
|
|
|
|
form_params = []
|
|
local_var_files = {}
|
|
|
|
body_params = None
|
|
# HTTP header `Accept`
|
|
header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501
|
|
|
|
# Authentication setting
|
|
auth_settings = ['apiv4'] # noqa: E501
|
|
|
|
return self.api_client.call_api(
|
|
'/margin/uni/loan_records',
|
|
'GET',
|
|
path_params,
|
|
query_params,
|
|
header_params,
|
|
body=body_params,
|
|
post_params=form_params,
|
|
files=local_var_files,
|
|
response_type='list[UniLoanRecord]', # noqa: E501
|
|
auth_settings=auth_settings,
|
|
async_req=local_var_params.get('async_req'),
|
|
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
|
|
_preload_content=local_var_params.get('_preload_content', True),
|
|
_request_timeout=local_var_params.get('_request_timeout'),
|
|
collection_formats=collection_formats,
|
|
)
|
|
|
|
def list_uni_loan_interest_records(self, **kwargs): # noqa: E501
|
|
"""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_loan_interest_records(async_req=True)
|
|
>>> result = thread.get()
|
|
|
|
:param bool async_req: execute request asynchronously
|
|
:param str currency_pair: Currency pair
|
|
:param str currency: 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.UniLoanInterestRecord]
|
|
:return: If the method is called asynchronously,
|
|
returns the request thread.
|
|
"""
|
|
kwargs['_return_http_data_only'] = True
|
|
return self.list_uni_loan_interest_records_with_http_info(**kwargs) # noqa: E501
|
|
|
|
def list_uni_loan_interest_records_with_http_info(self, **kwargs): # noqa: E501
|
|
"""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_loan_interest_records_with_http_info(async_req=True)
|
|
>>> result = thread.get()
|
|
|
|
:param bool async_req: execute request asynchronously
|
|
:param str currency_pair: Currency pair
|
|
:param str currency: 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.UniLoanInterestRecord], status_code(int), headers(HTTPHeaderDict))
|
|
:return: If the method is called asynchronously,
|
|
returns the request thread.
|
|
"""
|
|
|
|
local_var_params = locals()
|
|
|
|
all_params = ['currency_pair', 'currency', 'page', 'limit']
|
|
all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout'])
|
|
|
|
for k, v in six.iteritems(local_var_params['kwargs']):
|
|
if k not in all_params:
|
|
raise ApiTypeError(
|
|
"Got an unexpected keyword argument '%s'" " to method list_uni_loan_interest_records" % k
|
|
)
|
|
local_var_params[k] = v
|
|
del local_var_params['kwargs']
|
|
|
|
if (
|
|
self.api_client.client_side_validation and 'page' in local_var_params and local_var_params['page'] < 1
|
|
): # noqa: E501
|
|
raise ApiValueError(
|
|
"Invalid value for parameter `page` when calling `list_uni_loan_interest_records`, must be a value greater than or equal to `1`"
|
|
) # noqa: E501
|
|
if (
|
|
self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 100
|
|
): # noqa: E501
|
|
raise ApiValueError(
|
|
"Invalid value for parameter `limit` when calling `list_uni_loan_interest_records`, must be a value less than or equal to `100`"
|
|
) # noqa: E501
|
|
if (
|
|
self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1
|
|
): # noqa: E501
|
|
raise ApiValueError(
|
|
"Invalid value for parameter `limit` when calling `list_uni_loan_interest_records`, must be a value greater than or equal to `1`"
|
|
) # noqa: E501
|
|
collection_formats = {}
|
|
|
|
path_params = {}
|
|
|
|
query_params = []
|
|
if 'currency_pair' in local_var_params and local_var_params['currency_pair'] is not None: # noqa: E501
|
|
query_params.append(('currency_pair', local_var_params['currency_pair'])) # noqa: E501
|
|
if 'currency' in local_var_params and local_var_params['currency'] is not None: # noqa: E501
|
|
query_params.append(('currency', local_var_params['currency'])) # noqa: E501
|
|
if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501
|
|
query_params.append(('page', local_var_params['page'])) # noqa: E501
|
|
if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501
|
|
query_params.append(('limit', local_var_params['limit'])) # noqa: E501
|
|
|
|
header_params = {}
|
|
|
|
form_params = []
|
|
local_var_files = {}
|
|
|
|
body_params = None
|
|
# HTTP header `Accept`
|
|
header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501
|
|
|
|
# Authentication setting
|
|
auth_settings = ['apiv4'] # noqa: E501
|
|
|
|
return self.api_client.call_api(
|
|
'/margin/uni/interest_records',
|
|
'GET',
|
|
path_params,
|
|
query_params,
|
|
header_params,
|
|
body=body_params,
|
|
post_params=form_params,
|
|
files=local_var_files,
|
|
response_type='list[UniLoanInterestRecord]', # noqa: E501
|
|
auth_settings=auth_settings,
|
|
async_req=local_var_params.get('async_req'),
|
|
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
|
|
_preload_content=local_var_params.get('_preload_content', True),
|
|
_request_timeout=local_var_params.get('_request_timeout'),
|
|
collection_formats=collection_formats,
|
|
)
|
|
|
|
def get_uni_borrowable(self, currency, currency_pair, **kwargs): # noqa: E501
|
|
"""Get maximum borrowable # noqa: E501
|
|
|
|
This method makes a synchronous HTTP request by default. To make an
|
|
asynchronous HTTP request, please pass async_req=True
|
|
>>> thread = api.get_uni_borrowable(currency, currency_pair, async_req=True)
|
|
>>> result = thread.get()
|
|
|
|
:param bool async_req: execute request asynchronously
|
|
:param str currency: Retrieve data of the specified currency (required)
|
|
:param str currency_pair: Currency pair (required)
|
|
:param _preload_content: if False, the urllib3.HTTPResponse object will
|
|
be returned without reading/decoding response
|
|
data. Default is True.
|
|
:param _request_timeout: timeout setting for this request. If one
|
|
number provided, it will be total request
|
|
timeout. It can also be a pair (tuple) of
|
|
(connection, read) timeouts.
|
|
:rtype: gate_api.MaxUniBorrowable
|
|
:return: If the method is called asynchronously,
|
|
returns the request thread.
|
|
"""
|
|
kwargs['_return_http_data_only'] = True
|
|
return self.get_uni_borrowable_with_http_info(currency, currency_pair, **kwargs) # noqa: E501
|
|
|
|
def get_uni_borrowable_with_http_info(self, currency, currency_pair, **kwargs): # noqa: E501
|
|
"""Get maximum borrowable # noqa: E501
|
|
|
|
This method makes a synchronous HTTP request by default. To make an
|
|
asynchronous HTTP request, please pass async_req=True
|
|
>>> thread = api.get_uni_borrowable_with_http_info(currency, currency_pair, async_req=True)
|
|
>>> result = thread.get()
|
|
|
|
:param bool async_req: execute request asynchronously
|
|
:param str currency: Retrieve data of the specified currency (required)
|
|
:param str currency_pair: Currency pair (required)
|
|
:param _return_http_data_only: response data without head status code
|
|
and headers
|
|
:param _preload_content: if False, the urllib3.HTTPResponse object will
|
|
be returned without reading/decoding response
|
|
data. Default is True.
|
|
:param _request_timeout: timeout setting for this request. If one
|
|
number provided, it will be total request
|
|
timeout. It can also be a pair (tuple) of
|
|
(connection, read) timeouts.
|
|
:rtype: tuple(gate_api.MaxUniBorrowable, status_code(int), headers(HTTPHeaderDict))
|
|
:return: If the method is called asynchronously,
|
|
returns the request thread.
|
|
"""
|
|
|
|
local_var_params = locals()
|
|
|
|
all_params = ['currency', 'currency_pair']
|
|
all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout'])
|
|
|
|
for k, v in six.iteritems(local_var_params['kwargs']):
|
|
if k not in all_params:
|
|
raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method get_uni_borrowable" % k)
|
|
local_var_params[k] = v
|
|
del local_var_params['kwargs']
|
|
# verify the required parameter 'currency' is set
|
|
if self.api_client.client_side_validation and (
|
|
'currency' not in local_var_params or local_var_params['currency'] is None # noqa: E501
|
|
): # noqa: E501
|
|
raise ApiValueError(
|
|
"Missing the required parameter `currency` when calling `get_uni_borrowable`"
|
|
) # noqa: E501
|
|
# verify the required parameter 'currency_pair' is set
|
|
if self.api_client.client_side_validation and (
|
|
'currency_pair' not in local_var_params or local_var_params['currency_pair'] is None # noqa: E501
|
|
): # noqa: E501
|
|
raise ApiValueError(
|
|
"Missing the required parameter `currency_pair` when calling `get_uni_borrowable`"
|
|
) # noqa: E501
|
|
|
|
collection_formats = {}
|
|
|
|
path_params = {}
|
|
|
|
query_params = []
|
|
if 'currency' in local_var_params and local_var_params['currency'] is not None: # noqa: E501
|
|
query_params.append(('currency', local_var_params['currency'])) # noqa: E501
|
|
if 'currency_pair' in local_var_params and local_var_params['currency_pair'] is not None: # noqa: E501
|
|
query_params.append(('currency_pair', local_var_params['currency_pair'])) # noqa: E501
|
|
|
|
header_params = {}
|
|
|
|
form_params = []
|
|
local_var_files = {}
|
|
|
|
body_params = None
|
|
# HTTP header `Accept`
|
|
header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501
|
|
|
|
# Authentication setting
|
|
auth_settings = ['apiv4'] # noqa: E501
|
|
|
|
return self.api_client.call_api(
|
|
'/margin/uni/borrowable',
|
|
'GET',
|
|
path_params,
|
|
query_params,
|
|
header_params,
|
|
body=body_params,
|
|
post_params=form_params,
|
|
files=local_var_files,
|
|
response_type='MaxUniBorrowable', # noqa: E501
|
|
auth_settings=auth_settings,
|
|
async_req=local_var_params.get('async_req'),
|
|
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
|
|
_preload_content=local_var_params.get('_preload_content', True),
|
|
_request_timeout=local_var_params.get('_request_timeout'),
|
|
collection_formats=collection_formats,
|
|
)
|