Skip to content

Commit 6f355d6

Browse files
committed
spot order supports gt fee discount and POC
1 parent 6bea15d commit 6f355d6

11 files changed

Lines changed: 239 additions & 30 deletions

File tree

README.md

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

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

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

docs/BatchOrder.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,17 @@ Name | Type | Description | Notes
1717
**side** | **str** | Order side | [optional]
1818
**amount** | **str** | Trade amount | [optional]
1919
**price** | **str** | Order price | [optional]
20-
**time_in_force** | **str** | Time in force | [optional] [default to 'gtc']
21-
**auto_borrow** | **bool** | Used in margin trading(e.g. `account` is `margin`) to allow automatic loan of lacked part if balance is not enough. | [optional]
20+
**time_in_force** | **str** | Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, reduce only | [optional] [default to 'gtc']
21+
**auto_borrow** | **bool** | Used in margin trading(e.g. `account` is `margin`) to allow automatic loan of insufficient part if balance is not enough. | [optional]
2222
**left** | **str** | Amount left to fill | [optional]
2323
**fill_price** | **str** | Fill price of the order | [optional]
2424
**fee** | **str** | Fee deducted | [optional]
2525
**fee_currency** | **str** | Fee currency unit | [optional]
2626
**point_fee** | **str** | Point used to deduct fee | [optional]
2727
**gt_fee** | **str** | GT used to deduct fee | [optional]
28+
**gt_discount** | **bool** | Whether GT fee discount is used | [optional]
29+
**rebated_fee** | **str** | Rebated fee | [optional]
30+
**rebated_fee_currency** | **str** | Rebated fee currency unit | [optional]
2831

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

docs/CurrencyPair.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Name | Type | Description | Notes
1111
**min_quote_amount** | **str** | Minimum amount of quote currency to trade, `null` means no limit | [optional]
1212
**amount_precision** | **int** | Amount scale | [optional]
1313
**precision** | **int** | Price scale | [optional]
14+
**trade_status** | **str** | How currency pair can be traded - untradable: cannot be bought or sold - buyable: can be bought - sellable: can be sold - tradable: can be bought or sold | [optional]
1415

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

docs/Order.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,17 @@ Name | Type | Description | Notes
1414
**side** | **str** | Order side |
1515
**amount** | **str** | Trade amount |
1616
**price** | **str** | Order price |
17-
**time_in_force** | **str** | Time in force | [optional] [default to 'gtc']
18-
**auto_borrow** | **bool** | Used in margin trading(e.g. `account` is `margin`) to allow automatic loan of lacked part if balance is not enough. | [optional]
17+
**time_in_force** | **str** | Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, reduce only | [optional] [default to 'gtc']
18+
**auto_borrow** | **bool** | Used in margin trading(e.g. `account` is `margin`) to allow automatic loan of insufficient part if balance is not enough. | [optional]
1919
**left** | **str** | Amount left to fill | [optional]
2020
**fill_price** | **str** | Total filled in quote currency | [optional]
2121
**fee** | **str** | Fee deducted | [optional]
2222
**fee_currency** | **str** | Fee currency unit | [optional]
2323
**point_fee** | **str** | Point used to deduct fee | [optional]
2424
**gt_fee** | **str** | GT used to deduct fee | [optional]
25+
**gt_discount** | **bool** | Whether GT fee discount is used | [optional]
26+
**rebated_fee** | **str** | Rebated fee | [optional]
27+
**rebated_fee_currency** | **str** | Rebated fee currency unit | [optional]
2528

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

gate_api/__init__.py

Lines changed: 1 addition & 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.10.0"
17+
__version__ = "4.11.0"
1818

1919
# import apis into sdk package
2020
from gate_api.api.futures_api import FuturesApi

gate_api/api_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None,
7575
self.default_headers[header_name] = header_value
7676
self.cookie = cookie
7777
# Set default User-Agent.
78-
self.user_agent = 'OpenAPI-Generator/4.10.0/python'
78+
self.user_agent = 'OpenAPI-Generator/4.11.0/python'
7979

8080
def __del__(self):
8181
if self._pool:

gate_api/configuration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,6 @@ def to_debug_report(self):
248248
return "Python SDK Debug Report:\n"\
249249
"OS: {env}\n"\
250250
"Python Version: {pyversion}\n"\
251-
"Version of the API: 4.10.0\n"\
252-
"SDK Package Version: 4.10.0".\
251+
"Version of the API: 4.11.0\n"\
252+
"SDK Package Version: 4.11.0".\
253253
format(env=sys.platform, pyversion=sys.version)

gate_api/models/batch_order.py

Lines changed: 92 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ class BatchOrder(object):
5252
'fee': 'str',
5353
'fee_currency': 'str',
5454
'point_fee': 'str',
55-
'gt_fee': 'str'
55+
'gt_fee': 'str',
56+
'gt_discount': 'bool',
57+
'rebated_fee': 'str',
58+
'rebated_fee_currency': 'str'
5659
}
5760

5861
attribute_map = {
@@ -77,10 +80,13 @@ class BatchOrder(object):
7780
'fee': 'fee',
7881
'fee_currency': 'fee_currency',
7982
'point_fee': 'point_fee',
80-
'gt_fee': 'gt_fee'
83+
'gt_fee': 'gt_fee',
84+
'gt_discount': 'gt_discount',
85+
'rebated_fee': 'rebated_fee',
86+
'rebated_fee_currency': 'rebated_fee_currency'
8187
}
8288

83-
def __init__(self, text=None, succeeded=None, label=None, message=None, id=None, create_time=None, update_time=None, status=None, currency_pair=None, type='limit', account='spot', side=None, amount=None, price=None, time_in_force='gtc', auto_borrow=None, left=None, fill_price=None, fee=None, fee_currency=None, point_fee=None, gt_fee=None): # noqa: E501
89+
def __init__(self, text=None, succeeded=None, label=None, message=None, id=None, create_time=None, update_time=None, status=None, currency_pair=None, type='limit', account='spot', side=None, amount=None, price=None, time_in_force='gtc', auto_borrow=None, left=None, fill_price=None, fee=None, fee_currency=None, point_fee=None, gt_fee=None, gt_discount=None, rebated_fee=None, rebated_fee_currency=None): # noqa: E501
8490
"""BatchOrder - a model defined in OpenAPI""" # noqa: E501
8591

8692
self._text = None
@@ -105,6 +111,9 @@ def __init__(self, text=None, succeeded=None, label=None, message=None, id=None,
105111
self._fee_currency = None
106112
self._point_fee = None
107113
self._gt_fee = None
114+
self._gt_discount = None
115+
self._rebated_fee = None
116+
self._rebated_fee_currency = None
108117
self.discriminator = None
109118

110119
if text is not None:
@@ -151,6 +160,12 @@ def __init__(self, text=None, succeeded=None, label=None, message=None, id=None,
151160
self.point_fee = point_fee
152161
if gt_fee is not None:
153162
self.gt_fee = gt_fee
163+
if gt_discount is not None:
164+
self.gt_discount = gt_discount
165+
if rebated_fee is not None:
166+
self.rebated_fee = rebated_fee
167+
if rebated_fee_currency is not None:
168+
self.rebated_fee_currency = rebated_fee_currency
154169

155170
@property
156171
def text(self):
@@ -502,7 +517,7 @@ def price(self, price):
502517
def time_in_force(self):
503518
"""Gets the time_in_force of this BatchOrder. # noqa: E501
504519
505-
Time in force # noqa: E501
520+
Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, reduce only # noqa: E501
506521
507522
:return: The time_in_force of this BatchOrder. # noqa: E501
508523
:rtype: str
@@ -513,12 +528,12 @@ def time_in_force(self):
513528
def time_in_force(self, time_in_force):
514529
"""Sets the time_in_force of this BatchOrder.
515530
516-
Time in force # noqa: E501
531+
Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, reduce only # noqa: E501
517532
518533
:param time_in_force: The time_in_force of this BatchOrder. # noqa: E501
519534
:type: str
520535
"""
521-
allowed_values = ["gtc", "ioc"] # noqa: E501
536+
allowed_values = ["gtc", "ioc", "poc"] # noqa: E501
522537
if time_in_force not in allowed_values:
523538
raise ValueError(
524539
"Invalid value for `time_in_force` ({0}), must be one of {1}" # noqa: E501
@@ -531,7 +546,7 @@ def time_in_force(self, time_in_force):
531546
def auto_borrow(self):
532547
"""Gets the auto_borrow of this BatchOrder. # noqa: E501
533548
534-
Used in margin trading(e.g. `account` is `margin`) to allow automatic loan of lacked part if balance is not enough. # noqa: E501
549+
Used in margin trading(e.g. `account` is `margin`) to allow automatic loan of insufficient part if balance is not enough. # noqa: E501
535550
536551
:return: The auto_borrow of this BatchOrder. # noqa: E501
537552
:rtype: bool
@@ -542,7 +557,7 @@ def auto_borrow(self):
542557
def auto_borrow(self, auto_borrow):
543558
"""Sets the auto_borrow of this BatchOrder.
544559
545-
Used in margin trading(e.g. `account` is `margin`) to allow automatic loan of lacked part if balance is not enough. # noqa: E501
560+
Used in margin trading(e.g. `account` is `margin`) to allow automatic loan of insufficient part if balance is not enough. # noqa: E501
546561
547562
:param auto_borrow: The auto_borrow of this BatchOrder. # noqa: E501
548563
:type: bool
@@ -688,6 +703,75 @@ def gt_fee(self, gt_fee):
688703

689704
self._gt_fee = gt_fee
690705

706+
@property
707+
def gt_discount(self):
708+
"""Gets the gt_discount of this BatchOrder. # noqa: E501
709+
710+
Whether GT fee discount is used # noqa: E501
711+
712+
:return: The gt_discount of this BatchOrder. # noqa: E501
713+
:rtype: bool
714+
"""
715+
return self._gt_discount
716+
717+
@gt_discount.setter
718+
def gt_discount(self, gt_discount):
719+
"""Sets the gt_discount of this BatchOrder.
720+
721+
Whether GT fee discount is used # noqa: E501
722+
723+
:param gt_discount: The gt_discount of this BatchOrder. # noqa: E501
724+
:type: bool
725+
"""
726+
727+
self._gt_discount = gt_discount
728+
729+
@property
730+
def rebated_fee(self):
731+
"""Gets the rebated_fee of this BatchOrder. # noqa: E501
732+
733+
Rebated fee # noqa: E501
734+
735+
:return: The rebated_fee of this BatchOrder. # noqa: E501
736+
:rtype: str
737+
"""
738+
return self._rebated_fee
739+
740+
@rebated_fee.setter
741+
def rebated_fee(self, rebated_fee):
742+
"""Sets the rebated_fee of this BatchOrder.
743+
744+
Rebated fee # noqa: E501
745+
746+
:param rebated_fee: The rebated_fee of this BatchOrder. # noqa: E501
747+
:type: str
748+
"""
749+
750+
self._rebated_fee = rebated_fee
751+
752+
@property
753+
def rebated_fee_currency(self):
754+
"""Gets the rebated_fee_currency of this BatchOrder. # noqa: E501
755+
756+
Rebated fee currency unit # noqa: E501
757+
758+
:return: The rebated_fee_currency of this BatchOrder. # noqa: E501
759+
:rtype: str
760+
"""
761+
return self._rebated_fee_currency
762+
763+
@rebated_fee_currency.setter
764+
def rebated_fee_currency(self, rebated_fee_currency):
765+
"""Sets the rebated_fee_currency of this BatchOrder.
766+
767+
Rebated fee currency unit # noqa: E501
768+
769+
:param rebated_fee_currency: The rebated_fee_currency of this BatchOrder. # noqa: E501
770+
:type: str
771+
"""
772+
773+
self._rebated_fee_currency = rebated_fee_currency
774+
691775
def to_dict(self):
692776
"""Returns the model properties as a dict"""
693777
result = {}

gate_api/models/currency_pair.py

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ class CurrencyPair(object):
3838
'min_base_amount': 'str',
3939
'min_quote_amount': 'str',
4040
'amount_precision': 'int',
41-
'precision': 'int'
41+
'precision': 'int',
42+
'trade_status': 'str'
4243
}
4344

4445
attribute_map = {
@@ -49,10 +50,11 @@ class CurrencyPair(object):
4950
'min_base_amount': 'min_base_amount',
5051
'min_quote_amount': 'min_quote_amount',
5152
'amount_precision': 'amount_precision',
52-
'precision': 'precision'
53+
'precision': 'precision',
54+
'trade_status': 'trade_status'
5355
}
5456

55-
def __init__(self, id=None, base=None, quote=None, fee=None, min_base_amount=None, min_quote_amount=None, amount_precision=None, precision=None): # noqa: E501
57+
def __init__(self, id=None, base=None, quote=None, fee=None, min_base_amount=None, min_quote_amount=None, amount_precision=None, precision=None, trade_status=None): # noqa: E501
5658
"""CurrencyPair - a model defined in OpenAPI""" # noqa: E501
5759

5860
self._id = None
@@ -63,6 +65,7 @@ def __init__(self, id=None, base=None, quote=None, fee=None, min_base_amount=Non
6365
self._min_quote_amount = None
6466
self._amount_precision = None
6567
self._precision = None
68+
self._trade_status = None
6669
self.discriminator = None
6770

6871
if id is not None:
@@ -81,6 +84,8 @@ def __init__(self, id=None, base=None, quote=None, fee=None, min_base_amount=Non
8184
self.amount_precision = amount_precision
8285
if precision is not None:
8386
self.precision = precision
87+
if trade_status is not None:
88+
self.trade_status = trade_status
8489

8590
@property
8691
def id(self):
@@ -266,6 +271,35 @@ def precision(self, precision):
266271

267272
self._precision = precision
268273

274+
@property
275+
def trade_status(self):
276+
"""Gets the trade_status of this CurrencyPair. # noqa: E501
277+
278+
How currency pair can be traded - untradable: cannot be bought or sold - buyable: can be bought - sellable: can be sold - tradable: can be bought or sold # noqa: E501
279+
280+
:return: The trade_status of this CurrencyPair. # noqa: E501
281+
:rtype: str
282+
"""
283+
return self._trade_status
284+
285+
@trade_status.setter
286+
def trade_status(self, trade_status):
287+
"""Sets the trade_status of this CurrencyPair.
288+
289+
How currency pair can be traded - untradable: cannot be bought or sold - buyable: can be bought - sellable: can be sold - tradable: can be bought or sold # noqa: E501
290+
291+
:param trade_status: The trade_status of this CurrencyPair. # noqa: E501
292+
:type: str
293+
"""
294+
allowed_values = ["untradable", "buyable", "sellable", "tradable"] # noqa: E501
295+
if trade_status not in allowed_values:
296+
raise ValueError(
297+
"Invalid value for `trade_status` ({0}), must be one of {1}" # noqa: E501
298+
.format(trade_status, allowed_values)
299+
)
300+
301+
self._trade_status = trade_status
302+
269303
def to_dict(self):
270304
"""Returns the model properties as a dict"""
271305
result = {}

0 commit comments

Comments
 (0)