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

Method fetch_order

python/ccxt/grvt.py:2691–2774  ·  view source on GitHub ↗

fetches information on an order made by the user https://api-docs.grvt.io/trading_api/#get-order :param str id: the order id :param str symbol: unified symbol of the market the order was made in :param dict [params]: extra parameters specific to the exchang

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

Source from the content-addressed store, hash-verified

2689 return self.parse_orders(result, None, since, limit)
2690
2691 def fetch_order(self, id: str, symbol: Str = None, params={}):
2692 """
2693 fetches information on an order made by the user
2694
2695 https://api-docs.grvt.io/trading_api/#get-order
2696
2697 :param str id: the order id
2698 :param str symbol: unified symbol of the market the order was made in
2699 :param dict [params]: extra parameters specific to the exchange API endpoint
2700 :param str [params.clientOrderId]: client order id
2701 :returns dict: An `order structure <https://docs.ccxt.com/?id=order-structure>`
2702 """
2703 self.load_markets_and_sign_in()
2704 subAccountId = self.get_sub_account_id(params)
2705 request = {
2706 'sub_account_id': subAccountId,
2707 }
2708 clientOrderId = self.safe_string_2(params, 'clientOrderId', 'client_order_id')
2709 if clientOrderId is not None:
2710 params = self.omit(params, 'clientOrderId', 'client_order_id')
2711 request['client_order_id'] = clientOrderId
2712 else:
2713 request['order_id'] = id
2714 response = self.privateTradingPostFullV1Order(self.extend(request, params))
2715 #
2716 # {
2717 # "result": {
2718 # "order_id": "0x01010105034cddc7000000006621285c",
2719 # "sub_account_id": "2147050003876484",
2720 # "is_market": False,
2721 # "time_in_force": "GOOD_TILL_TIME",
2722 # "post_only": False,
2723 # "reduce_only": False,
2724 # "legs": [
2725 # {
2726 # "instrument": "BTC_USDT_Perp",
2727 # "size": "0.001",
2728 # "limit_price": "90000.0",
2729 # "is_buying_asset": True
2730 # }
2731 # ],
2732 # "signature": {
2733 # "signer": "0x42c9f56f2c9da534f64b8806d64813b29c62a01d",
2734 # "r": "0x2d567b0a04525baf0bbd792db3bb3a28c1bcc5e95936f6dc2515a28ad8529313",
2735 # "s": "0x0bc2468d96c819c8de005aa7bebfb58eecb34dd7a1bae1e81e74c7b8bc4cddc7",
2736 # "v": "27",
2737 # "expiration": "1767455222801000000",
2738 # "nonce": "1375879248",
2739 # "chain_id": "0"
2740 # },
2741 # "metadata": {
2742 # "client_order_id": "1375879248",
2743 # "create_time": "1764863234474424590",
2744 # "trigger": {
2745 # "trigger_type": "UNSPECIFIED",
2746 # "tpsl": {
2747 # "trigger_by": "UNSPECIFIED",
2748 # "trigger_price": "0.0",

Callers

nothing calls this directly

Calls 8

get_sub_account_idMethod · 0.95
parse_orderMethod · 0.95
safe_string_2Method · 0.80
safe_dictMethod · 0.80
omitMethod · 0.45
extendMethod · 0.45

Tested by

no test coverage detected