kucoin-universal-sdk
Version:
Official KuCoin Universal SDK.
121 lines • 3.08 kB
JavaScript
"use strict";
// Code generated by Kucoin Universal SDK Generator; DO NOT EDIT.
Object.defineProperty(exports, "__esModule", { value: true });
exports.RepayReqBuilder = exports.RepayReq = void 0;
const class_transformer_1 = require("class-transformer");
class RepayReq {
/**
* 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;
}
/**
* Creates a new instance of the `RepayReq` class.
* The builder pattern allows step-by-step construction of a `RepayReq` object.
*/
static builder() {
return new RepayReqBuilder(new RepayReq());
}
/**
* Creates a new instance of the `RepayReq` class with the given data.
*/
static create(data) {
let obj = new RepayReq();
obj.currency = data.currency;
obj.size = data.size;
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 RepayReq(), jsonObject);
}
}
exports.RepayReq = RepayReq;
class RepayReqBuilder {
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;
}
/**
* 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.RepayReqBuilder = RepayReqBuilder;
//# sourceMappingURL=model_repay_req.js.map