Skip to content

Commit

Permalink
Merge branch 'release/4.15.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
revilwang committed Aug 14, 2020
2 parents 5376c69 + 0037310 commit 2899d9d
Show file tree
Hide file tree
Showing 18 changed files with 390 additions and 111 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
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.15.2
- Package version: 4.15.2
- API version: 4.15.3
- Package version: 4.15.3
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
For more information, please visit [https://www.gate.io/page/contacts](https://www.gate.io/page/contacts)

Expand Down Expand Up @@ -73,7 +73,7 @@ Please follow the [installation procedure](#installation--usage) and then run th
from __future__ import print_function

import gate_api
from gate_api.exceptions import ApiException
from gate_api.exceptions import ApiException, GateApiException

# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
Expand All @@ -91,6 +91,8 @@ try:
# List all futures contracts
api_response = api_instance.list_delivery_contracts(settle)
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling DeliveryApi->list_delivery_contracts: %s\n" % e)

Expand Down
1 change: 1 addition & 0 deletions docs/Contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Name | Type | Description | Notes
**position_size** | **int** | Current total long position size | [optional]
**config_change_time** | **float** | Configuration's last changed time | [optional]
**in_delisting** | **bool** | Contract is delisting | [optional]
**orders_limit** | **int** | Maximum number of open orders | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
112 changes: 84 additions & 28 deletions docs/DeliveryApi.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/DeliveryContract.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Name | Type | Description | Notes
**position_size** | **int** | Current total long position size | [optional]
**config_change_time** | **float** | Configuration's last changed time | [optional]
**in_delisting** | **bool** | Contract is delisting | [optional]
**orders_limit** | **int** | Maximum number of open orders | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
112 changes: 84 additions & 28 deletions docs/FuturesApi.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/FuturesOrder.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Name | Type | Description | Notes
**finish_as** | **str** | How the order is finished. - filled: all filled - cancelled: manually cancelled - liquidated: cancelled because of liquidation - ioc: time in force is `IOC`, finish immediately - auto_deleveraged: finished by ADL - reduce_only: cancelled because of increasing position while `reduce-only` set | [optional] [readonly]
**status** | **str** | Order status - `open`: waiting to be traded - `finished`: finished | [optional] [readonly]
**contract** | **str** | Futures contract |
**size** | **int** | Order size. Specify positive number to make a bid, and negative number to ask | [optional]
**size** | **int** | Order size. Specify positive number to make a bid, and negative number to ask |
**iceberg** | **int** | Display size for iceberg order. 0 for non-iceberg. Note that you would pay the taker fee for the hidden size | [optional]
**price** | **str** | Order price. 0 for market order with `tif` set as `ioc` | [optional]
**close** | **bool** | Set as `true` to close the position, with `size` set to 0 | [optional] [default to False]
Expand Down
64 changes: 48 additions & 16 deletions docs/MarginApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ List all supported currency pairs supported in margin trading
```python
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
configuration = gate_api.Configuration(
Expand All @@ -47,6 +47,8 @@ try:
# List all supported currency pairs supported in margin trading
api_response = api_instance.list_margin_currency_pairs()
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling MarginApi->list_margin_currency_pairs: %s\n" % e)
```
Expand Down Expand Up @@ -84,7 +86,7 @@ Order book of lending loans
```python
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
configuration = gate_api.Configuration(
Expand All @@ -100,6 +102,8 @@ try:
# Order book of lending loans
api_response = api_instance.list_funding_book(currency)
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling MarginApi->list_funding_book: %s\n" % e)
```
Expand Down Expand Up @@ -141,7 +145,7 @@ Margin account list
```python
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
# The client must configure the authentication and authorization parameters
Expand All @@ -165,6 +169,8 @@ try:
# Margin account list
api_response = api_instance.list_margin_accounts(currency_pair=currency_pair)
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling MarginApi->list_margin_accounts: %s\n" % e)
```
Expand Down Expand Up @@ -208,7 +214,7 @@ Only transferring from or to margin account are provided for now. Time range all
```python
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
# The client must configure the authentication and authorization parameters
Expand Down Expand Up @@ -237,6 +243,8 @@ try:
# List margin account balance change history
api_response = api_instance.list_margin_account_book(currency=currency, currency_pair=currency_pair, _from=_from, to=to, page=page, limit=limit)
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling MarginApi->list_margin_account_book: %s\n" % e)
```
Expand Down Expand Up @@ -283,7 +291,7 @@ Funding account list
```python
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
# The client must configure the authentication and authorization parameters
Expand All @@ -307,6 +315,8 @@ try:
# Funding account list
api_response = api_instance.list_funding_accounts(currency=currency)
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling MarginApi->list_funding_accounts: %s\n" % e)
```
Expand Down Expand Up @@ -348,7 +358,7 @@ List all loans
```python
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
# The client must configure the authentication and authorization parameters
Expand Down Expand Up @@ -379,6 +389,8 @@ try:
# List all loans
api_response = api_instance.list_loans(status, side, currency=currency, currency_pair=currency_pair, sort_by=sort_by, reverse_sort=reverse_sort, page=page, limit=limit)
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling MarginApi->list_loans: %s\n" % e)
```
Expand Down Expand Up @@ -427,7 +439,7 @@ Lend or borrow
```python
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
# The client must configure the authentication and authorization parameters
Expand All @@ -451,6 +463,8 @@ try:
# Lend or borrow
api_response = api_instance.create_loan(loan)
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling MarginApi->create_loan: %s\n" % e)
```
Expand Down Expand Up @@ -492,7 +506,7 @@ Merge multiple lending loans
```python
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
# The client must configure the authentication and authorization parameters
Expand All @@ -517,6 +531,8 @@ try:
# Merge multiple lending loans
api_response = api_instance.merge_loans(currency, ids)
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling MarginApi->merge_loans: %s\n" % e)
```
Expand Down Expand Up @@ -559,7 +575,7 @@ Retrieve one single loan detail
```python
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
# The client must configure the authentication and authorization parameters
Expand All @@ -584,6 +600,8 @@ try:
# Retrieve one single loan detail
api_response = api_instance.get_loan(loan_id, side)
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling MarginApi->get_loan: %s\n" % e)
```
Expand Down Expand Up @@ -628,7 +646,7 @@ Only lending loans can be cancelled
```python
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
# The client must configure the authentication and authorization parameters
Expand All @@ -653,6 +671,8 @@ try:
# Cancel lending loan
api_response = api_instance.cancel_loan(loan_id, currency)
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling MarginApi->cancel_loan: %s\n" % e)
```
Expand Down Expand Up @@ -697,7 +717,7 @@ Only `auto_renew` modification is supported currently
```python
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
# The client must configure the authentication and authorization parameters
Expand All @@ -722,6 +742,8 @@ try:
# Modify a loan
api_response = api_instance.update_loan(loan_id, loan_patch)
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling MarginApi->update_loan: %s\n" % e)
```
Expand Down Expand Up @@ -764,7 +786,7 @@ List loan repayment records
```python
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
# The client must configure the authentication and authorization parameters
Expand All @@ -788,6 +810,8 @@ try:
# List loan repayment records
api_response = api_instance.list_loan_repayments(loan_id)
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling MarginApi->list_loan_repayments: %s\n" % e)
```
Expand Down Expand Up @@ -829,7 +853,7 @@ Repay a loan
```python
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
# The client must configure the authentication and authorization parameters
Expand All @@ -854,6 +878,8 @@ try:
# Repay a loan
api_response = api_instance.repay_loan(loan_id, repay_request)
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling MarginApi->repay_loan: %s\n" % e)
```
Expand Down Expand Up @@ -896,7 +922,7 @@ List repayment records of specified loan
```python
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
# The client must configure the authentication and authorization parameters
Expand All @@ -923,6 +949,8 @@ try:
# List repayment records of specified loan
api_response = api_instance.list_loan_records(loan_id, status=status, page=page, limit=limit)
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling MarginApi->list_loan_records: %s\n" % e)
```
Expand Down Expand Up @@ -967,7 +995,7 @@ Get one single loan record
```python
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
# The client must configure the authentication and authorization parameters
Expand All @@ -992,6 +1020,8 @@ try:
# Get one single loan record
api_response = api_instance.get_loan_record(loan_record_id, loan_id)
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling MarginApi->get_loan_record: %s\n" % e)
```
Expand Down Expand Up @@ -1036,7 +1066,7 @@ Only `auto_renew` modification is supported currently
```python
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
# The client must configure the authentication and authorization parameters
Expand All @@ -1061,6 +1091,8 @@ try:
# Modify a loan record
api_response = api_instance.update_loan_record(loan_record_id, loan_patch)
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling MarginApi->update_loan_record: %s\n" % e)
```
Expand Down
Loading

0 comments on commit 2899d9d

Please sign in to comment.