info.bitrich.xchangestream.btcmarkets.dto.BTCMarketsWebSocketTradeMessage Maven / Gradle / Ivy
package info.bitrich.xchangestream.btcmarkets.dto;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.math.BigDecimal;
/**
* This Class represents the trade event generated by the websocket
*
* {@link BTCMarketsWebSocketTradeMessage#tradeId} tradeId The id of the trade
*
*
{@link BTCMarketsWebSocketTradeMessage#type} The trade type (BID side or ASK side)
*
*
{@link BTCMarketsWebSocketTradeMessage#price} The price of the trade
*
*
{@link BTCMarketsWebSocketTradeMessage#timestamp} The timestamp of the trade according to the
* exchange's server, null if not provided
*
*
{@link BTCMarketsWebSocketTradeMessage#volume} The volume procured in the trade
*
*
{@link BTCMarketsWebSocketTradeMessage#messageType} All messages published include a {@code
* json} attribute called messageType that represents type of event that is being received
*
*
Example Event>
*
*
*
* { marketId: 'BTC-AUD',
*
*
timestamp: '2019-04-08T20:54:27.632Z',
*
*
tradeId: 3153171493,
*
*
price: '7370.11',
*
*
volume: '0.10901605',
*
*
side: 'Ask',
*
*
messageType: 'trade' }>
*/
public class BTCMarketsWebSocketTradeMessage {
private final String marketId;
private final String timestamp;
private final String messageType;
private final String tradeId;
private final String side;
private final BigDecimal price;
private final BigDecimal volume;
public BTCMarketsWebSocketTradeMessage(
@JsonProperty("marketId") String marketId,
@JsonProperty("timestamp") String timestamp,
@JsonProperty("tradeId") String tradeId,
@JsonProperty("side") String side,
@JsonProperty("price") BigDecimal price,
@JsonProperty("volume") BigDecimal volume,
@JsonProperty("messageType") String messageType) {
this.marketId = marketId;
this.timestamp = timestamp;
this.messageType = messageType;
this.tradeId = tradeId;
this.side = side;
this.price = price;
this.volume = volume;
}
public String getMarketId() {
return marketId;
}
public String getTimestamp() {
return timestamp;
}
public String getMessageType() {
return messageType;
}
public String getTradeId() {
return tradeId;
}
public String getSide() {
return side;
}
public BigDecimal getPrice() {
return price;
}
public BigDecimal getVolume() {
return volume;
}
}