Skip to content

Commit 9b54b2b

Browse files
committed
release 4.35.0
1 parent 2fafaa2 commit 9b54b2b

18 files changed

Lines changed: 471 additions & 75 deletions

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ APIv4 provides spot, margin and futures trading operations. There are public API
55

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

8-
- API version: 4.34.0
9-
- Package version: 4.34.0
8+
- API version: 4.35.0
9+
- Package version: 4.35.0
1010
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
1111
For more information, please visit [https://www.gate.io/page/contacts](https://www.gate.io/page/contacts)
1212

@@ -256,7 +256,7 @@ Class | Method | HTTP request | Description
256256
*SpotApi* | [**list_currencies**](docs/SpotApi.md#list_currencies) | **GET** /spot/currencies | List all currencies' details
257257
*SpotApi* | [**get_currency**](docs/SpotApi.md#get_currency) | **GET** /spot/currencies/{currency} | Get details of a specific currency
258258
*SpotApi* | [**list_currency_pairs**](docs/SpotApi.md#list_currency_pairs) | **GET** /spot/currency_pairs | List all currency pairs supported
259-
*SpotApi* | [**get_currency_pair**](docs/SpotApi.md#get_currency_pair) | **GET** /spot/currency_pairs/{currency_pair} | Get details of a specifc order
259+
*SpotApi* | [**get_currency_pair**](docs/SpotApi.md#get_currency_pair) | **GET** /spot/currency_pairs/{currency_pair} | Get details of a specifc currency pair
260260
*SpotApi* | [**list_tickers**](docs/SpotApi.md#list_tickers) | **GET** /spot/tickers | Retrieve ticker information
261261
*SpotApi* | [**list_order_book**](docs/SpotApi.md#list_order_book) | **GET** /spot/order_book | Retrieve order book
262262
*SpotApi* | [**list_trades**](docs/SpotApi.md#list_trades) | **GET** /spot/trades | Retrieve market trades
@@ -272,6 +272,7 @@ Class | Method | HTTP request | Description
272272
*SpotApi* | [**cancel_batch_orders**](docs/SpotApi.md#cancel_batch_orders) | **POST** /spot/cancel_batch_orders | Cancel a batch of orders with an ID list
273273
*SpotApi* | [**get_order**](docs/SpotApi.md#get_order) | **GET** /spot/orders/{order_id} | Get a single order
274274
*SpotApi* | [**cancel_order**](docs/SpotApi.md#cancel_order) | **DELETE** /spot/orders/{order_id} | Cancel a single order
275+
*SpotApi* | [**amend_order**](docs/SpotApi.md#amend_order) | **PATCH** /spot/orders/{order_id} | Amend an order
275276
*SpotApi* | [**list_my_trades**](docs/SpotApi.md#list_my_trades) | **GET** /spot/my_trades | List personal trading history
276277
*SpotApi* | [**get_system_time**](docs/SpotApi.md#get_system_time) | **GET** /spot/time | Get server current time
277278
*SpotApi* | [**countdown_cancel_all_spot**](docs/SpotApi.md#countdown_cancel_all_spot) | **POST** /spot/countdown_cancel_all | Countdown cancel orders
@@ -383,6 +384,7 @@ Class | Method | HTTP request | Description
383384
- [OptionsUnderlyingTicker](docs/OptionsUnderlyingTicker.md)
384385
- [Order](docs/Order.md)
385386
- [OrderBook](docs/OrderBook.md)
387+
- [OrderPatch](docs/OrderPatch.md)
386388
- [Position](docs/Position.md)
387389
- [PositionClose](docs/PositionClose.md)
388390
- [PositionCloseOrder](docs/PositionCloseOrder.md)

docs/BatchOrder.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Name | Type | Description | Notes
1515
**update_time_ms** | **int** | Last modification time of order (in milliseconds) | [optional] [readonly]
1616
**status** | **str** | Order status - `open`: to be filled - `closed`: filled - `cancelled`: cancelled | [optional] [readonly]
1717
**currency_pair** | **str** | Currency pair | [optional]
18-
**type** | **str** | Order type. limit - limit order | [optional] [default to 'limit']
18+
**type** | **str** | Order Type - limit : Limit Order - market : Market Order | [optional] [default to 'limit']
1919
**account** | **str** | Account type. spot - use spot account; margin - use margin account; cross_margin - use cross margin account | [optional] [default to 'spot']
2020
**side** | **str** | Order side | [optional]
2121
**amount** | **str** | Trade amount | [optional]

docs/CrossMarginAccount.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Name | Type | Description | Notes
1616
**total_initial_margin_rate** | **str** | Total initial margin rate | [optional]
1717
**total_maintenance_margin_rate** | **str** | Total maintenance margin rate | [optional]
1818
**total_available_margin** | **str** | Total available margin | [optional]
19+
**portfolio_margin_total** | **str** | Total amount of the portfolio margin account | [optional]
1920

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

docs/Order.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ Spot order details
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
77
**id** | **str** | Order ID | [optional] [readonly]
8-
**text** | **str** | User defined information. If not empty, must follow the rules below: 1. prefixed with `t-` 2. no longer than 28 bytes without `t-` prefix 3. can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) | [optional]
8+
**text** | **str** | User defined information. If not empty, must follow the rules below: 1. prefixed with `t-` 2. no longer than 28 bytes without `t-` prefix 3. can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) Besides user defined information, reserved contents are listed below, denoting how the order is created: - 101: from android - 102: from IOS - 103: from IPAD - 104: from webapp - 3: from web - 2: from apiv2 - apiv4: from apiv4 | [optional]
99
**create_time** | **str** | Creation time of order | [optional] [readonly]
1010
**update_time** | **str** | Last modification time of order | [optional] [readonly]
1111
**create_time_ms** | **int** | Creation time of order (in milliseconds) | [optional] [readonly]
1212
**update_time_ms** | **int** | Last modification time of order (in milliseconds) | [optional] [readonly]
1313
**status** | **str** | Order status - `open`: to be filled - `closed`: filled - `cancelled`: cancelled | [optional] [readonly]
1414
**currency_pair** | **str** | Currency pair |
15-
**type** | **str** | Order Type - limit : Limit Order - market : Market Order | [optional] [default to 'limit']
15+
**type** | **str** | Order Type - limit : Limit Order - market : Market Order | [optional] [default to 'limit']
1616
**account** | **str** | Account type. spot - use spot account; margin - use margin account; cross_margin - use cross margin account. Portfolio margin account must set to `cross-margin` | [optional] [default to 'spot']
1717
**side** | **str** | Order side |
1818
**amount** | **str** | When `type` is limit, it refers to base currency. For instance, `BTC_USDT` means `BTC` When `type` is `market`, it refers to different currency according to `side` - `side` : `buy` means quote currency, `BTC_USDT` means `USDT` - `side` : `sell` means base currency,`BTC_USDT` means `BTC` |
@@ -24,6 +24,7 @@ Name | Type | Description | Notes
2424
**left** | **str** | Amount left to fill | [optional] [readonly]
2525
**fill_price** | **str** | Total filled in quote currency. Deprecated in favor of `filled_total` | [optional] [readonly]
2626
**filled_total** | **str** | Total filled in quote currency | [optional] [readonly]
27+
**avg_deal_price** | **str** | Average fill price | [optional] [readonly]
2728
**fee** | **str** | Fee deducted | [optional] [readonly]
2829
**fee_currency** | **str** | Fee currency unit | [optional] [readonly]
2930
**point_fee** | **str** | Points used to deduct fee | [optional] [readonly]

docs/OrderPatch.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# OrderPatch
2+
3+
Spot order details
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**amount** | **str** | New order amount. `amount` and `price` must specify one of them | [optional]
8+
**price** | **str** | New order price. `amount` and `Price` must specify one of them\" | [optional]
9+
10+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
11+
12+

docs/SpotApi.md

Lines changed: 79 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Method | HTTP request | Description
77
[**list_currencies**](SpotApi.md#list_currencies) | **GET** /spot/currencies | List all currencies' details
88
[**get_currency**](SpotApi.md#get_currency) | **GET** /spot/currencies/{currency} | Get details of a specific currency
99
[**list_currency_pairs**](SpotApi.md#list_currency_pairs) | **GET** /spot/currency_pairs | List all currency pairs supported
10-
[**get_currency_pair**](SpotApi.md#get_currency_pair) | **GET** /spot/currency_pairs/{currency_pair} | Get details of a specifc order
10+
[**get_currency_pair**](SpotApi.md#get_currency_pair) | **GET** /spot/currency_pairs/{currency_pair} | Get details of a specifc currency pair
1111
[**list_tickers**](SpotApi.md#list_tickers) | **GET** /spot/tickers | Retrieve ticker information
1212
[**list_order_book**](SpotApi.md#list_order_book) | **GET** /spot/order_book | Retrieve order book
1313
[**list_trades**](SpotApi.md#list_trades) | **GET** /spot/trades | Retrieve market trades
@@ -23,6 +23,7 @@ Method | HTTP request | Description
2323
[**cancel_batch_orders**](SpotApi.md#cancel_batch_orders) | **POST** /spot/cancel_batch_orders | Cancel a batch of orders with an ID list
2424
[**get_order**](SpotApi.md#get_order) | **GET** /spot/orders/{order_id} | Get a single order
2525
[**cancel_order**](SpotApi.md#cancel_order) | **DELETE** /spot/orders/{order_id} | Cancel a single order
26+
[**amend_order**](SpotApi.md#amend_order) | **PATCH** /spot/orders/{order_id} | Amend an order
2627
[**list_my_trades**](SpotApi.md#list_my_trades) | **GET** /spot/my_trades | List personal trading history
2728
[**get_system_time**](SpotApi.md#get_system_time) | **GET** /spot/time | Get server current time
2829
[**countdown_cancel_all_spot**](SpotApi.md#countdown_cancel_all_spot) | **POST** /spot/countdown_cancel_all | Countdown cancel orders
@@ -204,7 +205,7 @@ No authorization required
204205
# **get_currency_pair**
205206
> CurrencyPair get_currency_pair(currency_pair)
206207
207-
Get details of a specifc order
208+
Get details of a specifc currency pair
208209

209210
### Example
210211

@@ -224,7 +225,7 @@ api_instance = gate_api.SpotApi(api_client)
224225
currency_pair = 'ETH_BTC' # str | Currency pair
225226

226227
try:
227-
# Get details of a specifc order
228+
# Get details of a specifc currency pair
228229
api_response = api_instance.get_currency_pair(currency_pair)
229230
print(api_response)
230231
except GateApiException as ex:
@@ -1314,6 +1315,81 @@ Name | Type | Description | Notes
13141315

13151316
[[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)
13161317

1318+
# **amend_order**
1319+
> Order amend_order(order_id, currency_pair, order_patch, account=account)
1320+
1321+
Amend an order
1322+
1323+
By default, the orders of spot and margin account are updated. If you need to modify orders of the `cross-margin` account, you must specify account as `cross_margin`. For portfolio margin account, only `cross_margin` account is supported. Currently, only supports modification of `price` or `amount` fields. Regarding rate limiting: modify order and create order sharing rate limiting rules. Regarding matching priority: only modifying the amount does not affect the priority. If the price is modified, the priority will be adjusted to the last of the new price. Note: If the modified amount is less than the fill amount, the order will be cancelled.
1324+
1325+
### Example
1326+
1327+
* Api Key Authentication (apiv4):
1328+
```python
1329+
from __future__ import print_function
1330+
import gate_api
1331+
from gate_api.exceptions import ApiException, GateApiException
1332+
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
1333+
# See configuration.py for a list of all supported configuration parameters.
1334+
# The client must configure the authentication and authorization parameters
1335+
# in accordance with the API server security policy.
1336+
# Examples for each auth method are provided below, use the example that
1337+
# satisfies your auth use case.
1338+
1339+
# Configure APIv4 key authorization
1340+
configuration = gate_api.Configuration(
1341+
host = "https://api.gateio.ws/api/v4",
1342+
key = "YOU_API_KEY",
1343+
secret = "YOUR_API_SECRET"
1344+
)
1345+
1346+
api_client = gate_api.ApiClient(configuration)
1347+
# Create an instance of the API class
1348+
api_instance = gate_api.SpotApi(api_client)
1349+
order_id = '12345' # str | Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 1 hour after the end of the order. After that, only order ID is accepted.
1350+
currency_pair = 'BTC_USDT' # str | Currency pair
1351+
order_patch = gate_api.OrderPatch() # OrderPatch |
1352+
account = 'cross_margin' # str | Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only (optional)
1353+
1354+
try:
1355+
# Amend an order
1356+
api_response = api_instance.amend_order(order_id, currency_pair, order_patch, account=account)
1357+
print(api_response)
1358+
except GateApiException as ex:
1359+
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
1360+
except ApiException as e:
1361+
print("Exception when calling SpotApi->amend_order: %s\n" % e)
1362+
```
1363+
1364+
### Parameters
1365+
1366+
Name | Type | Description | Notes
1367+
------------- | ------------- | ------------- | -------------
1368+
**order_id** | **str**| Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 1 hour after the end of the order. After that, only order ID is accepted. |
1369+
**currency_pair** | **str**| Currency pair |
1370+
**order_patch** | [**OrderPatch**](OrderPatch.md)| |
1371+
**account** | **str**| Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account. Portfolio margin account must set to `cross_margin` only | [optional]
1372+
1373+
### Return type
1374+
1375+
[**Order**](Order.md)
1376+
1377+
### Authorization
1378+
1379+
[apiv4](../README.md#apiv4)
1380+
1381+
### HTTP request headers
1382+
1383+
- **Content-Type**: application/json
1384+
- **Accept**: application/json
1385+
1386+
### HTTP response details
1387+
| Status code | Description | Response headers |
1388+
|-------------|-------------|------------------|
1389+
**200** | Updated | - |
1390+
1391+
[[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)
1392+
13171393
# **list_my_trades**
13181394
> list[Trade] list_my_trades(currency_pair=currency_pair, limit=limit, page=page, order_id=order_id, account=account, _from=_from, to=to)
13191395

docs/SubAccountApi.md

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ void (empty response body)
557557
[[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)
558558

559559
# **lock_sub_account**
560-
> lock_sub_account(user_id, body)
560+
> lock_sub_account(user_id)
561561
562562
Lock the sub-account
563563

@@ -586,11 +586,10 @@ api_client = gate_api.ApiClient(configuration)
586586
# Create an instance of the API class
587587
api_instance = gate_api.SubAccountApi(api_client)
588588
user_id = 56 # int | The user id of the sub-account
589-
body = None # object |
590589

591590
try:
592591
# Lock the sub-account
593-
api_instance.lock_sub_account(user_id, body)
592+
api_instance.lock_sub_account(user_id)
594593
except GateApiException as ex:
595594
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
596595
except ApiException as e:
@@ -602,7 +601,6 @@ except ApiException as e:
602601
Name | Type | Description | Notes
603602
------------- | ------------- | ------------- | -------------
604603
**user_id** | **int**| The user id of the sub-account |
605-
**body** | **object**| |
606604

607605
### Return type
608606

@@ -614,7 +612,7 @@ void (empty response body)
614612

615613
### HTTP request headers
616614

617-
- **Content-Type**: application/json
615+
- **Content-Type**: Not defined
618616
- **Accept**: Not defined
619617

620618
### HTTP response details
@@ -625,7 +623,7 @@ void (empty response body)
625623
[[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)
626624

627625
# **unlock_sub_account**
628-
> unlock_sub_account(user_id, body)
626+
> unlock_sub_account(user_id)
629627
630628
Unlock the sub-account
631629

@@ -654,11 +652,10 @@ api_client = gate_api.ApiClient(configuration)
654652
# Create an instance of the API class
655653
api_instance = gate_api.SubAccountApi(api_client)
656654
user_id = 56 # int | The user id of the sub-account
657-
body = None # object |
658655

659656
try:
660657
# Unlock the sub-account
661-
api_instance.unlock_sub_account(user_id, body)
658+
api_instance.unlock_sub_account(user_id)
662659
except GateApiException as ex:
663660
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
664661
except ApiException as e:
@@ -670,7 +667,6 @@ except ApiException as e:
670667
Name | Type | Description | Notes
671668
------------- | ------------- | ------------- | -------------
672669
**user_id** | **int**| The user id of the sub-account |
673-
**body** | **object**| |
674670

675671
### Return type
676672

@@ -682,7 +678,7 @@ void (empty response body)
682678

683679
### HTTP request headers
684680

685-
- **Content-Type**: application/json
681+
- **Content-Type**: Not defined
686682
- **Accept**: Not defined
687683

688684
### HTTP response details

gate_api/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
from __future__ import absolute_import
1616

17-
__version__ = "4.34.0"
17+
__version__ = "4.35.0"
1818

1919
# import apis into sdk package
2020
from gate_api.api.sub_account_api import SubAccountApi
@@ -118,6 +118,7 @@
118118
from gate_api.models.options_underlying_ticker import OptionsUnderlyingTicker
119119
from gate_api.models.order import Order
120120
from gate_api.models.order_book import OrderBook
121+
from gate_api.models.order_patch import OrderPatch
121122
from gate_api.models.position import Position
122123
from gate_api.models.position_close import PositionClose
123124
from gate_api.models.position_close_order import PositionCloseOrder

0 commit comments

Comments
 (0)