UNPKG

kucoin-universal-sdk

Version:
178 lines 6.31 kB
"use strict"; // Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. Object.defineProperty(exports, "__esModule", { value: true }); exports.WithdrawalV3ReqBuilder = exports.WithdrawalV3Req = void 0; const class_transformer_1 = require("class-transformer"); class WithdrawalV3Req { /** * Private constructor, please use the corresponding static methods to construct the object. */ constructor() { /** * The chainId of currency, For a currency with multiple chains, it is recommended to specify the chain parameter instead of using the default chain; you can query the chainId through the response of the GET /api/v3/currencies/{currency} interface. */ this.chain = 'eth'; /** * Internal withdrawal or not. Default: False */ this.isInner = false; // @ts-ignore this.currency = null; // @ts-ignore this.amount = null; // @ts-ignore this.toAddress = null; // @ts-ignore this.withdrawType = null; } /** * Creates a new instance of the `WithdrawalV3Req` class. * The builder pattern allows step-by-step construction of a `WithdrawalV3Req` object. */ static builder() { return new WithdrawalV3ReqBuilder(new WithdrawalV3Req()); } /** * Creates a new instance of the `WithdrawalV3Req` class with the given data. */ static create(data) { let obj = new WithdrawalV3Req(); obj.currency = data.currency; if (data.chain) { obj.chain = data.chain; } else { obj.chain = 'eth'; } obj.amount = data.amount; obj.memo = data.memo; if (data.isInner) { obj.isInner = data.isInner; } else { obj.isInner = false; } obj.remark = data.remark; obj.feeDeductType = data.feeDeductType; obj.toAddress = data.toAddress; obj.withdrawType = data.withdrawType; 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 WithdrawalV3Req(), jsonObject); } } exports.WithdrawalV3Req = WithdrawalV3Req; (function (WithdrawalV3Req) { let WithdrawTypeEnum; (function (WithdrawTypeEnum) { /** * */ WithdrawTypeEnum[WithdrawTypeEnum["ADDRESS"] = 'ADDRESS'] = "ADDRESS"; /** * */ WithdrawTypeEnum[WithdrawTypeEnum["UID"] = 'UID'] = "UID"; /** * */ WithdrawTypeEnum[WithdrawTypeEnum["MAIL"] = 'MAIL'] = "MAIL"; /** * */ WithdrawTypeEnum[WithdrawTypeEnum["PHONE"] = 'PHONE'] = "PHONE"; })(WithdrawTypeEnum = WithdrawalV3Req.WithdrawTypeEnum || (WithdrawalV3Req.WithdrawTypeEnum = {})); })(WithdrawalV3Req || (exports.WithdrawalV3Req = WithdrawalV3Req = {})); class WithdrawalV3ReqBuilder { constructor(obj) { this.obj = obj; this.obj = obj; } /** * currency */ setCurrency(value) { this.obj.currency = value; return this; } /** * The chainId of currency, For a currency with multiple chains, it is recommended to specify the chain parameter instead of using the default chain; you can query the chainId through the response of the GET /api/v3/currencies/{currency} interface. */ setChain(value) { this.obj.chain = value; return this; } /** * Withdrawal amount, a positive number which is a multiple of the amount precision */ setAmount(value) { this.obj.amount = value; return this; } /** * Address remark. If there’s no remark, it is empty. When you withdraw from other platforms to KuCoin, you need to fill in memo(tag). Be careful: If you do not fill in memo(tag), your deposit may not be available. */ setMemo(value) { this.obj.memo = value; return this; } /** * Internal withdrawal or not. Default: False */ setIsInner(value) { this.obj.isInner = value; return this; } /** * Remark */ setRemark(value) { this.obj.remark = value; return this; } /** * Withdrawal fee deduction type: INTERNAL, EXTERNAL, or not specified 1. INTERNAL: Deduct the transaction fees from your withdrawal amount 2. EXTERNAL: Deduct the transaction fees from your main account 3. If you don\'t specify the feeDeductType parameter, when the balance in your main account is sufficient to support the withdrawal, the system will initially deduct the transaction fees from your main account. But if the balance in your main account is not sufficient to support the withdrawal, the system will deduct the fees from your withdrawal amount. For example: Suppose you are going to withdraw 1 BTC from the KuCoin platform (transaction fee: 0.0001BTC), if the balance in your main account is insufficient, the system will deduct the transaction fees from your withdrawal amount. In this case, you will be receiving 0.9999BTC. */ setFeeDeductType(value) { this.obj.feeDeductType = value; return this; } /** * Withdrawal address */ setToAddress(value) { this.obj.toAddress = value; return this; } /** * Withdrawal type, ADDRESS (withdrawal address), UID, MAIL (email), PHONE (mobile phone number). Note: If you withdraw by uid/mail/phone, there will be rate limits: 3 times/10 seconds, 50 times/24 hours (calculated on a rolling basis based on the first request time) */ setWithdrawType(value) { this.obj.withdrawType = value; return this; } /** * Get the final object. */ build() { return this.obj; } } exports.WithdrawalV3ReqBuilder = WithdrawalV3ReqBuilder; //# sourceMappingURL=model_withdrawal_v3_req.js.map