UNPKG

kucoin-universal-sdk

Version:
144 lines 3.76 kB
"use strict"; // Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. Object.defineProperty(exports, "__esModule", { value: true }); exports.BorrowReqBuilder = exports.BorrowReq = void 0; const class_transformer_1 = require("class-transformer"); class BorrowReq { /** * Private constructor, please use the corresponding static methods to construct the object. */ constructor() { /** * true-isolated, false-cross; default is false */ this.isIsolated = false; /** * true: high frequency borrowing, false: low frequency borrowing; default false */ this.isHf = false; // @ts-ignore this.currency = null; // @ts-ignore this.size = null; // @ts-ignore this.timeInForce = null; } /** * Creates a new instance of the `BorrowReq` class. * The builder pattern allows step-by-step construction of a `BorrowReq` object. */ static builder() { return new BorrowReqBuilder(new BorrowReq()); } /** * Creates a new instance of the `BorrowReq` class with the given data. */ static create(data) { let obj = new BorrowReq(); obj.currency = data.currency; obj.size = data.size; obj.timeInForce = data.timeInForce; obj.symbol = data.symbol; if (data.isIsolated) { obj.isIsolated = data.isIsolated; } else { obj.isIsolated = false; } if (data.isHf) { obj.isHf = data.isHf; } else { obj.isHf = false; } 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 BorrowReq(), jsonObject); } } exports.BorrowReq = BorrowReq; (function (BorrowReq) { let TimeInForceEnum; (function (TimeInForceEnum) { /** * */ TimeInForceEnum[TimeInForceEnum["IOC"] = 'IOC'] = "IOC"; /** * */ TimeInForceEnum[TimeInForceEnum["FOK"] = 'FOK'] = "FOK"; })(TimeInForceEnum = BorrowReq.TimeInForceEnum || (BorrowReq.TimeInForceEnum = {})); })(BorrowReq || (exports.BorrowReq = BorrowReq = {})); class BorrowReqBuilder { constructor(obj) { this.obj = obj; this.obj = obj; } /** * currency */ setCurrency(value) { this.obj.currency = value; return this; } /** * Borrow amount */ setSize(value) { this.obj.size = value; return this; } /** * timeInForce: IOC, FOK */ setTimeInForce(value) { this.obj.timeInForce = value; return this; } /** * symbol, mandatory for isolated margin account */ setSymbol(value) { this.obj.symbol = value; return this; } /** * true-isolated, false-cross; default is false */ setIsIsolated(value) { this.obj.isIsolated = value; return this; } /** * true: high frequency borrowing, false: low frequency borrowing; default false */ setIsHf(value) { this.obj.isHf = value; return this; } /** * Get the final object. */ build() { return this.obj; } } exports.BorrowReqBuilder = BorrowReqBuilder; //# sourceMappingURL=model_borrow_req.js.map