crypto-com-sdk 0.0.66__py3-none-any.whl → 0.0.68__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: crypto-com-sdk
3
- Version: 0.0.66
3
+ Version: 0.0.68
4
4
  Summary: cryptocom crypto exchange api client
5
5
  Project-URL: Homepage, https://github.com/ccxt/ccxt
6
6
  Project-URL: Issues, https://github.com/ccxt/ccxt
@@ -162,12 +162,15 @@ You can also construct custom requests to available "implicit" endpoints
162
162
  - `close_position(self, symbol: str, side: OrderSide = None, params={})`
163
163
  - `custom_handle_margin_mode_and_params(self, methodName, params={})`
164
164
  - `describe(self)`
165
+ - `edit_order_request(self, id: str, symbol: str, amount: float, price: Num = None, params={})`
166
+ - `edit_order(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={})`
165
167
  - `nonce(self)`
166
168
  - `params_to_string(self, object, level)`
167
169
  - `withdraw(self, code: str, amount: float, address: str, tag=None, params={})`
168
170
 
169
171
  ### REST Raw
170
172
 
173
+ - `base_public_get_v1_public_get_announcements(request)`
171
174
  - `v1_public_get_public_auth(request)`
172
175
  - `v1_public_get_public_get_instruments(request)`
173
176
  - `v1_public_get_public_get_book(request)`
@@ -185,6 +188,7 @@ You can also construct custom requests to available "implicit" endpoints
185
188
  - `v1_private_post_private_user_balance_history(request)`
186
189
  - `v1_private_post_private_get_positions(request)`
187
190
  - `v1_private_post_private_create_order(request)`
191
+ - `v1_private_post_private_amend_order(request)`
188
192
  - `v1_private_post_private_create_order_list(request)`
189
193
  - `v1_private_post_private_cancel_order(request)`
190
194
  - `v1_private_post_private_cancel_order_list(request)`
@@ -312,6 +316,7 @@ You can also construct custom requests to available "implicit" endpoints
312
316
  - `load_positions_snapshot(self, client, messageHash)`
313
317
  - `watch_balance(self, params={})`
314
318
  - `create_order_ws(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={})`
319
+ - `edit_order_ws(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={})`
315
320
  - `cancel_order_ws(self, id: str, symbol: Str = None, params={})`
316
321
  - `cancel_all_orders_ws(self, symbol: Str = None, params={})`
317
322
  - `watch_public(self, messageHash, params={})`
@@ -1,11 +1,11 @@
1
1
  cryptocom/__init__.py,sha256=Ei5wz00g_3ERgN2Gsu1ZcccyL4tByDvfxR8qKkPxAgc,282
2
- cryptocom/ccxt/__init__.py,sha256=abWvxUHFmZfL_jxC_b8ImtBdv55Q--gCUDaLS7d9Ick,6054
3
- cryptocom/ccxt/cryptocom.py,sha256=XFAMUXE335fakbD3FB3Eaii9fwwTpGKhl8oNd8LNad0,145779
4
- cryptocom/ccxt/abstract/cryptocom.py,sha256=VdIfedBhx9Oym8fQ06c4Xmip7iT02hiVNBQA0E0rXU8,20915
5
- cryptocom/ccxt/async_support/__init__.py,sha256=NMcg1EUpi60YZ_REK6zOJ8i_QNKrk3Bysn9m4OM7t2g,4787
6
- cryptocom/ccxt/async_support/cryptocom.py,sha256=Yf_e0b9YbiuA-P21mISGUG8q1arflDzFYLT1yZVQfaw,146399
2
+ cryptocom/ccxt/__init__.py,sha256=c5pMHRQvCEf77FNMOn1zOcWF2NwEnD1nSfE2H9Ha5MI,6054
3
+ cryptocom/ccxt/cryptocom.py,sha256=5Kuy4PAwbvqixJ5Wsjjpauq60gZkOG6N0CWVsWGRNbQ,148573
4
+ cryptocom/ccxt/abstract/cryptocom.py,sha256=EiTT45sV8yZQ6bJc41OB5S05o0VfTsASiwgElIck78A,21243
5
+ cryptocom/ccxt/async_support/__init__.py,sha256=K2mfCyNgikRx30n_njDkO6gQhrVaTdP7wLhKnTAIzu0,4787
6
+ cryptocom/ccxt/async_support/cryptocom.py,sha256=Y_4Kvsq12KOutqAvCPopxvvabhadCNYRIhs_cKc1Se0,149211
7
7
  cryptocom/ccxt/async_support/base/__init__.py,sha256=aVYSsFi--b4InRs9zDN_wtCpj8odosAB726JdUHavrk,67
