kucoin-universal-sdk
Version:
Official KuCoin Universal SDK.
170 lines • 4.42 kB
JavaScript
;
// Code generated by Kucoin Universal SDK Generator; DO NOT EDIT.
Object.defineProperty(exports, "__esModule", { value: true });
exports.GetKlinesReqBuilder = exports.GetKlinesReq = void 0;
const class_transformer_1 = require("class-transformer");
class GetKlinesReq {
/**
* Private constructor, please use the corresponding static methods to construct the object.
*/
constructor() {
/**
* Start time (second), default is 0
*/
this.startAt = 0;
/**
* End time (second), default is 0
*/
this.endAt = 0;
}
/**
* Creates a new instance of the `GetKlinesReq` class.
* The builder pattern allows step-by-step construction of a `GetKlinesReq` object.
*/
static builder() {
return new GetKlinesReqBuilder(new GetKlinesReq());
}
/**
* Creates a new instance of the `GetKlinesReq` class with the given data.
*/
static create(data) {
let obj = new GetKlinesReq();
obj.symbol = data.symbol;
obj.type = data.type;
if (data.startAt) {
obj.startAt = data.startAt;
}
else {
obj.startAt = 0;
}
if (data.endAt) {
obj.endAt = data.endAt;
}
else {
obj.endAt = 0;
}
return obj;
}
/**
* Convert the object to a JSON string.
*/
toJson() {
return JSON.stringify((0, class_transformer_1.instanceToPlain)(this));
}
/**
* Create an object from a JSON string.
*/
static fromJson(input) {
return this.fromObject(JSON.parse(input));
}
/**
* Create an object from Js Object.
*/
static fromObject(jsonObject) {
return (0, class_transformer_1.plainToClassFromExist)(new GetKlinesReq(), jsonObject);
}
}
exports.GetKlinesReq = GetKlinesReq;
(function (GetKlinesReq) {
let TypeEnum;
(function (TypeEnum) {
/**
* 1min
*/
TypeEnum[TypeEnum["_1MIN"] = '1min'] = "_1MIN";
/**
* 3min
*/
TypeEnum[TypeEnum["_3MIN"] = '3min'] = "_3MIN";
/**
* 5min
*/
TypeEnum[TypeEnum["_5MIN"] = '5min'] = "_5MIN";
/**
* 15min
*/
TypeEnum[TypeEnum["_15MIN"] = '15min'] = "_15MIN";
/**
* 30min
*/
TypeEnum[TypeEnum["_30MIN"] = '30min'] = "_30MIN";
/**
* 1hour
*/
TypeEnum[TypeEnum["_1HOUR"] = '1hour'] = "_1HOUR";
/**
* 2hour
*/
TypeEnum[TypeEnum["_2HOUR"] = '2hour'] = "_2HOUR";
/**
* 4hour
*/
TypeEnum[TypeEnum["_4HOUR"] = '4hour'] = "_4HOUR";
/**
* 6hour
*/
TypeEnum[TypeEnum["_6HOUR"] = '6hour'] = "_6HOUR";
/**
* 8hour
*/
TypeEnum[TypeEnum["_8HOUR"] = '8hour'] = "_8HOUR";
/**
* 12hour
*/
TypeEnum[TypeEnum["_12HOUR"] = '12hour'] = "_12HOUR";
/**
* 1day
*/
TypeEnum[TypeEnum["_1DAY"] = '1day'] = "_1DAY";
/**
* 1week
*/
TypeEnum[TypeEnum["_1WEEK"] = '1week'] = "_1WEEK";
/**
* 1month
*/
TypeEnum[TypeEnum["_1MONTH"] = '1month'] = "_1MONTH";
})(TypeEnum = GetKlinesReq.TypeEnum || (GetKlinesReq.TypeEnum = {}));
})(GetKlinesReq || (exports.GetKlinesReq = GetKlinesReq = {}));
class GetKlinesReqBuilder {
constructor(obj) {
this.obj = obj;
this.obj = obj;
}
/**
* symbol
*/
setSymbol(value) {
this.obj.symbol = value;
return this;
}
/**
* Type of candlestick patterns: 1min, 3min, 5min, 15min, 30min, 1hour, 2hour, 4hour, 6hour, 8hour, 12hour, 1day, 1week, 1month
*/
setType(value) {
this.obj.type = value;
return this;
}
/**
* Start time (second), default is 0
*/
setStartAt(value) {
this.obj.startAt = value;
return this;
}
/**
* End time (second), default is 0
*/
setEndAt(value) {
this.obj.endAt = value;
return this;
}
/**
* Get the final object.
*/
build() {
return this.obj;
}
}
exports.GetKlinesReqBuilder = GetKlinesReqBuilder;
//# sourceMappingURL=model_get_klines_req.js.map