exchange.GetOrder
Obtains order information.
exchange.GetOrder(orderId)Examples
Place a sell order, then query it with the returned order ID.
javascript
function main(){
var id = exchange.Sell(1000, 1)
if (!id) return
var order = exchange.GetOrder(id)
if (!order) return
Log("Id:", order.Id, "Price:", order.Price, "Amount:", order.Amount, "DealAmount:",
order.DealAmount, "Status:", order.Status, "Type:", order.Type)
}
python
def main():
id = exchange.Sell(1000, 1)
if not id:
return
order = exchange.GetOrder(id)
if not order:
return
Log("Id:", order["Id"], "Price:", order["Price"], "Amount:", order["Amount"], "DealAmount:",
order["DealAmount"], "Status:", order["Status"], "Type:", order["Type"])
rust
fn main() {
let Ok(id) = exchange.Sell(1000, 1) else { return };
let Ok(order) = exchange.GetOrder(&id) else { return };
Log!("Id:", order.Id, "Price:", order.Price, "Amount:", order.Amount, "DealAmount:",
order.DealAmount, "Status:", order.Status, "Type:", order.Type);
}Returns
| Type | Description |
| Queries order details based on the order Id. Returns the |
Arguments
| Name | Type | Required | Description |
orderId | string | Yes | Order to be queried. The When calling the |
See Also
Remarks
Some exchanges do not support the exchange.GetOrder() function. The AvgPrice attribute in the return value Order structure is the average filled price; some exchanges do not support this field, and if it is not supported it will be set to 0.
If you are using an older version of the docker, the orderId parameter of the exchange.GetOrder() function may differ from the orderId described in the current documentation.
Exchanges that do not support this function: Web3. The call fails with an error and returns null; for all exchanges see Capability Matrix.
Exchanges that serve this function through a fallback: the exchange's API does not fully provide this function, and the docker fills the gap.
The exchange has no such endpoint; the docker implements the function:
Coincheck: The exchange has no single-order query interface, so the order is looked up among the current open orders; the exchange provides no historical order query, so filled or canceled orders cannot be found (null is returned).Zaif: The exchange has no single-order query interface, so the order is looked up among the current open orders and the historical orders.