kucoin-universal-sdk
Version:
Official KuCoin Universal SDK.
181 lines • 5.11 kB
JavaScript
"use strict";
// Code generated by Kucoin Universal SDK Generator; DO NOT EDIT.
Object.defineProperty(exports, "__esModule", { value: true });
exports.GetTradeHistoryReqBuilder = exports.GetTradeHistoryReq = void 0;
const class_transformer_1 = require("class-transformer");
class GetTradeHistoryReq {
/**
* Private constructor, please use the corresponding static methods to construct the object.
*/
constructor() {
/**
* Current request page. The default currentPage is 1
*/
this.currentPage = 1;
/**
* pageSize, The default pageSize is 50; the maximum cannot exceed 1000
*/
this.pageSize = 50;
}
/**
* Creates a new instance of the `GetTradeHistoryReq` class.
* The builder pattern allows step-by-step construction of a `GetTradeHistoryReq` object.
*/
static builder() {
return new GetTradeHistoryReqBuilder(new GetTradeHistoryReq());
}
/**
* Creates a new instance of the `GetTradeHistoryReq` class with the given data.
*/
static create(data) {
let obj = new GetTradeHistoryReq();
obj.orderId = data.orderId;
obj.symbol = data.symbol;
obj.side = data.side;
obj.type = data.type;
obj.tradeTypes = data.tradeTypes;
obj.startAt = data.startAt;
obj.endAt = data.endAt;
if (data.currentPage) {
obj.currentPage = data.currentPage;
}
else {
obj.currentPage = 1;
}
if (data.pageSize) {
obj.pageSize = data.pageSize;
}
else {
obj.pageSize = 50;
}
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 GetTradeHistoryReq(), jsonObject);
}
}
exports.GetTradeHistoryReq = GetTradeHistoryReq;
(function (GetTradeHistoryReq) {
let SideEnum;
(function (SideEnum) {
/**
* buy
*/
SideEnum[SideEnum["BUY"] = 'buy'] = "BUY";
/**
* sell
*/
SideEnum[SideEnum["SELL"] = 'sell'] = "SELL";
})(SideEnum = GetTradeHistoryReq.SideEnum || (GetTradeHistoryReq.SideEnum = {}));
let TypeEnum;
(function (TypeEnum) {
/**
* Limit order
*/
TypeEnum[TypeEnum["LIMIT"] = 'limit'] = "LIMIT";
/**
* Market order
*/
TypeEnum[TypeEnum["MARKET"] = 'market'] = "MARKET";
/**
* Stop limit order
*/
TypeEnum[TypeEnum["LIMIT_STOP"] = 'limit_stop'] = "LIMIT_STOP";
/**
* Stop Market order
*/
TypeEnum[TypeEnum["MARKET_STOP"] = 'market_stop'] = "MARKET_STOP";
})(TypeEnum = GetTradeHistoryReq.TypeEnum || (GetTradeHistoryReq.TypeEnum = {}));
})(GetTradeHistoryReq || (exports.GetTradeHistoryReq = GetTradeHistoryReq = {}));
class GetTradeHistoryReqBuilder {
constructor(obj) {
this.obj = obj;
this.obj = obj;
}
/**
* List fills for a specific order only (if you specify orderId, other parameters can be ignored)
*/
setOrderId(value) {
this.obj.orderId = value;
return this;
}
/**
* 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;
}
/**
* Order side
*/
setSide(value) {
this.obj.side = value;
return this;
}
/**
* Order Type
*/
setType(value) {
this.obj.type = value;
return this;
}
/**
* Transaction type: trade, adl, liquid, settlement. Supports querying multiple types at the same time, separated by commas. Query all types when empty
*/
setTradeTypes(value) {
this.obj.tradeTypes = value;
return this;
}
/**
* Start time (milliseconds)
*/
setStartAt(value) {
this.obj.startAt = value;
return this;
}
/**
* End time (milliseconds)
*/
setEndAt(value) {
this.obj.endAt = value;
return this;
}
/**
* Current request page. The default currentPage is 1
*/
setCurrentPage(value) {
this.obj.currentPage = value;
return this;
}
/**
* pageSize, The default pageSize is 50; the maximum cannot exceed 1000
*/
setPageSize(value) {
this.obj.pageSize = value;
return this;
}
/**
* Get the final object.
*/
build() {
return this.obj;
}
}
exports.GetTradeHistoryReqBuilder = GetTradeHistoryReqBuilder;
//# sourceMappingURL=model_get_trade_history_req.js.map