@hydro-protocol/hydro-client-js
Version:
Javascript SDK for the Hydro API
22 lines (21 loc) • 1.12 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var bignumber_js_1 = require("bignumber.js");
/**
* Represents a "candle" on a trading chart, meant to graph trading price and
* volume over time. Each candle is a specific period of time in the history
* of the exchange, and contains data about price fluctuations and volume
* of token traded during that period.
*/
var Candle = /** @class */ (function () {
function Candle(json) {
this.volume = json.volume ? new bignumber_js_1.BigNumber(json.volume) : new bignumber_js_1.BigNumber("0");
this.open = json.open ? new bignumber_js_1.BigNumber(json.open) : new bignumber_js_1.BigNumber("0");
this.close = json.close ? new bignumber_js_1.BigNumber(json.close) : new bignumber_js_1.BigNumber("0");
this.high = json.high ? new bignumber_js_1.BigNumber(json.high) : new bignumber_js_1.BigNumber("0");
this.low = json.low ? new bignumber_js_1.BigNumber(json.low) : new bignumber_js_1.BigNumber("0");
this.time = new Date(json.time);
}
return Candle;
}());
exports.Candle = Candle;