UNPKG

kucoin-universal-sdk

Version:
116 lines 3.94 kB
"use strict"; // Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. Object.defineProperty(exports, "__esModule", { value: true }); exports.AddDepositAddressV1ReqBuilder = exports.AddDepositAddressV1Req = void 0; const class_transformer_1 = require("class-transformer"); class AddDepositAddressV1Req { /** * Private constructor, please use the corresponding static methods to construct the object. */ constructor() { /** * The chainId of currency, 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 only applies to multi-chain currencies; no need for single-chain currencies. */ this.chain = 'eth'; /** * Deposit account type: main (funding account), trade (spot trading account); the default is main */ this.to = AddDepositAddressV1Req.ToEnum.MAIN; // @ts-ignore this.currency = null; } /** * Creates a new instance of the `AddDepositAddressV1Req` class. * The builder pattern allows step-by-step construction of a `AddDepositAddressV1Req` object. */ static builder() { return new AddDepositAddressV1ReqBuilder(new AddDepositAddressV1Req()); } /** * Creates a new instance of the `AddDepositAddressV1Req` class with the given data. */ static create(data) { let obj = new AddDepositAddressV1Req(); 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 = AddDepositAddressV1Req.ToEnum.MAIN; } 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 AddDepositAddressV1Req(), jsonObject); } } exports.AddDepositAddressV1Req = AddDepositAddressV1Req; (function (AddDepositAddressV1Req) { let ToEnum; (function (ToEnum) { /** * Funding account */ ToEnum[ToEnum["MAIN"] = 'MAIN'] = "MAIN"; /** * Spot account */ ToEnum[ToEnum["TRADE"] = 'TRADE'] = "TRADE"; })(ToEnum = AddDepositAddressV1Req.ToEnum || (AddDepositAddressV1Req.ToEnum = {})); })(AddDepositAddressV1Req || (exports.AddDepositAddressV1Req = AddDepositAddressV1Req = {})); class AddDepositAddressV1ReqBuilder { constructor(obj) { this.obj = obj; this.obj = obj; } /** * currency */ setCurrency(value) { this.obj.currency = value; return this; } /** * The chainId of currency, 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 only applies to multi-chain currencies; no need for single-chain currencies. */ 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; } /** * Get the final object. */ build() { return this.obj; } } exports.AddDepositAddressV1ReqBuilder = AddDepositAddressV1ReqBuilder; //# sourceMappingURL=model_add_deposit_address_v1_req.js.map