UNPKG

kucoin-universal-sdk

Version:
165 lines 4.96 kB
"use strict"; // Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. Object.defineProperty(exports, "__esModule", { value: true }); exports.AddOcoOrderReqBuilder = exports.AddOcoOrderReq = void 0; const class_transformer_1 = require("class-transformer"); class AddOcoOrderReq { /** * Private constructor, please use the corresponding static methods to construct the object. */ constructor() { // @ts-ignore this.clientOid = null; // @ts-ignore this.side = null; // @ts-ignore this.symbol = null; // @ts-ignore this.price = null; // @ts-ignore this.size = null; // @ts-ignore this.stopPrice = null; // @ts-ignore this.limitPrice = null; } /** * Creates a new instance of the `AddOcoOrderReq` class. * The builder pattern allows step-by-step construction of a `AddOcoOrderReq` object. */ static builder() { return new AddOcoOrderReqBuilder(new AddOcoOrderReq()); } /** * Creates a new instance of the `AddOcoOrderReq` class with the given data. */ static create(data) { let obj = new AddOcoOrderReq(); obj.clientOid = data.clientOid; obj.side = data.side; obj.symbol = data.symbol; obj.remark = data.remark; obj.price = data.price; obj.size = data.size; obj.stopPrice = data.stopPrice; obj.limitPrice = data.limitPrice; obj.tradeType = data.tradeType; 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 AddOcoOrderReq(), jsonObject); } } exports.AddOcoOrderReq = AddOcoOrderReq; (function (AddOcoOrderReq) { let SideEnum; (function (SideEnum) { /** * */ SideEnum[SideEnum["BUY"] = 'buy'] = "BUY"; /** * */ SideEnum[SideEnum["SELL"] = 'sell'] = "SELL"; })(SideEnum = AddOcoOrderReq.SideEnum || (AddOcoOrderReq.SideEnum = {})); let TradeTypeEnum; (function (TradeTypeEnum) { /** * Spot Trading */ TradeTypeEnum[TradeTypeEnum["TRADE"] = 'TRADE'] = "TRADE"; })(TradeTypeEnum = AddOcoOrderReq.TradeTypeEnum || (AddOcoOrderReq.TradeTypeEnum = {})); })(AddOcoOrderReq || (exports.AddOcoOrderReq = AddOcoOrderReq = {})); class AddOcoOrderReqBuilder { constructor(obj) { this.obj = obj; this.obj = obj; } /** * Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters. Please remember the orderId created by the service provider, it used to check for updates in order status. */ setClientOid(value) { this.obj.clientOid = value; return this; } /** * specify if the order is to \'buy\' or \'sell\' */ setSide(value) { this.obj.side = value; return this; } /** * symbol */ setSymbol(value) { this.obj.symbol = value; return this; } /** * Order placement remarks, length cannot exceed 20 characters (ASCII) */ setRemark(value) { this.obj.remark = value; return this; } /** * Specify price for order */ setPrice(value) { this.obj.price = value; return this; } /** * Specify quantity for order */ setSize(value) { this.obj.size = value; return this; } /** * trigger price. */ setStopPrice(value) { this.obj.stopPrice = value; return this; } /** * The limit order price after take-profit and stop-loss are triggered. */ setLimitPrice(value) { this.obj.limitPrice = value; return this; } /** * Transaction Type, currently only supports TRADE (spot transactions), the default is TRADE */ setTradeType(value) { this.obj.tradeType = value; return this; } /** * Get the final object. */ build() { return this.obj; } } exports.AddOcoOrderReqBuilder = AddOcoOrderReqBuilder; //# sourceMappingURL=model_add_oco_order_req.js.map