estonlabs.cxtl.exchanges.binance.general.domain.Order Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cxtl Show documentation
Show all versions of cxtl Show documentation
CXTL – Crypto eXchange Trading Library
package estonlabs.cxtl.exchanges.binance.general.domain;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import estonlabs.cxtl.exchanges.a.specification.domain.Ack;
import estonlabs.cxtl.exchanges.a.specification.domain.AckStatus;
import estonlabs.cxtl.exchanges.a.specification.domain.AssetClass;
import estonlabs.cxtl.exchanges.a.specification.domain.SimpleOrderStatus;
import estonlabs.cxtl.exchanges.binance.fapi.domain.Response;
import estonlabs.cxtl.exchanges.binance.fapi.domain.enums.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
@EqualsAndHashCode(callSuper = true)
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
@ToString
public abstract class Order extends Response implements estonlabs.cxtl.exchanges.a.specification.domain.Order, Ack {
@JsonProperty("clientOrderId")
private String clOrdId;
@JsonProperty("executedQty")
private double cumQty;
private String cumQuote;
private String orderId;
private Double avgPrice;
private Double origQty;
private String price;
private boolean reduceOnly;
private Side side;
private PositionSide positionSide;
private OrderStatus status;
private String stopPrice;
private boolean closePosition;
private String symbol;
private TimeInForce timeInForce;
private OrderType type;
private OrderType origType;
private String activatePrice;
private String priceRate;
private Long updateTime;
private WorkingType workingType;
private boolean priceProtect;
private SelfTradePreventionMode selfTradePreventionMode;
private Long goodTillDate;
public abstract AssetClass getAssetClass();
@Override
public Double getLastOrAvgPx() {
return avgPrice;
}
@Override
public SimpleOrderStatus getSimpleStatus() {
return status.getSimpleOrderStatus();
}
@Override
public AckStatus getAckStatus() {
return status== OrderStatus.REJECTED? AckStatus.FAIL: AckStatus.SUCCESS;
}
}