All Downloads are FREE. Search and download functionalities are using the official Maven repository.

info.bitrich.xchangestream.binance.dto.DepthBinanceWebSocketTransaction Maven / Gradle / Ivy

The newest version!
package info.bitrich.xchangestream.binance.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import org.knowm.xchange.binance.dto.marketdata.BinanceOrderbook;

import java.util.List;

public class DepthBinanceWebSocketTransaction extends ProductBinanceWebSocketTransaction {

    private final BinanceOrderbook orderBook;
    private final long lastUpdateId;
    private final long firstUpdateId;

    public DepthBinanceWebSocketTransaction(
            @JsonProperty("e") String eventType,
            @JsonProperty("E") String eventTime,
            @JsonProperty("s") String symbol,
            @JsonProperty("U") long firstUpdateId,
            @JsonProperty("u") long lastUpdateId,
            @JsonProperty("b") List _bids,
            @JsonProperty("a") List _asks
    ) {
        super(eventType, eventTime, symbol);
        this.firstUpdateId = firstUpdateId;
        this.lastUpdateId = lastUpdateId;
        orderBook = new BinanceOrderbook(lastUpdateId, _bids, _asks);
    }

    public BinanceOrderbook getOrderBook() {
        return orderBook;
    }

    public long getFirstUpdateId() {
        return firstUpdateId;
    }

    public long getLastUpdateId() {
        return lastUpdateId;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy