kucoin-universal-sdk
Version:
Official KuCoin Universal SDK.
117 lines • 3.15 kB
JavaScript
;
// Code generated by Kucoin Universal SDK Generator; DO NOT EDIT.
Object.defineProperty(exports, "__esModule", { value: true });
exports.GetPositionsHistoryReqBuilder = exports.GetPositionsHistoryReq = void 0;
const class_transformer_1 = require("class-transformer");
class GetPositionsHistoryReq {
/**
* Private constructor, please use the corresponding static methods to construct the object.
*/
constructor() {
/**
* Number of requests per page, max 200, default 10
*/
this.limit = 10;
/**
* Current page number, default 1
*/
this.pageId = 1;
}
/**
* Creates a new instance of the `GetPositionsHistoryReq` class.
* The builder pattern allows step-by-step construction of a `GetPositionsHistoryReq` object.
*/
static builder() {
return new GetPositionsHistoryReqBuilder(new GetPositionsHistoryReq());
}
/**
* Creates a new instance of the `GetPositionsHistoryReq` class with the given data.
*/
static create(data) {
let obj = new GetPositionsHistoryReq();
obj.symbol = data.symbol;
obj.from = data.from;
obj.to = data.to;
if (data.limit) {
obj.limit = data.limit;
}
else {
obj.limit = 10;
}
if (data.pageId) {
obj.pageId = data.pageId;
}
else {
obj.pageId = 1;
}
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 GetPositionsHistoryReq(), jsonObject);
}
}
exports.GetPositionsHistoryReq = GetPositionsHistoryReq;
class GetPositionsHistoryReqBuilder {
constructor(obj) {
this.obj = obj;
this.obj = obj;
}
/**
* Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220)
*/
setSymbol(value) {
this.obj.symbol = value;
return this;
}
/**
* Closing start time(ms)
*/
setFrom(value) {
this.obj.from = value;
return this;
}
/**
* Closing end time(ms)
*/
setTo(value) {
this.obj.to = value;
return this;
}
/**
* Number of requests per page, max 200, default 10
*/
setLimit(value) {
this.obj.limit = value;
return this;
}
/**
* Current page number, default 1
*/
setPageId(value) {
this.obj.pageId = value;
return this;
}
/**
* Get the final object.
*/
build() {
return this.obj;
}
}
exports.GetPositionsHistoryReqBuilder = GetPositionsHistoryReqBuilder;
//# sourceMappingURL=model_get_positions_history_req.js.map