MCPcopy Create free account
hub / github.com/ccxt/ccxt / edit_order_ws

Method edit_order_ws

python/ccxt/pro/cex.py:1244–1281  ·  view source on GitHub ↗

edit a trade order https://docs.cex.io/#ws-api-cancel-replace :param str id: order id :param str symbol: unified symbol of the market to create an order in :param str type: 'market' or 'limit' :param str side: 'buy' or 'sell' :param float am

(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={})

Source from the content-addressed store, hash-verified

1242 return self.parse_order(rawOrder, market)
1243
1244 async def edit_order_ws(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={}) -> Order:
1245 """
1246 edit a trade order
1247
1248 https://docs.cex.io/#ws-api-cancel-replace
1249
1250 :param str id: order id
1251 :param str symbol: unified symbol of the market to create an order in
1252 :param str type: 'market' or 'limit'
1253 :param str side: 'buy' or 'sell'
1254 :param float amount: how much of the currency you want to trade in units of the base currency
1255 :param float|None [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
1256 :param dict [params]: extra parameters specific to the cex api endpoint
1257 :returns dict: an `order structure <https://docs.ccxt.com/en/latest/manual.html#order-structure>`
1258 """
1259 if amount is None:
1260 raise ArgumentsRequired(self.id + ' editOrder() requires a amount argument')
1261 if price is None:
1262 raise ArgumentsRequired(self.id + ' editOrder() requires a price argument')
1263 await self.load_markets()
1264 await self.authenticate()
1265 market = self.market(symbol)
1266 data = self.extend({
1267 'pair': [market['baseId'], market['quoteId']],
1268 'type': side,
1269 'amount': amount,
1270 'price': price,
1271 'order_id': id,
1272 }, params)
1273 messageHash = self.request_id()
1274 url = self.urls['api']['ws']
1275 request = {
1276 'e': 'cancel-replace-order',
1277 'oid': messageHash,
1278 'data': data,
1279 }
1280 response = await self.watch(url, messageHash, request, messageHash, messageHash)
1281 return self.parse_order(response, market)
1282
1283 async def cancel_order_ws(self, id: str, symbol: Str = None, params={}):
1284 """

Callers

nothing calls this directly

Calls 8

authenticateMethod · 0.95
request_idMethod · 0.95
parse_orderMethod · 0.95
ArgumentsRequiredClass · 0.90
load_marketsMethod · 0.45
marketMethod · 0.45
extendMethod · 0.45
watchMethod · 0.45

Tested by

no test coverage detected