kucoin-universal-sdk
Version:
Official KuCoin Universal SDK.
148 lines • 4.19 kB
JavaScript
;
// Code generated by Kucoin Universal SDK Generator; DO NOT EDIT.
Object.defineProperty(exports, "__esModule", { value: true });
exports.GetClosedOrdersReqBuilder = exports.GetClosedOrdersReq = void 0;
const class_transformer_1 = require("class-transformer");
class GetClosedOrdersReq {
/**
* Private constructor, please use the corresponding static methods to construct the object.
*/
constructor() {
/**
* Default20,Max100
*/
this.limit = 20;
}
/**
* Creates a new instance of the `GetClosedOrdersReq` class.
* The builder pattern allows step-by-step construction of a `GetClosedOrdersReq` object.
*/
static builder() {
return new GetClosedOrdersReqBuilder(new GetClosedOrdersReq());
}
/**
* Creates a new instance of the `GetClosedOrdersReq` class with the given data.
*/
static create(data) {
let obj = new GetClosedOrdersReq();
obj.symbol = data.symbol;
obj.side = data.side;
obj.type = data.type;
obj.lastId = data.lastId;
if (data.limit) {
obj.limit = data.limit;
}
else {
obj.limit = 20;
}
obj.startAt = data.startAt;
obj.endAt = data.endAt;
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 GetClosedOrdersReq(), jsonObject);
}
}
exports.GetClosedOrdersReq = GetClosedOrdersReq;
(function (GetClosedOrdersReq) {
let SideEnum;
(function (SideEnum) {
/**
*
*/
SideEnum[SideEnum["BUY"] = 'buy'] = "BUY";
/**
*
*/
SideEnum[SideEnum["SELL"] = 'sell'] = "SELL";
})(SideEnum = GetClosedOrdersReq.SideEnum || (GetClosedOrdersReq.SideEnum = {}));
let TypeEnum;
(function (TypeEnum) {
/**
*
*/
TypeEnum[TypeEnum["LIMIT"] = 'limit'] = "LIMIT";
/**
*
*/
TypeEnum[TypeEnum["MARKET"] = 'market'] = "MARKET";
})(TypeEnum = GetClosedOrdersReq.TypeEnum || (GetClosedOrdersReq.TypeEnum = {}));
})(GetClosedOrdersReq || (exports.GetClosedOrdersReq = GetClosedOrdersReq = {}));
class GetClosedOrdersReqBuilder {
constructor(obj) {
this.obj = obj;
this.obj = obj;
}
/**
* symbol
*/
setSymbol(value) {
this.obj.symbol = value;
return this;
}
/**
* specify if the order is to \'buy\' or \'sell\'
*/
setSide(value) {
this.obj.side = value;
return this;
}
/**
* specify if the order is an \'limit\' order or \'market\' order.
*/
setType(value) {
this.obj.type = value;
return this;
}
/**
* The id of the last set of data from the previous batch of data. By default, the latest information is given. lastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page.
*/
setLastId(value) {
this.obj.lastId = value;
return this;
}
/**
* Default20,Max100
*/
setLimit(value) {
this.obj.limit = value;
return this;
}
/**
* Start time (milisecond)
*/
setStartAt(value) {
this.obj.startAt = value;
return this;
}
/**
* End time (milisecond)
*/
setEndAt(value) {
this.obj.endAt = value;
return this;
}
/**
* Get the final object.
*/
build() {
return this.obj;
}
}
exports.GetClosedOrdersReqBuilder = GetClosedOrdersReqBuilder;
//# sourceMappingURL=model_get_closed_orders_req.js.map