8
- cryptocom/ccxt/async_support/base/exchange.py,sha256=pPVR10gnuBSN2R_vwgfnsqrvTXv7H30sXdPFls3skCk,119007
8
+ cryptocom/ccxt/async_support/base/exchange.py,sha256=3qo41BpgIc0nGYI3Fka9-_Wodr_xbzh47eW0jAuMsUQ,119161
9
9
  cryptocom/ccxt/async_support/base/throttler.py,sha256=tvDVcdRUVYi8fZRlEcnqtgzcgB_KMUMRs5Pu8tuU-tU,1847
10
10
  cryptocom/ccxt/async_support/base/ws/__init__.py,sha256=uockzpLuwntKGZbs5EOWFe-Zg-k6Cj7GhNJLc_RX0so,1791
11
11
  cryptocom/ccxt/async_support/base/ws/aiohttp_client.py,sha256=Y5HxAVXyyYduj6b6SbbUZETlq3GrVMzrkW1r-TMgpb8,6329
@@ -18,11 +18,11 @@ cryptocom/ccxt/async_support/base/ws/order_book_side.py,sha256=GhnGUt78pJ-AYL_Dq
18
18
  cryptocom/ccxt/base/__init__.py,sha256=eTx1OE3HJjspFUQjGm6LBhaQiMKJnXjkdP-JUXknyQ0,1320
19
19
  cryptocom/ccxt/base/decimal_to_precision.py,sha256=fgWRBzRTtsf3r2INyS4f7WHlzgjB5YM1ekiwqD21aac,6634
20
20
  cryptocom/ccxt/base/errors.py,sha256=MvCrL_sAM3de616T6RE0PSxiF2xV6Qqz5b1y1ghidbk,4888
21
- cryptocom/ccxt/base/exchange.py,sha256=NGY9v0WAuFqoAPgiDPVR87xTwsjeKE78GxTz0TZe23Q,328149
21
+ cryptocom/ccxt/base/exchange.py,sha256=b6TLBQicsWseX5icZF9BC89wQfUaqN5IPBSEcNOq1SM,328431
22
22
  cryptocom/ccxt/base/precise.py,sha256=koce64Yrp6vFbGijJtUt-QQ6XhJgeGTCksZ871FPp_A,8886
23
23
  cryptocom/ccxt/base/types.py,sha256=IbLO7Ni-plO36xlOdJQFqujSJBq0q9qll009ShZ0M_U,11468
24
- cryptocom/ccxt/pro/__init__.py,sha256=9qZJ2snT71E3_Q9q4GEJHB3iomYdVRCr5TZqbkWc4aM,4219
25
- cryptocom/ccxt/pro/cryptocom.py,sha256=HxORVyDV1R0ILS-fl8ikRvF0D7pW9AqPaZNxVVeOTYI,60160
24
+ cryptocom/ccxt/pro/__init__.py,sha256=aVFm7sXw7s93yyTTIUktGaqUqTw4fqUsBEOwHNlVv4I,4101
25
+ cryptocom/ccxt/pro/cryptocom.py,sha256=ky8ltFg54HLxsA8vlNnahVCSnWdmn2pB8E3WjNxYUuM,61627
26
26
  cryptocom/ccxt/static_dependencies/README.md,sha256=3TCvhhn09_Cqf9BDDpao1V7EfKHDpQ6k9oWRsLFixpU,18
27
27
  cryptocom/ccxt/static_dependencies/__init__.py,sha256=tzFje8cloqmiIE6kola3EaYC0SnD1izWnri69hzHsSw,168
28
28
  cryptocom/ccxt/static_dependencies/ecdsa/__init__.py,sha256=Xaj0G79BLtBt2YZcOOMV8qOlQZ7fIJznNiHhiEEZfQA,594
@@ -282,6 +282,6 @@ cryptocom/ccxt/static_dependencies/toolz/curried/exceptions.py,sha256=gKFOHDIayA
282
282
  cryptocom/ccxt/static_dependencies/toolz/curried/operator.py,sha256=ML92mknkAwzBl2NCm-4werSUmJEtSHNY9NSzhseNM9s,525
283
283
  cryptocom/ccxt/static_dependencies/typing_inspect/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
284
284
  cryptocom/ccxt/static_dependencies/typing_inspect/typing_inspect.py,sha256=5gIWomLPfuDpgd3gX1GlnX0MuXM3VorR4j2W2qXORiQ,28269
285
- crypto_com_sdk-0.0.66.dist-info/METADATA,sha256=bSWERxjLzI29Fl7jES0OfGbCnna8FUzRXOf32x25AW8,14851
286
- crypto_com_sdk-0.0.66.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
287
- crypto_com_sdk-0.0.66.dist-info/RECORD,,
285
+ crypto_com_sdk-0.0.68.dist-info/METADATA,sha256=-w6dG8Kk1xLQPkazutpOoVjgGV22LokVE2yKJZHmzzk,15310
286
+ crypto_com_sdk-0.0.68.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
287
+ crypto_com_sdk-0.0.68.dist-info/RECORD,,
@@ -26,7 +26,7 @@ sys.modules['ccxt'] = ccxt_module
26
26
 
27
27
  # ----------------------------------------------------------------------------
28
28
 
29
- __version__ = '4.4.87'
29
+ __version__ = '4.4.90'
30
30
 
31
31
  # ----------------------------------------------------------------------------
32
32
 
@@ -2,6 +2,7 @@ from ccxt.base.types import Entry
2
2
 
3
3
 
4
4
  class ImplicitAPI:
5
+ base_public_get_v1_public_get_announcements = basePublicGetV1PublicGetAnnouncements = Entry('v1/public/get-announcements', ['base', 'public'], 'GET', {'cost': 1})
5
6
  v1_public_get_public_auth = v1PublicGetPublicAuth = Entry('public/auth', ['v1', 'public'], 'GET', {'cost': 3.3333333333333335})
6
7
  v1_public_get_public_get_instruments = v1PublicGetPublicGetInstruments = Entry('public/get-instruments', ['v1', 'public'], 'GET', {'cost': 3.3333333333333335})
7
8
  v1_public_get_public_get_book = v1PublicGetPublicGetBook = Entry('public/get-book', ['v1', 'public'], 'GET', {'cost': 1})
@@ -19,6 +20,7 @@ class ImplicitAPI:
19
20
  v1_private_post_private_user_balance_history = v1PrivatePostPrivateUserBalanceHistory = Entry('private/user-balance-history', ['v1', 'private'], 'POST', {'cost': 3.3333333333333335})
20
21
  v1_private_post_private_get_positions = v1PrivatePostPrivateGetPositions = Entry('private/get-positions', ['v1', 'private'], 'POST', {'cost': 3.3333333333333335})
21
22
  v1_private_post_private_create_order = v1PrivatePostPrivateCreateOrder = Entry('private/create-order', ['v1', 'private'], 'POST', {'cost': 0.6666666666666666})
23
+ v1_private_post_private_amend_order = v1PrivatePostPrivateAmendOrder = Entry('private/amend-order', ['v1', 'private'], 'POST', {'cost': 1.3333333333333333})
22
24
  v1_private_post_private_create_order_list = v1PrivatePostPrivateCreateOrderList = Entry('private/create-order-list', ['v1', 'private'], 'POST', {'cost': 3.3333333333333335})
23
25
  v1_private_post_private_cancel_order = v1PrivatePostPrivateCancelOrder = Entry('private/cancel-order', ['v1', 'private'], 'POST', {'cost': 0.6666666666666666})
24
26
  v1_private_post_private_cancel_order_list = v1PrivatePostPrivateCancelOrderList = Entry('private/cancel-order-list', ['v1', 'private'], 'POST', {'cost': 3.3333333333333335})
@@ -8,7 +8,7 @@ sys.modules['ccxt'] = ccxt_module
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
11
- __version__ = '4.4.87'
11
+ __version__ = '4.4.90'
12
12
 
13
13
  # -----------------------------------------------------------------------------
14
14
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  # -----------------------------------------------------------------------------
4
4
 
