import TradingPair from "../assets/TradingPair.js";
import APIEvent from "./APIEvent.js"
import APIEventType from "./APIEventType.js"

export default class KLineEvent extends APIEvent{
    /**
     * @type {TradingPair}
     */
    tradingPair = null;

    /**
     * @type {number}
     */
    high = 0;

    /**
     * @type {number}
     */
    low = 0;

    /**
     * @type {number}
     */
    open = 0;

    /**
     * @type {number}
     */
    close = 0;

    /**
     * @type {boolean}
     */
    isClosed = false;

    /**
     * @type {number}
     */
    startTime = 0;

    /**
     * @type {number}
     */
    endTime = 0;

    /**
     * @param {TradingPair} tradingPair 
     * @param {number} high 
     * @param {number} low 
     * @param {number} open 
     * @param {number} close 
     */
    constructor(tradingPair, high, low, open, close){
        super(APIEventType.KLINE);
        this.tradingPair = tradingPair;
        this.high = high;
        this.low = low;
        this.open = open;
        this.close = close;
    }
}