UNPKG

kucoin-universal-sdk

Version:
196 lines 5.83 kB
"use strict"; // Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. Object.defineProperty(exports, "__esModule", { value: true }); exports.GetTradeHistoryOldReqBuilder = exports.GetTradeHistoryOldReq = void 0; const class_transformer_1 = require("class-transformer"); class GetTradeHistoryOldReq { /** * Private constructor, please use the corresponding static methods to construct the object. */ constructor() { /** * The type of trading: TRADE - Spot Trading (TRADE as default), MARGIN_TRADE - Cross Margin Trading, MARGIN_ISOLATED_TRADE - Isolated Margin Trading. */ this.tradeType = GetTradeHistoryOldReq.TradeTypeEnum.TRADE; /** * Current request page. */ this.currentPage = 1; } /** * Creates a new instance of the `GetTradeHistoryOldReq` class. * The builder pattern allows step-by-step construction of a `GetTradeHistoryOldReq` object. */ static builder() { return new GetTradeHistoryOldReqBuilder(new GetTradeHistoryOldReq()); } /** * Creates a new instance of the `GetTradeHistoryOldReq` class with the given data. */ static create(data) { let obj = new GetTradeHistoryOldReq(); obj.symbol = data.symbol; obj.orderId = data.orderId; obj.side = data.side; obj.type = data.type; if (data.tradeType) { obj.tradeType = data.tradeType; } else { obj.tradeType = GetTradeHistoryOldReq.TradeTypeEnum.TRADE; } obj.startAt = data.startAt; obj.endAt = data.endAt; if (data.currentPage) { obj.currentPage = data.currentPage; } else { obj.currentPage = 1; } obj.pageSize = data.pageSize; 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 GetTradeHistoryOldReq(), jsonObject); } } exports.GetTradeHistoryOldReq = GetTradeHistoryOldReq; (function (GetTradeHistoryOldReq) { let SideEnum; (function (SideEnum) { /** * buy */ SideEnum[SideEnum["BUY"] = 'buy'] = "BUY"; /** * sell */ SideEnum[SideEnum["SELL"] = 'sell'] = "SELL"; })(SideEnum = GetTradeHistoryOldReq.SideEnum || (GetTradeHistoryOldReq.SideEnum = {})); let TypeEnum; (function (TypeEnum) { /** * limit */ TypeEnum[TypeEnum["LIMIT"] = 'limit'] = "LIMIT"; /** * market */ TypeEnum[TypeEnum["MARKET"] = 'market'] = "MARKET"; /** * limit_stop */ TypeEnum[TypeEnum["LIMIT_STOP"] = 'limit_stop'] = "LIMIT_STOP"; /** * market_stop */ TypeEnum[TypeEnum["MARKET_STOP"] = 'market_stop'] = "MARKET_STOP"; })(TypeEnum = GetTradeHistoryOldReq.TypeEnum || (GetTradeHistoryOldReq.TypeEnum = {})); let TradeTypeEnum; (function (TradeTypeEnum) { /** * Spot Trading */ TradeTypeEnum[TradeTypeEnum["TRADE"] = 'TRADE'] = "TRADE"; /** * Cross Margin Trading */ TradeTypeEnum[TradeTypeEnum["MARGIN_TRADE"] = 'MARGIN_TRADE'] = "MARGIN_TRADE"; /** * Isolated Margin Trading */ TradeTypeEnum[TradeTypeEnum["MARGIN_ISOLATED_TRADE"] = 'MARGIN_ISOLATED_TRADE'] = "MARGIN_ISOLATED_TRADE"; })(TradeTypeEnum = GetTradeHistoryOldReq.TradeTypeEnum || (GetTradeHistoryOldReq.TradeTypeEnum = {})); })(GetTradeHistoryOldReq || (exports.GetTradeHistoryOldReq = GetTradeHistoryOldReq = {})); class GetTradeHistoryOldReqBuilder { constructor(obj) { this.obj = obj; this.obj = obj; } /** * symbol */ setSymbol(value) { this.obj.symbol = value; return this; } /** * The unique order ID generated by the trading system. (If orderId is specified, please ignore the other query parameters.) */ setOrderId(value) { this.obj.orderId = value; return this; } /** * Specify if the order is to \'buy\' or \'sell\'. */ setSide(value) { this.obj.side = value; return this; } /** * limit, market, limit_stop or market_stop */ setType(value) { this.obj.type = value; return this; } /** * The type of trading: TRADE - Spot Trading (TRADE as default), MARGIN_TRADE - Cross Margin Trading, MARGIN_ISOLATED_TRADE - Isolated Margin Trading. */ setTradeType(value) { this.obj.tradeType = 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. */ setCurrentPage(value) { this.obj.currentPage = value; return this; } /** * Number of results per request. Minimum is 10, maximum is 500. */ setPageSize(value) { this.obj.pageSize = value; return this; } /** * Get the final object. */ build() { return this.obj; } } exports.GetTradeHistoryOldReqBuilder = GetTradeHistoryOldReqBuilder; //# sourceMappingURL=model_get_trade_history_old_req.js.map