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

Method fetch_order

python/ccxt/kraken.py:2214–2277  ·  view source on GitHub ↗

fetches information on an order made by the user https://docs.kraken.com/rest/#tag/Account-Data/operation/getOrdersInfo :param str id: order id :param str symbol: not used by kraken fetchOrder :param dict [params]: extra parameters specific to the exchange

(self, id: str, symbol: Str = None, params={})

Source from the content-addressed store, hash-verified

2212 return self.parse_order(result, market)
2213
2214 def fetch_order(self, id: str, symbol: Str = None, params={}):
2215 """
2216 fetches information on an order made by the user
2217
2218 https://docs.kraken.com/rest/#tag/Account-Data/operation/getOrdersInfo
2219
2220 :param str id: order id
2221 :param str symbol: not used by kraken fetchOrder
2222 :param dict [params]: extra parameters specific to the exchange API endpoint
2223 :returns dict: An `order structure <https://docs.ccxt.com/?id=order-structure>`
2224 """
2225 self.load_markets()
2226 clientOrderId = self.safe_value_2(params, 'userref', 'clientOrderId')
2227 request = {
2228 'trades': True, # whether or not to include trades in output(optional, default False)
2229 'txid': id, # do not comma separate a list of ids - use fetchOrdersByIds instead
2230 # 'userref': 'optional', # restrict results to given user reference id(optional)
2231 }
2232 query = params
2233 if clientOrderId is not None:
2234 request['userref'] = clientOrderId
2235 query = self.omit(params, ['userref', 'clientOrderId'])
2236 response = self.privatePostQueryOrders(self.extend(request, query))
2237 #
2238 # {
2239 # "error":[],
2240 # "result":{
2241 # "OTLAS3-RRHUF-NDWH5A":{
2242 # "refid":null,
2243 # "userref":null,
2244 # "status":"closed",
2245 # "reason":null,
2246 # "opentm":1586822919.3342,
2247 # "closetm":1586822919.365,
2248 # "starttm":0,
2249 # "expiretm":0,
2250 # "descr":{
2251 # "pair":"XBTUSDT",
2252 # "type":"sell",
2253 # "ordertype":"market",
2254 # "price":"0",
2255 # "price2":"0",
2256 # "leverage":"none",
2257 # "order":"sell 0.21804000 XBTUSDT @ market",
2258 # "close":""
2259 # },
2260 # "vol":"0.21804000",
2261 # "vol_exec":"0.21804000",
2262 # "cost":"1493.9",
2263 # "fee":"3.8",
2264 # "price":"6851.5",
2265 # "stopprice":"0.00000",
2266 # "limitprice":"0.00000",
2267 # "misc":"",
2268 # "oflags":"fciq",
2269 # "trades":["TT5UC3-GOIRW-6AZZ6R"]
2270 # }
2271 # }

Callers

nothing calls this directly

Calls 8

load_marketsMethod · 0.95
parse_orderMethod · 0.95
OrderNotFoundClass · 0.90
safe_value_2Method · 0.80
safe_valueMethod · 0.80
omitMethod · 0.45
extendMethod · 0.45

Tested by

no test coverage detected