5
- __version__ = '4.4.87'
5
+ __version__ = '4.4.90'
6
6
 
7
7
  # -----------------------------------------------------------------------------
8
8
 
@@ -282,7 +282,10 @@ class Exchange(BaseExchange):
282
282
  currencies = None
283
283
  if self.has['fetchCurrencies'] is True:
284
284
  currencies = await self.fetch_currencies()
285
+ self.options['cachedCurrencies'] = currencies
285
286
  markets = await self.fetch_markets(params)
287
+ if 'cachedCurrencies' in self.options:
288
+ del self.options['cachedCurrencies']
286
289
  return self.set_markets(markets, currencies)
287
290
 
288
291
 
@@ -60,6 +60,7 @@ class cryptocom(Exchange, ImplicitAPI):
60
60
  'createOrders': True,
61
61
  'createStopOrder': True,
62
62
  'createTriggerOrder': True,
63
+ 'editOrder': True,
63
64
  'fetchAccounts': True,
64
65
  'fetchBalance': True,
65
66
  'fetchBidsAsks': False,
@@ -152,6 +153,7 @@ class cryptocom(Exchange, ImplicitAPI):
152
153
  'derivatives': 'https://uat-api.3ona.co/v2',
153
154
  },
154
155
  'api': {
156
+ 'base': 'https://api.crypto.com',
155
157
  'v1': 'https://api.crypto.com/exchange/v1',
156
158
  'v2': 'https://api.crypto.com/v2',
157
159
  'derivatives': 'https://deriv-api.crypto.com/v1',
@@ -169,6 +171,13 @@ class cryptocom(Exchange, ImplicitAPI):
169
171
  'fees': 'https://crypto.com/exchange/document/fees-limits',
170
172
  },
