kucoin-universal-sdk
Version:
Official KuCoin Universal SDK.
126 lines • 4.14 kB
JavaScript
;
// Code generated by Kucoin Universal SDK Generator; DO NOT EDIT.
Object.defineProperty(exports, "__esModule", { value: true });
exports.AddDepositAddressV3ReqBuilder = exports.AddDepositAddressV3Req = void 0;
const class_transformer_1 = require("class-transformer");
class AddDepositAddressV3Req {
/**
* Private constructor, please use the corresponding static methods to construct the object.
*/
constructor() {
/**
* The currency chainId, e.g. the available values for USDT are OMNI, ERC20, and TRC20; default is ERC20. The available values for BTC are Native, Segwit, TRC20; the parameters are bech32, btc, trx; default is Native.
*/
this.chain = 'eth';
/**
* Deposit account type: MAIN (funding account), TRADE (spot trading account); the default is MAIN
*/
this.to = AddDepositAddressV3Req.ToEnum.MAIN;
// @ts-ignore
this.currency = null;
// @ts-ignore
this.chain = null;
}
/**
* Creates a new instance of the `AddDepositAddressV3Req` class.
* The builder pattern allows step-by-step construction of a `AddDepositAddressV3Req` object.
*/
static builder() {
return new AddDepositAddressV3ReqBuilder(new AddDepositAddressV3Req());
}
/**
* Creates a new instance of the `AddDepositAddressV3Req` class with the given data.
*/
static create(data) {
let obj = new AddDepositAddressV3Req();
obj.currency = data.currency;
if (data.chain) {
obj.chain = data.chain;
}
else {
obj.chain = 'eth';
}
if (data.to) {
obj.to = data.to;
}
else {
obj.to = AddDepositAddressV3Req.ToEnum.MAIN;
}
obj.amount = data.amount;
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 AddDepositAddressV3Req(), jsonObject);
}
}
exports.AddDepositAddressV3Req = AddDepositAddressV3Req;
(function (AddDepositAddressV3Req) {
let ToEnum;
(function (ToEnum) {
/**
* Funding account
*/
ToEnum[ToEnum["MAIN"] = 'main'] = "MAIN";
/**
* Spot account
*/
ToEnum[ToEnum["TRADE"] = 'trade'] = "TRADE";
})(ToEnum = AddDepositAddressV3Req.ToEnum || (AddDepositAddressV3Req.ToEnum = {}));
})(AddDepositAddressV3Req || (exports.AddDepositAddressV3Req = AddDepositAddressV3Req = {}));
class AddDepositAddressV3ReqBuilder {
constructor(obj) {
this.obj = obj;
this.obj = obj;
}
/**
* currency
*/
setCurrency(value) {
this.obj.currency = value;
return this;
}
/**
* The currency chainId, e.g. the available values for USDT are OMNI, ERC20, and TRC20; default is ERC20. The available values for BTC are Native, Segwit, TRC20; the parameters are bech32, btc, trx; default is Native.
*/
setChain(value) {
this.obj.chain = value;
return this;
}
/**
* Deposit account type: MAIN (funding account), TRADE (spot trading account); the default is MAIN
*/
setTo(value) {
this.obj.to = value;
return this;
}
/**
* Deposit amount. This parameter is only used when applying for invoices on the Lightning Network. This parameter is invalid if it is not passed through the Lightning Network.
*/
setAmount(value) {
this.obj.amount = value;
return this;
}
/**
* Get the final object.
*/
build() {
return this.obj;
}
}
exports.AddDepositAddressV3ReqBuilder = AddDepositAddressV3ReqBuilder;
//# sourceMappingURL=model_add_deposit_address_v3_req.js.map