kucoin-universal-sdk
Version:
Official KuCoin Universal SDK.
238 lines • 7.68 kB
JavaScript
"use strict";
// Code generated by Kucoin Universal SDK Generator; DO NOT EDIT.
Object.defineProperty(exports, "__esModule", { value: true });
exports.FlexTransferReqBuilder = exports.FlexTransferReq = void 0;
const class_transformer_1 = require("class-transformer");
class FlexTransferReq {
/**
* Private constructor, please use the corresponding static methods to construct the object.
*/
constructor() {
// @ts-ignore
this.clientOid = null;
// @ts-ignore
this.currency = null;
// @ts-ignore
this.amount = null;
// @ts-ignore
this.fromAccountType = null;
// @ts-ignore
this.type = null;
// @ts-ignore
this.toAccountType = null;
}
/**
* Creates a new instance of the `FlexTransferReq` class.
* The builder pattern allows step-by-step construction of a `FlexTransferReq` object.
*/
static builder() {
return new FlexTransferReqBuilder(new FlexTransferReq());
}
/**
* Creates a new instance of the `FlexTransferReq` class with the given data.
*/
static create(data) {
let obj = new FlexTransferReq();
obj.clientOid = data.clientOid;
obj.currency = data.currency;
obj.amount = data.amount;
obj.fromUserId = data.fromUserId;
obj.fromAccountType = data.fromAccountType;
obj.fromAccountTag = data.fromAccountTag;
obj.type = data.type;
obj.toUserId = data.toUserId;
obj.toAccountType = data.toAccountType;
obj.toAccountTag = data.toAccountTag;
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 FlexTransferReq(), jsonObject);
}
}
exports.FlexTransferReq = FlexTransferReq;
(function (FlexTransferReq) {
let FromAccountTypeEnum;
(function (FromAccountTypeEnum) {
/**
* Funding account
*/
FromAccountTypeEnum[FromAccountTypeEnum["MAIN"] = 'MAIN'] = "MAIN";
/**
* Spot account
*/
FromAccountTypeEnum[FromAccountTypeEnum["TRADE"] = 'TRADE'] = "TRADE";
/**
* Futures account
*/
FromAccountTypeEnum[FromAccountTypeEnum["CONTRACT"] = 'CONTRACT'] = "CONTRACT";
/**
* Cross margin account
*/
FromAccountTypeEnum[FromAccountTypeEnum["MARGIN"] = 'MARGIN'] = "MARGIN";
/**
* Isolated margin account
*/
FromAccountTypeEnum[FromAccountTypeEnum["ISOLATED"] = 'ISOLATED'] = "ISOLATED";
/**
* Cross margin account
*/
FromAccountTypeEnum[FromAccountTypeEnum["MARGIN_V2"] = 'MARGIN_V2'] = "MARGIN_V2";
/**
* Isolated margin account
*/
FromAccountTypeEnum[FromAccountTypeEnum["ISOLATED_V2"] = 'ISOLATED_V2'] = "ISOLATED_V2";
/**
* Option account
*/
FromAccountTypeEnum[FromAccountTypeEnum["OPTION"] = 'OPTION'] = "OPTION";
})(FromAccountTypeEnum = FlexTransferReq.FromAccountTypeEnum || (FlexTransferReq.FromAccountTypeEnum = {}));
let TypeEnum;
(function (TypeEnum) {
/**
*
*/
TypeEnum[TypeEnum["INTERNAL"] = 'INTERNAL'] = "INTERNAL";
/**
*
*/
TypeEnum[TypeEnum["PARENT_TO_SUB"] = 'PARENT_TO_SUB'] = "PARENT_TO_SUB";
/**
*
*/
TypeEnum[TypeEnum["SUB_TO_PARENT"] = 'SUB_TO_PARENT'] = "SUB_TO_PARENT";
})(TypeEnum = FlexTransferReq.TypeEnum || (FlexTransferReq.TypeEnum = {}));
let ToAccountTypeEnum;
(function (ToAccountTypeEnum) {
/**
* Funding account
*/
ToAccountTypeEnum[ToAccountTypeEnum["MAIN"] = 'MAIN'] = "MAIN";
/**
* Spot account
*/
ToAccountTypeEnum[ToAccountTypeEnum["TRADE"] = 'TRADE'] = "TRADE";
/**
* Futures account
*/
ToAccountTypeEnum[ToAccountTypeEnum["CONTRACT"] = 'CONTRACT'] = "CONTRACT";
/**
* Cross margin account
*/
ToAccountTypeEnum[ToAccountTypeEnum["MARGIN"] = 'MARGIN'] = "MARGIN";
/**
* Isolated margin account
*/
ToAccountTypeEnum[ToAccountTypeEnum["ISOLATED"] = 'ISOLATED'] = "ISOLATED";
/**
* Cross margin account
*/
ToAccountTypeEnum[ToAccountTypeEnum["MARGIN_V2"] = 'MARGIN_V2'] = "MARGIN_V2";
/**
* Isolated margin account
*/
ToAccountTypeEnum[ToAccountTypeEnum["ISOLATED_V2"] = 'ISOLATED_V2'] = "ISOLATED_V2";
/**
* Option account
*/
ToAccountTypeEnum[ToAccountTypeEnum["OPTION"] = 'OPTION'] = "OPTION";
})(ToAccountTypeEnum = FlexTransferReq.ToAccountTypeEnum || (FlexTransferReq.ToAccountTypeEnum = {}));
})(FlexTransferReq || (exports.FlexTransferReq = FlexTransferReq = {}));
class FlexTransferReqBuilder {
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;
}
/**
* Transfer out UserId: This is required when transferring from sub-account to master-account. It is optional for internal transfers.
*/
setFromUserId(value) {
this.obj.fromUserId = value;
return this;
}
/**
* Account type: MAIN, TRADE, CONTRACT, MARGIN, ISOLATED, MARGIN_V2, ISOLATED_V2
*/
setFromAccountType(value) {
this.obj.fromAccountType = value;
return this;
}
/**
* Symbol: Required when the account type is ISOLATED or ISOLATED_V2, for example: BTC-USDT
*/
setFromAccountTag(value) {
this.obj.fromAccountTag = value;
return this;
}
/**
* Transfer type: INTERNAL (Transfer within account), PARENT_TO_SUB (Transfer from master-account to sub-account), SUB_TO_PARENT (Transfer from sub-account to master-account)
*/
setType(value) {
this.obj.type = value;
return this;
}
/**
* Transfer in UserId: This is required when transferring master-account to sub-account. It is optional for internal transfers.
*/
setToUserId(value) {
this.obj.toUserId = value;
return this;
}
/**
* Account type: MAIN, TRADE, CONTRACT, MARGIN, ISOLATED, MARGIN_V2, ISOLATED_V2
*/
setToAccountType(value) {
this.obj.toAccountType = value;
return this;
}
/**
* Symbol: Required when the account type is ISOLATED or ISOLATED_V2, for example: BTC-USDT
*/
setToAccountTag(value) {
this.obj.toAccountTag = value;
return this;
}
/**
* Get the final object.
*/
build() {
return this.obj;
}
}
exports.FlexTransferReqBuilder = FlexTransferReqBuilder;
//# sourceMappingURL=model_flex_transfer_req.js.map