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

Method edit_order_ws

python/ccxt/pro/hyperliquid.py:125–161  ·  view source on GitHub ↗

edit a trade order https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#modify-multiple-orders :param str id: cancel order id :param str symbol: unified symbol of the market to create an order in :param str type: 'market' or

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

Source from the content-addressed store, hash-verified

123 return parsedOrder
124
125 async def edit_order_ws(self, id: str, symbol: str, type: str, side: str, amount: Num = None, price: Num = None, params={}):
126 """
127 edit a trade order
128
129 https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#modify-multiple-orders
130
131 :param str id: cancel order id
132 :param str symbol: unified symbol of the market to create an order in
133 :param str type: 'market' or 'limit'
134 :param str side: 'buy' or 'sell'
135 :param float amount: how much of currency you want to trade in units of base currency
136 :param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
137 :param dict [params]: extra parameters specific to the exchange API endpoint
138 :param str [params.timeInForce]: 'Gtc', 'Ioc', 'Alo'
139 :param bool [params.postOnly]: True or False whether the order is post-only
140 :param bool [params.reduceOnly]: True or False whether the order is reduce-only
141 :param float [params.triggerPrice]: The price at which a trigger order is triggered at
142 :param str [params.clientOrderId]: client order id,(optional 128 bit hex string e.g. 0x1234567890abcdef1234567890abcdef)
143 :param str [params.vaultAddress]: the vault address for order
144 :returns dict: an `order structure <https://docs.ccxt.com/?id=order-structure>`
145 """
146 await self.load_markets()
147 market = self.market(symbol)
148 url = self.urls['api']['ws']['public']
149 order, globalParams = self.parseCreateEditOrderArgs(id, symbol, type, side, amount, price, params)
150 postRequest = self.editOrdersRequest([order], globalParams)
151 wrapped = self.wrap_as_post_action(postRequest)
152 request = self.safe_dict(wrapped, 'request', {})
153 requestId = self.safe_string(wrapped, 'requestId')
154 response = await self.watch(url, requestId, request, requestId)
155 # response is the same self.edit_order
156 responseObject = self.safe_dict(response, 'response', {})
157 dataObject = self.safe_dict(responseObject, 'data', {})
158 statuses = self.safe_list(dataObject, 'statuses', [])
159 first = self.safe_dict(statuses, 0, {})
160 parsedOrder = self.parse_order(first, market)
161 return parsedOrder
162
163 async def cancel_orders_ws(self, ids: List[str], symbol: Str = None, params={}):
164 """

Callers

nothing calls this directly

Calls 10

marketMethod · 0.95
editOrdersRequestMethod · 0.95
wrap_as_post_actionMethod · 0.95
parse_orderMethod · 0.95
safe_dictMethod · 0.80
safe_stringMethod · 0.80
safe_listMethod · 0.80
load_marketsMethod · 0.45
watchMethod · 0.45

Tested by

no test coverage detected