import {isNullOrUndefined} from "util"; export class Configuration { private _symbol: string; private _stopLossEnabled: boolean; private _startTime: Date; private _endTime: Date; private _responsiveness: string; private _minimumBuyThreshold: number; private _maximumBuyThreshold: number; private _buyThresholdPermutationStep: number; private _minimumSellThreshold: number; private _maximumSellThreshold: number; private _sellThresholdPermutationStep: number; private _minimumStopLossThreshold: number; private _maximumStopLossThreshold: number; private _stopLossThresholdPermutationStep: number; private _btcToSpend: number; constructor( json: any ) { this._symbol = json.symbol; this._stopLossEnabled = json.stopLossEnabled; this._startTime = new Date( json.startTime ); this._endTime = isNullOrUndefined( json.endTime ) ? new Date() : new Date( json.endTime ); this._responsiveness = json.responsiveness; this._minimumBuyThreshold = json.minimumBuyThreshold; this._maximumBuyThreshold = json.maximumBuyThreshold; this._buyThresholdPermutationStep = json.buyThresholdPermutationStep; this._minimumSellThreshold = json.minimumSellThreshold; this._maximumSellThreshold = json.maximumSellThreshold; this._sellThresholdPermutationStep = json.sellThresholdPermutationStep; this._minimumStopLossThreshold = json.minimumStopLossThreshold; this._maximumStopLossThreshold = json.maximumStopLossThreshold; this._stopLossThresholdPermutationStep = json.stopLossThresholdPermutationStep; this._btcToSpend = json.btcToSpend; } get symbol(): string { return this._symbol; } set symbol(value: string ) { this._symbol = value; } get stopLossEnabled(): boolean { return this._stopLossEnabled; } set stopLossEnabled(value: boolean) { this._stopLossEnabled = value; } get startTime(): Date { return this._startTime; } set startTime(value: Date) { this._startTime = value; } get endTime(): Date { return this._endTime; } set endTime(value: Date) { this._endTime = value; } get responsiveness(): string { return this._responsiveness; } set responsiveness( value: string ) { this._responsiveness = value; } get minimumBuyThreshold(): number { return this._minimumBuyThreshold; } set minimumBuyThreshold( value: number ) { this._minimumBuyThreshold = value; } get maximumBuyThreshold(): number { return this._maximumBuyThreshold; } set maximumBuyThreshold( value: number ) { this._maximumBuyThreshold = value; } get buyThresholdPermutationStep(): number { return this._buyThresholdPermutationStep; } set buyThresholdPermutationStep( value: number ) { this._buyThresholdPermutationStep = value; } get minimumSellThreshold(): number { return this._minimumSellThreshold; } set minimumSellThreshold( value: number ) { this._minimumSellThreshold = value; } get maximumSellThreshold(): number { return this._maximumSellThreshold; } set maximumSellThreshold( value: number ) { this._maximumSellThreshold = value; } get sellThresholdPermutationStep(): number { return this._sellThresholdPermutationStep; } set sellThresholdPermutationStep( value: number ) { this._sellThresholdPermutationStep = value; } get minimumStopLossThreshold(): number { return this._minimumStopLossThreshold; } set minimumStopLossThreshold( value: number ) { this._minimumStopLossThreshold = value; } get maximumStopLossThreshold(): number { return this._maximumStopLossThreshold; } set maximumStopLossThreshold( value: number ) { this._maximumStopLossThreshold = value; } get stopLossThresholdPermutationStep(): number { return this._stopLossThresholdPermutationStep; } set stopLossThresholdPermutationStep( value: number ) { this._stopLossThresholdPermutationStep = value; } get btcToSpend(): number { return this._btcToSpend; } set btcToSpend( value: number ) { this._btcToSpend = value; } }