Skip to content

Commit c67f6fb

Browse files
committed
release 1.2.0
1 parent d7c2485 commit c67f6fb

27 files changed

Lines changed: 882 additions & 38 deletions

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ APIv4 futures provides all sorts of futures trading operations. There are public
33

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

6-
- API version: 1.1.0
7-
- Package version: 1.1.0
6+
- API version: 1.2.0
7+
- Package version: 1.2.0
88
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
99
For more information, please visit [https://gate.io/page/contacts](https://gate.io/page/contacts)
1010

@@ -78,8 +78,11 @@ Class | Method | HTTP request | Description
7878
*FuturesApi* | [**cancel_order**](docs/FuturesApi.md#cancel_order) | **DELETE** /futures/orders/{order_id} | Cancel a single order
7979
*FuturesApi* | [**cancel_orders**](docs/FuturesApi.md#cancel_orders) | **DELETE** /futures/orders | Cancel all `open` orders matched
8080
*FuturesApi* | [**create_order**](docs/FuturesApi.md#create_order) | **POST** /futures/orders | Create a futures order
81+
*FuturesApi* | [**get_futures_contract**](docs/FuturesApi.md#get_futures_contract) | **GET** /futures/contracts/{contract} | Get a single contract
8182
*FuturesApi* | [**get_my_trades**](docs/FuturesApi.md#get_my_trades) | **GET** /futures/my_trades | List personal trading history
8283
*FuturesApi* | [**get_order**](docs/FuturesApi.md#get_order) | **GET** /futures/orders/{order_id} | Get a single order
84+
*FuturesApi* | [**get_position**](docs/FuturesApi.md#get_position) | **GET** /futures/positions/{contract} | Get single position
85+
*FuturesApi* | [**list_futures_account_book**](docs/FuturesApi.md#list_futures_account_book) | **GET** /futures/account_book | Query account book
8386
*FuturesApi* | [**list_futures_accounts**](docs/FuturesApi.md#list_futures_accounts) | **GET** /futures/accounts | Query futures account
8487
*FuturesApi* | [**list_futures_candlesticks**](docs/FuturesApi.md#list_futures_candlesticks) | **GET** /futures/candlesticks | Get futures candlesticks
8588
*FuturesApi* | [**list_futures_contracts**](docs/FuturesApi.md#list_futures_contracts) | **GET** /futures/contracts | List all futures contracts
@@ -101,6 +104,7 @@ Class | Method | HTTP request | Description
101104
- [Contract](docs/Contract.md)
102105
- [FundingRateRecord](docs/FundingRateRecord.md)
103106
- [FuturesAccount](docs/FuturesAccount.md)
107+
- [FuturesAccountBook](docs/FuturesAccountBook.md)
104108
- [FuturesCandlestick](docs/FuturesCandlestick.md)
105109
- [FuturesOrder](docs/FuturesOrder.md)
106110
- [FuturesOrderBook](docs/FuturesOrderBook.md)

docs/Contract.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Name | Type | Description | Notes
3030
**trade_id** | **int** | Current trade ID | [optional]
3131
**trade_size** | **int** | Historical accumulation trade size | [optional]
3232
**position_size** | **int** | Current total long position size | [optional]
33+
**config_change_time** | **float** | Configuration's last changed time | [optional]
3334

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

docs/FuturesAccountBook.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# FuturesAccountBook
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**time** | **float** | Change time | [optional]
7+
**change** | **str** | Change amount | [optional]
8+
**balance** | **str** | Balance after change | [optional]
9+
**type** | **str** | Changing Type - dnw: Deposit & Withdraw - pnl: Profit & Loss by reducing position - fee: Trading fee - refr: Referrer rebate - fund: Funding | [optional]
10+
**text** | **str** | Comment | [optional]
11+
12+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
13+
14+

docs/FuturesApi.md

Lines changed: 153 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ Method | HTTP request | Description
77
[**cancel_order**](FuturesApi.md#cancel_order) | **DELETE** /futures/orders/{order_id} | Cancel a single order
88
[**cancel_orders**](FuturesApi.md#cancel_orders) | **DELETE** /futures/orders | Cancel all `open` orders matched
99
[**create_order**](FuturesApi.md#create_order) | **POST** /futures/orders | Create a futures order
10+
[**get_futures_contract**](FuturesApi.md#get_futures_contract) | **GET** /futures/contracts/{contract} | Get a single contract
1011
[**get_my_trades**](FuturesApi.md#get_my_trades) | **GET** /futures/my_trades | List personal trading history
1112
[**get_order**](FuturesApi.md#get_order) | **GET** /futures/orders/{order_id} | Get a single order
13+
[**get_position**](FuturesApi.md#get_position) | **GET** /futures/positions/{contract} | Get single position
14+
[**list_futures_account_book**](FuturesApi.md#list_futures_account_book) | **GET** /futures/account_book | Query account book
1215
[**list_futures_accounts**](FuturesApi.md#list_futures_accounts) | **GET** /futures/accounts | Query futures account
1316
[**list_futures_candlesticks**](FuturesApi.md#list_futures_candlesticks) | **GET** /futures/candlesticks | Get futures candlesticks
1417
[**list_futures_contracts**](FuturesApi.md#list_futures_contracts) | **GET** /futures/contracts | List all futures contracts
@@ -143,7 +146,7 @@ configuration.secret = 'YOUR_API_SECRET'
143146

144147
# create an instance of the API class
145148
api_instance = gate_api.FuturesApi(gate_api.ApiClient(configuration))
146-
futures_order = {"id":15675394,"user":100000,"contract":"BTC_USD","create_time":1546569968,"size":6024,"iceberg":0,"left":6024,"price":"3765","fill_price":"0","mkfr":"-0.00025","tkfr":"0.00075","tif":"gtc","refu":0,"is_reduce_only":false,"is_close":false,"is_liq":false,"text":"api","status":"finished","finish_time":1514764900,"finish_as":"cancelled"} # FuturesOrder |
149+
futures_order = gate_api.FuturesOrder() # FuturesOrder |
147150

148151
try:
149152
# Create a futures order
@@ -174,6 +177,51 @@ Authentication with API key and secret is required
174177

175178
[[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)
176179

180+
# **get_futures_contract**
181+
> Contract get_futures_contract(contract)
182+
183+
Get a single contract
184+
185+
### Example
186+
187+
```python
188+
from __future__ import print_function
189+
import gate_api
190+
from gate_api.rest import ApiException
191+
192+
# create an instance of the API class
193+
api_instance = gate_api.FuturesApi()
194+
contract = 'BTC_USD' # str | Futures contract
195+
196+
try:
197+
# Get a single contract
198+
api_response = api_instance.get_futures_contract(contract)
199+
print(api_response)
200+
except ApiException as e:
201+
print("Exception when calling FuturesApi->get_futures_contract: %s\n" % e)
202+
```
203+
204+
### Parameters
205+
206+
Name | Type | Description | Notes
207+
------------- | ------------- | ------------- | -------------
208+
**contract** | **str**| Futures contract |
209+
210+
### Return type
211+
212+
[**Contract**](Contract.md)
213+
214+
### Authorization
215+
216+
No authorization required
217+
218+
### HTTP request headers
219+
220+
- **Content-Type**: Not defined
221+
- **Accept**: application/json
222+
223+
[[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)
224+
177225
# **get_my_trades**
178226
> list[MyFuturesTrade] get_my_trades(contract=contract, order=order, limit=limit, last_id=last_id)
179227
@@ -278,6 +326,110 @@ Authentication with API key and secret is required
278326

279327
[[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)
280328

329+
# **get_position**
330+
> Position get_position(contract)
331+
332+
Get single position
333+
334+
### Example
335+
336+
```python
337+
from __future__ import print_function
338+
import gate_api
339+
from gate_api.rest import ApiException
340+
341+
configuration = gate_api.Configuration()
342+
configuration.key = 'YOUR_API_KEY'
343+
configuration.secret = 'YOUR_API_SECRET'
344+
345+
# create an instance of the API class
346+
api_instance = gate_api.FuturesApi(gate_api.ApiClient(configuration))
347+
contract = 'BTC_USD' # str | Futures contract
348+
349+
try:
350+
# Get single position
351+
api_response = api_instance.get_position(contract)
352+
print(api_response)
353+
except ApiException as e:
354+
print("Exception when calling FuturesApi->get_position: %s\n" % e)
355+
```
356+
357+
### Parameters
358+
359+
Name | Type | Description | Notes
360+
------------- | ------------- | ------------- | -------------
361+
**contract** | **str**| Futures contract |
362+
363+
### Return type
364+
365+
[**Position**](Position.md)
366+
367+
### Authorization
368+
369+
Authentication with API key and secret is required
370+
371+
### HTTP request headers
372+
373+
- **Content-Type**: Not defined
374+
- **Accept**: application/json
375+
376+
[[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)
377+
378+
# **list_futures_account_book**
379+
> list[FuturesAccountBook] list_futures_account_book(limit=limit, _from=_from, to=to, type=type)
380+
381+
Query account book
382+
383+
### Example
384+
385+
```python
386+
from __future__ import print_function
387+
import gate_api
388+
from gate_api.rest import ApiException
389+
390+
configuration = gate_api.Configuration()
391+
configuration.key = 'YOUR_API_KEY'
392+
configuration.secret = 'YOUR_API_SECRET'
393+
394+
# create an instance of the API class
395+
api_instance = gate_api.FuturesApi(gate_api.ApiClient(configuration))
396+
limit = 100 # int | Maximum number of record returned in one list (optional) (default to 100)
397+
_from = 1547706332 # int | Start timestamp (optional)
398+
to = 1547706332 # int | End timestamp (optional)
399+
type = 'type_example' # str | Changing Type - dnw: Deposit & Withdraw - pnl: Profit & Loss by reducing position - fee: Trading fee - refr: Referrer rebate - fund: Funding (optional)
400+
401+
try:
402+
# Query account book
403+
api_response = api_instance.list_futures_account_book(limit=limit, _from=_from, to=to, type=type)
404+
print(api_response)
405+
except ApiException as e:
406+
print("Exception when calling FuturesApi->list_futures_account_book: %s\n" % e)
407+
```
408+
409+
### Parameters
410+
411+
Name | Type | Description | Notes
412+
------------- | ------------- | ------------- | -------------
413+
**limit** | **int**| Maximum number of record returned in one list | [optional] [default to 100]
414+
**_from** | **int**| Start timestamp | [optional]
415+
**to** | **int**| End timestamp | [optional]
416+
**type** | **str**| Changing Type - dnw: Deposit & Withdraw - pnl: Profit & Loss by reducing position - fee: Trading fee - refr: Referrer rebate - fund: Funding | [optional]
417+
418+
### Return type
419+
420+
[**list[FuturesAccountBook]**](FuturesAccountBook.md)
421+
422+
### Authorization
423+
424+
Authentication with API key and secret is required
425+
426+
### HTTP request headers
427+
428+
- **Content-Type**: Not defined
429+
- **Accept**: application/json
430+
431+
[[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)
432+
281433
# **list_futures_accounts**
282434
> FuturesAccount list_futures_accounts()
283435

docs/FuturesOrder.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
66
**id** | **int** | Futures order ID | [optional]
7+
**user** | **int** | User ID | [optional]
78
**create_time** | **float** | Order creation time | [optional]
89
**finish_time** | **float** | Order finished time. Not returned if order is open | [optional]
9-
**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]
10+
**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]
1011
**status** | **str** | Order status - `open`: waiting to be traded - `finished`: finished | [optional]
1112
**contract** | **str** | Futures contract |
1213
**size** | **int** | Order size. Specify positive number to make a bid, and negative number to ask | [optional]
@@ -21,6 +22,9 @@ Name | Type | Description | Notes
2122
**left** | **int** | Size left to be traded | [optional]
2223
**fill_price** | **str** | Fill price of the order | [optional]
2324
**text** | **str** | How order is created - web: from web - api: from API - app: from mobile phones - auto_deleveraging: from ADL - liquidation: from liquidation - insurance: from insurance | [optional]
25+
**tkfr** | **str** | Taker fee | [optional]
26+
**mkfr** | **str** | Maker fee | [optional]
27+
**refu** | **str** | Reference user ID | [optional]
2428

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

gate_api/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
88
APIv4 futures provides all sorts of 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
99
10-
OpenAPI spec version: 1.1.0
10+
OpenAPI spec version: 1.2.0
1111
Contact: support@mail.gate.io
1212
Generated by: https://openapi-generator.tech
1313
"""
1414

1515

1616
from __future__ import absolute_import
1717

18-
__version__ = "1.1.0"
18+
__version__ = "1.2.0"
1919

2020
# import apis into sdk package
2121
from gate_api.api.futures_api import FuturesApi
@@ -27,6 +27,7 @@
2727
from gate_api.models.contract import Contract
2828
from gate_api.models.funding_rate_record import FundingRateRecord
2929
from gate_api.models.futures_account import FuturesAccount
30+
from gate_api.models.futures_account_book import FuturesAccountBook
3031
from gate_api.models.futures_candlestick import FuturesCandlestick
3132
from gate_api.models.futures_order import FuturesOrder
3233
from gate_api.models.futures_order_book import FuturesOrderBook

0 commit comments

Comments
 (0)