Skip to content

Commit

Permalink
set currency_pair spot order book as required
Browse files Browse the repository at this point in the history
  • Loading branch information
revilwang committed Mar 14, 2019
1 parent 89ff3d4 commit add7067
Show file tree
Hide file tree
Showing 48 changed files with 81 additions and 77 deletions.
8 changes: 4 additions & 4 deletions README.md
Expand Up @@ -3,8 +3,8 @@ APIv4 provides spot, margin and futures trading operations. There are public API

This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: 4.5.1
- Package version: 4.5.1
- API version: 4.5.2
- Package version: 4.5.2
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
For more information, please visit [https://gate.io/page/contacts](https://gate.io/page/contacts)

Expand All @@ -18,9 +18,9 @@ Python 2.7 and 3.4+
If the python package is hosted on Github, you can install directly from Github

```sh
pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
pip install git+https://github.com/gateio/gateapi-python.git
```
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`)
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/gateio/gateapi-python.git`)

Then import the package:
```python
Expand Down
20 changes: 10 additions & 10 deletions docs/MarginApi.md
Expand Up @@ -41,7 +41,7 @@ configuration.secret = 'YOUR_API_SECRET'

# create an instance of the API class
api_instance = gate_api.MarginApi(gate_api.ApiClient(configuration))
loan_id = 'loan_id_example' # str | Loan ID
loan_id = '12345' # str | Loan ID
currency = 'BTC' # str | Retrieved specified currency related data

try:
Expand Down Expand Up @@ -141,7 +141,7 @@ configuration.secret = 'YOUR_API_SECRET'

# create an instance of the API class
api_instance = gate_api.MarginApi(gate_api.ApiClient(configuration))
loan_id = 'loan_id_example' # str | Loan ID
loan_id = '12345' # str | Loan ID
side = 'lend' # str | Lend or borrow

try:
Expand Down Expand Up @@ -192,8 +192,8 @@ configuration.secret = 'YOUR_API_SECRET'

# create an instance of the API class
api_instance = gate_api.MarginApi(gate_api.ApiClient(configuration))
loan_record_id = 'loan_record_id_example' # str | Loan record ID
loan_id = 'loan_id_example' # str | Loan ID
loan_record_id = '12345' # str | Loan record ID
loan_id = '12345' # str | Loan ID

try:
# Get one single loan record
Expand Down Expand Up @@ -337,8 +337,8 @@ configuration.secret = 'YOUR_API_SECRET'

# create an instance of the API class
api_instance = gate_api.MarginApi(gate_api.ApiClient(configuration))
loan_id = 'loan_id_example' # str | Loan ID
status = 'status_example' # str | Loan record status (optional)
loan_id = '12345' # str | Loan ID
status = 'loaned' # str | Loan record status (optional)
page = 1 # int | Page number (optional) (default to 1)
limit = 100 # int | Maximum number of record returned in one list (optional) (default to 100)

Expand Down Expand Up @@ -392,7 +392,7 @@ configuration.secret = 'YOUR_API_SECRET'

# create an instance of the API class
api_instance = gate_api.MarginApi(gate_api.ApiClient(configuration))
loan_id = 'loan_id_example' # str | Loan ID
loan_id = '12345' # str | Loan ID

try:
# List loan repayment records
Expand Down Expand Up @@ -639,7 +639,7 @@ configuration.secret = 'YOUR_API_SECRET'

# create an instance of the API class
api_instance = gate_api.MarginApi(gate_api.ApiClient(configuration))
loan_id = 'loan_id_example' # str | Loan ID
loan_id = '12345' # str | Loan ID
repay_request = gate_api.RepayRequest() # RepayRequest |

try:
Expand Down Expand Up @@ -692,7 +692,7 @@ configuration.secret = 'YOUR_API_SECRET'

# create an instance of the API class
api_instance = gate_api.MarginApi(gate_api.ApiClient(configuration))
loan_id = 'loan_id_example' # str | Loan ID
loan_id = '12345' # str | Loan ID
loan_patch = gate_api.LoanPatch() # LoanPatch |

try:
Expand Down Expand Up @@ -745,7 +745,7 @@ configuration.secret = 'YOUR_API_SECRET'

# create an instance of the API class
api_instance = gate_api.MarginApi(gate_api.ApiClient(configuration))
loan_record_id = 'loan_record_id_example' # str | Loan record ID
loan_record_id = '12345' # str | Loan record ID
loan_patch = gate_api.LoanPatch() # LoanPatch |

try:
Expand Down
8 changes: 4 additions & 4 deletions docs/SpotApi.md
Expand Up @@ -416,7 +416,7 @@ Authentication with API key and secret is required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **list_order_book**
> OrderBook list_order_book(currency_pair=currency_pair, interval=interval, limit=limit)
> OrderBook list_order_book(currency_pair, interval=interval, limit=limit)
Retrieve order book

Expand All @@ -431,13 +431,13 @@ from gate_api.rest import ApiException

# create an instance of the API class
api_instance = gate_api.SpotApi()
currency_pair = 'BTC_USDT' # str | Currency pair (optional)
currency_pair = 'BTC_USDT' # str | Currency pair
interval = '0' # str | Price precision of order book. 0 means no aggregation is applied (optional) (default to '0')
limit = 10 # int | Maximum number of order depth data in asks or bids (optional) (default to 10)

try:
# Retrieve order book
api_response = api_instance.list_order_book(currency_pair=currency_pair, interval=interval, limit=limit)
api_response = api_instance.list_order_book(currency_pair, interval=interval, limit=limit)
print(api_response)
except ApiException as e:
print("Exception when calling SpotApi->list_order_book: %s\n" % e)
Expand All @@ -447,7 +447,7 @@ except ApiException as e:

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**currency_pair** | **str**| Currency pair | [optional]
**currency_pair** | **str**| Currency pair |
**interval** | **str**| Price precision of order book. 0 means no aggregation is applied | [optional] [default to '0']
**limit** | **int**| Maximum number of order depth data in asks or bids | [optional] [default to 10]

Expand Down
4 changes: 2 additions & 2 deletions gate_api/__init__.py
Expand Up @@ -7,15 +7,15 @@
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
OpenAPI spec version: 4.5.1
OpenAPI spec version: 4.5.2
Contact: support@mail.gate.io
Generated by: https://openapi-generator.tech
"""


from __future__ import absolute_import

__version__ = "4.5.1"
__version__ = "4.5.2"

# import apis into sdk package
from gate_api.api.futures_api import FuturesApi
Expand Down
2 changes: 1 addition & 1 deletion gate_api/api/futures_api.py
Expand Up @@ -5,7 +5,7 @@
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
OpenAPI spec version: 4.5.1
OpenAPI spec version: 4.5.2
Contact: support@mail.gate.io
Generated by: https://openapi-generator.tech
"""
Expand Down
2 changes: 1 addition & 1 deletion gate_api/api/margin_api.py
Expand Up @@ -5,7 +5,7 @@
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
OpenAPI spec version: 4.5.1
OpenAPI spec version: 4.5.2
Contact: support@mail.gate.io
Generated by: https://openapi-generator.tech
"""
Expand Down
22 changes: 13 additions & 9 deletions gate_api/api/spot_api.py
Expand Up @@ -5,7 +5,7 @@
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
OpenAPI spec version: 4.5.1
OpenAPI spec version: 4.5.2
Contact: support@mail.gate.io
Generated by: https://openapi-generator.tech
"""
Expand Down Expand Up @@ -837,17 +837,17 @@ def list_my_trades_with_http_info(self, currency_pair, **kwargs): # noqa: E501
_request_timeout=local_var_params.get('_request_timeout'),
collection_formats=collection_formats)

def list_order_book(self, **kwargs): # noqa: E501
def list_order_book(self, currency_pair, **kwargs): # noqa: E501
"""Retrieve order book # noqa: E501
Order book will be sorted by price from high to low on bids; reversed on asks # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.list_order_book(async_req=True)
>>> thread = api.list_order_book(currency_pair, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str currency_pair: Currency pair
:param str currency_pair: Currency pair (required)
:param str interval: Price precision of order book. 0 means no aggregation is applied
:param int limit: Maximum number of order depth data in asks or bids
:return: OrderBook
Expand All @@ -856,22 +856,22 @@ def list_order_book(self, **kwargs): # noqa: E501
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.list_order_book_with_http_info(**kwargs) # noqa: E501
return self.list_order_book_with_http_info(currency_pair, **kwargs) # noqa: E501
else:
(data) = self.list_order_book_with_http_info(**kwargs) # noqa: E501
(data) = self.list_order_book_with_http_info(currency_pair, **kwargs) # noqa: E501
return data

def list_order_book_with_http_info(self, **kwargs): # noqa: E501
def list_order_book_with_http_info(self, currency_pair, **kwargs): # noqa: E501
"""Retrieve order book # noqa: E501
Order book will be sorted by price from high to low on bids; reversed on asks # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.list_order_book_with_http_info(async_req=True)
>>> thread = api.list_order_book_with_http_info(currency_pair, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str currency_pair: Currency pair
:param str currency_pair: Currency pair (required)
:param str interval: Price precision of order book. 0 means no aggregation is applied
:param int limit: Maximum number of order depth data in asks or bids
:return: OrderBook
Expand All @@ -895,6 +895,10 @@ def list_order_book_with_http_info(self, **kwargs): # noqa: E501
)
local_var_params[key] = val
del local_var_params['kwargs']
# verify the required parameter 'currency_pair' is set
if ('currency_pair' not in local_var_params or
local_var_params['currency_pair'] is None):
raise ValueError("Missing the required parameter `currency_pair` when calling `list_order_book`") # noqa: E501

if 'limit' in local_var_params and local_var_params['limit'] > 30: # noqa: E501
raise ValueError("Invalid value for parameter `limit` when calling `list_order_book`, must be a value less than or equal to `30`") # noqa: E501
Expand Down
4 changes: 2 additions & 2 deletions gate_api/api_client.py
Expand Up @@ -4,7 +4,7 @@
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
OpenAPI spec version: 4.5.1
OpenAPI spec version: 4.5.2
Contact: support@mail.gate.io
Generated by: https://openapi-generator.tech
"""
Expand Down Expand Up @@ -76,7 +76,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None,
self.default_headers[header_name] = header_value
self.cookie = cookie
# Set default User-Agent.
self.user_agent = 'OpenAPI-Generator/4.5.1/python'
self.user_agent = 'OpenAPI-Generator/4.5.2/python'

def __del__(self):
if self._pool:
Expand Down
6 changes: 3 additions & 3 deletions gate_api/configuration.py
Expand Up @@ -5,7 +5,7 @@
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
OpenAPI spec version: 4.5.1
OpenAPI spec version: 4.5.2
Contact: support@mail.gate.io
Generated by: https://openapi-generator.tech
"""
Expand Down Expand Up @@ -249,6 +249,6 @@ def to_debug_report(self):
return "Python SDK Debug Report:\n"\
"OS: {env}\n"\
"Python Version: {pyversion}\n"\
"Version of the API: 4.5.1\n"\
"SDK Package Version: 4.5.1".\
"Version of the API: 4.5.2\n"\
"SDK Package Version: 4.5.2".\
format(env=sys.platform, pyversion=sys.version)
2 changes: 1 addition & 1 deletion gate_api/models/__init__.py
Expand Up @@ -6,7 +6,7 @@
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
OpenAPI spec version: 4.5.1
OpenAPI spec version: 4.5.2
Contact: support@mail.gate.io
Generated by: https://openapi-generator.tech
"""
Expand Down
2 changes: 1 addition & 1 deletion gate_api/models/contract.py
Expand Up @@ -5,7 +5,7 @@
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
OpenAPI spec version: 4.5.1
OpenAPI spec version: 4.5.2
Contact: support@mail.gate.io
Generated by: https://openapi-generator.tech
"""
Expand Down
2 changes: 1 addition & 1 deletion gate_api/models/currency_pair.py
Expand Up @@ -5,7 +5,7 @@
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
OpenAPI spec version: 4.5.1
OpenAPI spec version: 4.5.2
Contact: support@mail.gate.io
Generated by: https://openapi-generator.tech
"""
Expand Down
2 changes: 1 addition & 1 deletion gate_api/models/funding_account.py
Expand Up @@ -5,7 +5,7 @@
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
OpenAPI spec version: 4.5.1
OpenAPI spec version: 4.5.2
Contact: support@mail.gate.io
Generated by: https://openapi-generator.tech
"""
Expand Down
2 changes: 1 addition & 1 deletion gate_api/models/funding_book_item.py
Expand Up @@ -5,7 +5,7 @@
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
OpenAPI spec version: 4.5.1
OpenAPI spec version: 4.5.2
Contact: support@mail.gate.io
Generated by: https://openapi-generator.tech
"""
Expand Down
2 changes: 1 addition & 1 deletion gate_api/models/funding_rate_record.py
Expand Up @@ -5,7 +5,7 @@
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
OpenAPI spec version: 4.5.1
OpenAPI spec version: 4.5.2
Contact: support@mail.gate.io
Generated by: https://openapi-generator.tech
"""
Expand Down
2 changes: 1 addition & 1 deletion gate_api/models/futures_account.py
Expand Up @@ -5,7 +5,7 @@
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
OpenAPI spec version: 4.5.1
OpenAPI spec version: 4.5.2
Contact: support@mail.gate.io
Generated by: https://openapi-generator.tech
"""
Expand Down
2 changes: 1 addition & 1 deletion gate_api/models/futures_account_book.py
Expand Up @@ -5,7 +5,7 @@
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
OpenAPI spec version: 4.5.1
OpenAPI spec version: 4.5.2
Contact: support@mail.gate.io
Generated by: https://openapi-generator.tech
"""
Expand Down
2 changes: 1 addition & 1 deletion gate_api/models/futures_candlestick.py
Expand Up @@ -5,7 +5,7 @@
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
OpenAPI spec version: 4.5.1
OpenAPI spec version: 4.5.2
Contact: support@mail.gate.io
Generated by: https://openapi-generator.tech
"""
Expand Down
2 changes: 1 addition & 1 deletion gate_api/models/futures_initial_order.py
Expand Up @@ -5,7 +5,7 @@
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
OpenAPI spec version: 4.5.1
OpenAPI spec version: 4.5.2
Contact: support@mail.gate.io
Generated by: https://openapi-generator.tech
"""
Expand Down
2 changes: 1 addition & 1 deletion gate_api/models/futures_order.py
Expand Up @@ -5,7 +5,7 @@
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
OpenAPI spec version: 4.5.1
OpenAPI spec version: 4.5.2
Contact: support@mail.gate.io
Generated by: https://openapi-generator.tech
"""
Expand Down
2 changes: 1 addition & 1 deletion gate_api/models/futures_order_book.py
Expand Up @@ -5,7 +5,7 @@
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
OpenAPI spec version: 4.5.1
OpenAPI spec version: 4.5.2
Contact: support@mail.gate.io
Generated by: https://openapi-generator.tech
"""
Expand Down
2 changes: 1 addition & 1 deletion gate_api/models/futures_order_book_item.py
Expand Up @@ -5,7 +5,7 @@
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
OpenAPI spec version: 4.5.1
OpenAPI spec version: 4.5.2
Contact: support@mail.gate.io
Generated by: https://openapi-generator.tech
"""
Expand Down
2 changes: 1 addition & 1 deletion gate_api/models/futures_price_trigger.py
Expand Up @@ -5,7 +5,7 @@
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
OpenAPI spec version: 4.5.1
OpenAPI spec version: 4.5.2
Contact: support@mail.gate.io
Generated by: https://openapi-generator.tech
"""
Expand Down

0 comments on commit add7067

Please sign in to comment.