171
173
  'api': {
174
+ 'base': {
175
+ 'public': {
176
+ 'get': {
177
+ 'v1/public/get-announcements': 1, # no description of rate limit
178
+ },
179
+ },
180
+ },
172
181
  'v1': {
173
182
  'public': {
174
183
  'get': {
@@ -195,6 +204,7 @@ class cryptocom(Exchange, ImplicitAPI):
195
204
  'private/user-balance-history': 10 / 3,
196
205
  'private/get-positions': 10 / 3,
197
206
  'private/create-order': 2 / 3,
207
+ 'private/amend-order': 4 / 3, # no description of rate limit
198
208
  'private/create-order-list': 10 / 3,
199
209
  'private/cancel-order': 2 / 3,
200
210
  'private/cancel-order-list': 10 / 3,
@@ -1551,6 +1561,45 @@ class cryptocom(Exchange, ImplicitAPI):
1551
1561
  params = self.omit(params, ['postOnly', 'clientOrderId', 'timeInForce', 'stopPrice', 'triggerPrice', 'stopLossPrice', 'takeProfitPrice'])
1552
1562
  return self.extend(request, params)
1553
1563
 
1564
+ async def edit_order(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={}):
1565
+ """
1566
+ edit a trade order
1567
+
1568
+ https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#private-amend-order
1569
+
1570
+ :param str id: order id
1571
+ :param str symbol: unified market symbol of the order to edit
1572
+ :param str [type]: not used by cryptocom editOrder
1573
+ :param str [side]: not used by cryptocom editOrder
1574
+ :param float amount:(mandatory) how much of the currency you want to trade in units of the base currency
1575
+ :param float price:(mandatory) the price for the order, in units of the quote currency, ignored in market orders
1576
+ :param dict [params]: extra parameters specific to the exchange API endpoint
1577
+ :param str [params.clientOrderId]: the original client order id of the order to edit, required if id is not provided
1578
+ :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
1579
+ """
1580
+ await self.load_markets()
1581
+ request = self.edit_order_request(id, symbol, amount, price, params)
1582
+ response = await self.v1PrivatePostPrivateAmendOrder(request)
1583
+ result = self.safe_dict(response, 'result', {})
1584
+ return self.parse_order(result)
1585
+
1586
+ def edit_order_request(self, id: str, symbol: str, amount: float, price: Num = None, params={}):
1587
+ request: dict = {}
1588
+ if id is not None:
1589
+ request['order_id'] = id
1590
+ else:
1591
+ originalClientOrderId = self.safe_string_2(params, 'orig_client_oid', 'clientOrderId')
1592
+ if originalClientOrderId is None:
1593
+ raise ArgumentsRequired(self.id + ' editOrder() requires an id argument or orig_client_oid parameter')
1594
+ else:
1595
+ request['orig_client_oid'] = originalClientOrderId
1596
+ params = self.omit(params, ['orig_client_oid', 'clientOrderId'])
1597
+ if (amount is None) or (price is None):
1598
+ raise ArgumentsRequired(self.id + ' editOrder() requires both amount and price arguments. If you do not want to change the amount or price, you should pass the original values')
1599
+ request['new_quantity'] = self.amount_to_precision(symbol, amount)
1600
+ request['new_price'] = self.price_to_precision(symbol, price)
1601
+ return self.extend(request, params)
1602
+
1554
1603
  async def cancel_all_orders(self, symbol: Str = None, params={}):
1555
1604
  """
1556
1605
  cancel all open orders
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.4.87'
7
+ __version__ = '4.4.90'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
@@ -906,6 +906,10 @@ class Exchange(object):
906
906
  def keysort(dictionary):
907
907
  return collections.OrderedDict(sorted(dictionary.items(), key=lambda t: t[0]))
908
908
 
909
+ @staticmethod
910
+ def sort(array):
911
+ return sorted(array)
912
+
909
913
  @staticmethod
910
914
  def extend(*args):
911
915
  if args is not None:
@@ -956,6 +960,11 @@ class Exchange(object):
956
960
  def groupBy(array, key):
957
961
  return Exchange.group_by(array, key)
958
962
 
963
+
964
+ @staticmethod
965
+ def index_by_safe(array, key):
966
+ return Exchange.index_by(array, key) # wrapper for go
967
+
959
968
  @staticmethod
960
969
  def index_by(array, key):
961
970
  result = {}
@@ -1037,7 +1046,7 @@ class Exchange(object):
1037
1046
  return _urlencode.urlencode(result, quote_via=_urlencode.quote)
1038
1047
 
1039
1048
  @staticmethod
1040
- def rawencode(params={}):
1049
+ def rawencode(params={}, sort=False):
1041
1050
  return _urlencode.unquote(Exchange.urlencode(params))
1042
1051
 
1043
1052
  @staticmethod
@@ -1536,7 +1545,8 @@ class Exchange(object):
1536
1545
  currencies = self.fetch_currencies()
1537
1546
  self.options['cachedCurrencies'] = currencies
1538
1547
  markets = self.fetch_markets(params)
1539
- del self.options['cachedCurrencies']
1548
+ if 'cachedCurrencies' in self.options:
1549
+ del self.options['cachedCurrencies']
1540
1550
  return self.set_markets(markets, currencies)
1541
1551
 
1542
1552
  def fetch_markets(self, params={}):
@@ -3186,7 +3196,7 @@ class Exchange(object):
3186
3196
 
3187
3197
  def set_markets(self, markets, currencies=None):
3188
3198
  values = []
3189
- self.markets_by_id = {}
3199
+ self.markets_by_id = self.create_safe_dictionary()
3190
3200
  # handle marketId conflicts
3191
3201
  # we insert spot markets first
3192
3202
  marketValues = self.sort_by(self.to_array(markets), 'spot', True, True)
@@ -3261,7 +3271,7 @@ class Exchange(object):
3261
3271
  resultingCurrencies.append(highestPrecisionCurrency)
3262
3272
  sortedCurrencies = self.sort_by(resultingCurrencies, 'code')
3263
3273
  self.currencies = self.deep_extend(self.currencies, self.index_by(sortedCurrencies, 'code'))
3264
- self.currencies_by_id = self.index_by(self.currencies, 'id')
3274
+ self.currencies_by_id = self.index_by_safe(self.currencies, 'id')
3265
3275
  currenciesSortedByCode = self.keysort(self.currencies)
3266
3276
  self.codes = list(currenciesSortedByCode.keys())
3267
3277
  return self.markets
@@ -60,6 +60,7 @@ class cryptocom(Exchange, ImplicitAPI):
60
60
  'createOrders': True,
61
61
  'createStopOrder': True,
62
62
  'createTriggerOrder': True,
63
+ 'editOrder': True,
63
64
  'fetchAccounts': True,
64
65
  'fetchBalance': True,
65
66
  'fetchBidsAsks': False,
@@ -152,6 +153,7 @@ class cryptocom(Exchange, ImplicitAPI):
152
153
  'derivatives': 'https://uat-api.3ona.co/v2',
153
154
  },
154
155
  'api': {
156
+ 'base': 'https://api.crypto.com',
155
157
  'v1': 'https://api.crypto.com/exchange/v1',
156
158
  'v2': 'https://api.crypto.com/v2',
157
159
  'derivatives': 'https://deriv-api.crypto.com/v1',
@@ -169,6 +171,13 @@ class cryptocom(Exchange, ImplicitAPI):
169
171
  'fees': 'https://crypto.com/exchange/document/fees-limits',
170
172
  },
171
173
  'api': {
174
+ 'base': {
175
+ 'public': {
176
+ 'get': {
177
+ 'v1/public/get-announcements': 1, # no description of rate limit
178
+ },
179
+ },
180
+ },
172
181
  'v1': {
173
182
  'public': {
174
183
  'get': {
@@ -195,6 +204,7 @@ class cryptocom(Exchange, ImplicitAPI):
195
204
  'private/user-balance-history': 10 / 3,
196
205
  'private/get-positions': 10 / 3,
197
206
  'private/create-order': 2 / 3,
207
+ 'private/amend-order': 4 / 3, # no description of rate limit
198
208
  'private/create-order-list': 10 / 3,
199
209
  'private/cancel-order': 2 / 3,
200
210
  'private/cancel-order-list': 10 / 3,
@@ -1551,6 +1561,45 @@ class cryptocom(Exchange, ImplicitAPI):
1551
1561
  params = self.omit(params, ['postOnly', 'clientOrderId', 'timeInForce', 'stopPrice', 'triggerPrice', 'stopLossPrice', 'takeProfitPrice'])
1552
1562
  return self.extend(request, params)
1553
1563
 
1564
+ def edit_order(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={}):
1565
+ """
1566
+ edit a trade order
1567
+
1568
+ https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#private-amend-order
1569
+
1570
+ :param str id: order id
1571
+ :param str symbol: unified market symbol of the order to edit
1572
+ :param str [type]: not used by cryptocom editOrder
1573
+ :param str [side]: not used by cryptocom editOrder
1574
+ :param float amount:(mandatory) how much of the currency you want to trade in units of the base currency
1575
+ :param float price:(mandatory) the price for the order, in units of the quote currency, ignored in market orders
1576
+ :param dict [params]: extra parameters specific to the exchange API endpoint
1577
+ :param str [params.clientOrderId]: the original client order id of the order to edit, required if id is not provided
1578
+ :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
1579
+ """
1580
+ self.load_markets()
1581
+ request = self.edit_order_request(id, symbol, amount, price, params)
1582
+ response = self.v1PrivatePostPrivateAmendOrder(request)
1583
+ result = self.safe_dict(response, 'result', {})
1584
+ return self.parse_order(result)
1585
+
1586
+ def edit_order_request(self, id: str, symbol: str, amount: float, price: Num = None, params={}):
1587
+ request: dict = {}
1588
+ if id is not None:
1589
+ request['order_id'] = id
1590
+ else:
1591
+ originalClientOrderId = self.safe_string_2(params, 'orig_client_oid', 'clientOrderId')
1592
+ if originalClientOrderId is None:
1593
+ raise ArgumentsRequired(self.id + ' editOrder() requires an id argument or orig_client_oid parameter')
1594
+ else:
1595
+ request['orig_client_oid'] = originalClientOrderId
1596
+ params = self.omit(params, ['orig_client_oid', 'clientOrderId'])
1597
+ if (amount is None) or (price is None):
1598
+ raise ArgumentsRequired(self.id + ' editOrder() requires both amount and price arguments. If you do not want to change the amount or price, you should pass the original values')
1599
+ request['new_quantity'] = self.amount_to_precision(symbol, amount)
1600
+ request['new_price'] = self.price_to_precision(symbol, price)
1601
+ return self.extend(request, params)
1602
+
1554
1603
  def cancel_all_orders(self, symbol: Str = None, params={}):
1555
1604
  """
1556
1605
  cancel all open orders
@@ -8,7 +8,7 @@ sys.modules['ccxt'] = ccxt_module
8
8
 
9
9
  # ----------------------------------------------------------------------------
10
10
 
11
- __version__ = '4.4.87'
11
+ __version__ = '4.4.90'
12
12
 
13
13
  # ----------------------------------------------------------------------------
14
14
 
@@ -60,124 +60,6 @@ from ccxt.base.errors import UnsubscribeError # noqa: F4
60
60
  from ccxt.base.errors import error_hierarchy # noqa: F401
61
61
  # DO_NOT_REMOVE__ERROR_IMPORTS_END
62
62
 
63
-
64
-
65
-
66
-
67
-
68
-
69
-
70
-
71
-
72
-
73
-
74
-
75
-
76
-
77
-
78
-
79
-
80
-
81
-
82
-
83
-
84
-
85
-
86
-
87
-
88
-
89
-
90
-
91
-
92
-
93
-
94
-
95
-
96
-
97
-
98
-
99
-
100
-
101
-
102
-
103
-
104
-
105
-
106
-
107
-
108
-
109
-
110
-
111
-
112
-
113
-
114
-
115
-
116
-
117
-
118
-
119
-
120
-
121
-
122
-
123
-
124
-
125
-
126
-
127
-
128
-
129
-
130
-
131
-
132
-
133
-
134
-
135
-
136
-
137
-
138
-
139
-
140
-
141
-
142
-
143
-
144
-
145
-
146
-
147
-
148
-
149
-
150
-
151
-
152
-
153
-
154
-
155
-
156
-
157
-
158
-
159
-
160
-
161
-
162
-
163
-
164
-
165
-
166
-
167
-
168
-
169
-
170
-
171
-
172
-
173
-
174
-
175
-
176
-
177
-
178
-
179
-
180
-
181
63
  from ccxt.pro.cryptocom import cryptocom # noqa: F401
182
64
 
183
65
  exchanges = [ 'cryptocom',]
@@ -39,6 +39,7 @@ class cryptocom(cryptocomAsync):
39
39
  'createOrderWs': True,
40
40
  'cancelOrderWs': True,
41
41
  'cancelAllOrders': True,
42
+ 'editOrderWs': True,
42
43
  },
43
44
  'urls': {
44
45
  'api': {
@@ -1022,6 +1023,31 @@ class cryptocom(cryptocomAsync):
1022
1023
  messageHash = self.nonce()
1023
1024
  return await self.watch_private_request(messageHash, request)
1024
1025
 
1026
+ async def edit_order_ws(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={}) -> Order:
1027
+ """
1028
+ edit a trade order
1029
+
1030
+ https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#private-amend-order
1031
+
1032
+ :param str id: order id
1033
+ :param str symbol: unified market symbol of the order to edit
1034
+ :param str [type]: not used by cryptocom editOrder
1035
+ :param str [side]: not used by cryptocom editOrder
1036
+ :param float amount:(mandatory) how much of the currency you want to trade in units of the base currency
1037
+ :param float price:(mandatory) the price for the order, in units of the quote currency, ignored in market orders
1038
+ :param dict [params]: extra parameters specific to the exchange API endpoint
1039
+ :param str [params.clientOrderId]: the original client order id of the order to edit, required if id is not provided
1040
+ :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
1041
+ """
1042
+ await self.load_markets()
1043
+ params = self.edit_order_request(id, symbol, amount, price, params)
1044
+ request: dict = {
1045
+ 'method': 'private/amend-order',
1046
+ 'params': params,
1047
+ }
1048
+ messageHash = self.nonce()
1049
+ return await self.watch_private_request(messageHash, request)
1050
+
1025
1051
  def handle_order(self, client: Client, message):
1026
1052
  #
1027
1053
  # {
@@ -1261,6 +1287,7 @@ class cryptocom(cryptocomAsync):
1261
1287
  'public/heartbeat': self.handle_ping,
1262
1288
  'public/auth': self.handle_authenticate,
1263
1289
  'private/create-order': self.handle_order,
1290
+ 'private/amend-order': self.handle_order,
1264
1291
  'private/cancel-order': self.handle_order,
1265
1292
  'private/cancel-all-orders': self.handle_cancel_all_orders,
1266
1293
  'private/close-position': self.handle_order,