MCPcopy Index your code
hub / github.com/ccxt/ccxt / Order

Method Order

java/lib/src/main/java/io/github/ccxt/types/Order.java:33–64  ·  view source on GitHub ↗
(Object raw)

Source from the content-addressed store, hash-verified

31 public Map<String, Object> info;
32
33 @SuppressWarnings("unchecked")
34 public Order(Object raw) {
35 Map<String, Object> data = TypeHelper.toMap(raw);
36 this.id = TypeHelper.safeString(data, "id");
37 this.clientOrderId = TypeHelper.safeString(data, "clientOrderId");
38 this.timestamp = TypeHelper.safeInteger(data, "timestamp");
39 this.datetime = TypeHelper.safeString(data, "datetime");
40 this.lastTradeTimestamp = TypeHelper.safeString(data, "lastTradeTimestamp");
41 this.symbol = TypeHelper.safeString(data, "symbol");
42 this.type = TypeHelper.safeString(data, "type");
43 this.timeInForce = TypeHelper.safeString(data, "timeInForce");
44 this.side = TypeHelper.safeString(data, "side");
45 this.price = TypeHelper.safeFloat(data, "price");
46 this.cost = TypeHelper.safeFloat(data, "cost");
47 this.average = TypeHelper.safeFloat(data, "average");
48 this.amount = TypeHelper.safeFloat(data, "amount");
49 this.filled = TypeHelper.safeFloat(data, "filled");
50 this.remaining = TypeHelper.safeFloat(data, "remaining");
51 this.triggerPrice = TypeHelper.safeFloat(data, "triggerPrice");
52 this.stopLossPrice = TypeHelper.safeFloat(data, "stopLossPrice");
53 this.takeProfitPrice = TypeHelper.safeFloat(data, "takeProfitPrice");
54 this.status = TypeHelper.safeString(data, "status");
55 this.reduceOnly = TypeHelper.safeBool(data, "reduceOnly");
56 this.postOnly = TypeHelper.safeBool(data, "postOnly");
57 Object feeRaw = TypeHelper.safeValue(data, "fee");
58 this.fee = feeRaw != null ? new Fee(feeRaw) : null;
59 Object tradesRaw = TypeHelper.safeValue(data, "trades");
60 if (tradesRaw instanceof List<?> tradesList) {
61 this.trades = ((List<Object>) tradesList).stream().map(Trade::new).collect(Collectors.toList());
62 }
63 this.info = TypeHelper.getInfo(data);
64 }
65}

Callers

nothing calls this directly

Calls 10

toMapMethod · 0.95
safeStringMethod · 0.95
safeIntegerMethod · 0.95
safeFloatMethod · 0.95
safeBoolMethod · 0.95
safeValueMethod · 0.95
getInfoMethod · 0.95
toListMethod · 0.80
mapMethod · 0.45
streamMethod · 0.45

Tested by

no test coverage detected