kucoin-universal-sdk
Version:
Official KuCoin Universal SDK.
214 lines • 6.49 kB
JavaScript
"use strict";
// Code generated by Kucoin Universal SDK Generator; DO NOT EDIT.
Object.defineProperty(exports, "__esModule", { value: true });
exports.SubAccountTransferReqBuilder = exports.SubAccountTransferReq = void 0;
const class_transformer_1 = require("class-transformer");
class SubAccountTransferReq {
/**
* Private constructor, please use the corresponding static methods to construct the object.
*/
constructor() {
/**
* Account type: MAIN, TRADE, CONTRACT, MARGIN, ISOLATED
*/
this.accountType = SubAccountTransferReq.AccountTypeEnum.MAIN;
/**
* Sub-account type: MAIN, TRADE, CONTRACT, MARGIN, ISOLATED
*/
this.subAccountType = SubAccountTransferReq.SubAccountTypeEnum.MAIN;
// @ts-ignore
this.clientOid = null;
// @ts-ignore
this.currency = null;
// @ts-ignore
this.amount = null;
// @ts-ignore
this.direction = null;
// @ts-ignore
this.subTag = null;
}
/**
* Creates a new instance of the `SubAccountTransferReq` class.
* The builder pattern allows step-by-step construction of a `SubAccountTransferReq` object.
*/
static builder() {
return new SubAccountTransferReqBuilder(new SubAccountTransferReq());
}
/**
* Creates a new instance of the `SubAccountTransferReq` class with the given data.
*/
static create(data) {
let obj = new SubAccountTransferReq();
obj.clientOid = data.clientOid;
obj.currency = data.currency;
obj.amount = data.amount;
obj.direction = data.direction;
if (data.accountType) {
obj.accountType = data.accountType;
}
else {
obj.accountType = SubAccountTransferReq.AccountTypeEnum.MAIN;
}
if (data.subAccountType) {
obj.subAccountType = data.subAccountType;
}
else {
obj.subAccountType = SubAccountTransferReq.SubAccountTypeEnum.MAIN;
}
obj.subUserId = data.subUserId;
obj.tag = data.tag;
obj.subTag = data.subTag;
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 SubAccountTransferReq(), jsonObject);
}
}
exports.SubAccountTransferReq = SubAccountTransferReq;
(function (SubAccountTransferReq) {
let DirectionEnum;
(function (DirectionEnum) {
/**
*
*/
DirectionEnum[DirectionEnum["IN"] = 'IN'] = "IN";
/**
*
*/
DirectionEnum[DirectionEnum["OUT"] = 'OUT'] = "OUT";
})(DirectionEnum = SubAccountTransferReq.DirectionEnum || (SubAccountTransferReq.DirectionEnum = {}));
let AccountTypeEnum;
(function (AccountTypeEnum) {
/**
* Funding account
*/
AccountTypeEnum[AccountTypeEnum["MAIN"] = 'MAIN'] = "MAIN";
/**
* Spot account
*/
AccountTypeEnum[AccountTypeEnum["TRADE"] = 'TRADE'] = "TRADE";
/**
* Margin account
*/
AccountTypeEnum[AccountTypeEnum["MARGIN"] = 'MARGIN'] = "MARGIN";
/**
* Futures account
*/
AccountTypeEnum[AccountTypeEnum["CONTRACT"] = 'CONTRACT'] = "CONTRACT";
/**
* Option account
*/
AccountTypeEnum[AccountTypeEnum["OPTION"] = 'OPTION'] = "OPTION";
})(AccountTypeEnum = SubAccountTransferReq.AccountTypeEnum || (SubAccountTransferReq.AccountTypeEnum = {}));
let SubAccountTypeEnum;
(function (SubAccountTypeEnum) {
/**
*
*/
SubAccountTypeEnum[SubAccountTypeEnum["MAIN"] = 'MAIN'] = "MAIN";
/**
*
*/
SubAccountTypeEnum[SubAccountTypeEnum["TRADE"] = 'TRADE'] = "TRADE";
/**
*
*/
SubAccountTypeEnum[SubAccountTypeEnum["MARGIN"] = 'MARGIN'] = "MARGIN";
/**
*
*/
SubAccountTypeEnum[SubAccountTypeEnum["CONTRACT"] = 'CONTRACT'] = "CONTRACT";
})(SubAccountTypeEnum = SubAccountTransferReq.SubAccountTypeEnum || (SubAccountTransferReq.SubAccountTypeEnum = {}));
})(SubAccountTransferReq || (exports.SubAccountTransferReq = SubAccountTransferReq = {}));
class SubAccountTransferReqBuilder {
constructor(obj) {
this.obj = obj;
this.obj = obj;
}
/**
* Unique order ID created by users to identify their orders, e.g. UUID, with a maximum length of 128 bits
*/
setClientOid(value) {
this.obj.clientOid = value;
return this;
}
/**
* currency
*/
setCurrency(value) {
this.obj.currency = value;
return this;
}
/**
* Transfer amount: The amount is a positive integer multiple of the currency precision.
*/
setAmount(value) {
this.obj.amount = value;
return this;
}
/**
* OUT — the master user to sub user IN — the sub user to the master user
*/
setDirection(value) {
this.obj.direction = value;
return this;
}
/**
* Account type: MAIN, TRADE, CONTRACT, MARGIN, ISOLATED
*/
setAccountType(value) {
this.obj.accountType = value;
return this;
}
/**
* Sub-account type: MAIN, TRADE, CONTRACT, MARGIN, ISOLATED
*/
setSubAccountType(value) {
this.obj.subAccountType = value;
return this;
}
/**
* the user ID of a sub-account.
*/
setSubUserId(value) {
this.obj.subUserId = value;
return this;
}
/**
* Need to be defined if accountType=ISOLATED.
*/
setTag(value) {
this.obj.tag = value;
return this;
}
/**
* Need to be defined if subAccountType=ISOLATED.
*/
setSubTag(value) {
this.obj.subTag = value;
return this;
}
/**
* Get the final object.
*/
build() {
return this.obj;
}
}
exports.SubAccountTransferReqBuilder = SubAccountTransferReqBuilder;
//# sourceMappingURL=model_sub_account_transfer_req.js.map