UNPKG

kucoin-universal-sdk

Version:
84 lines 2.45 kB
"use strict"; // Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. Object.defineProperty(exports, "__esModule", { value: true }); exports.GetFiatPriceReqBuilder = exports.GetFiatPriceReq = void 0; const class_transformer_1 = require("class-transformer"); class GetFiatPriceReq { /** * Private constructor, please use the corresponding static methods to construct the object. */ constructor() { /** * Ticker symbol of a base currency, e.g. USD, EUR. Default is USD */ this.base = 'USD'; } /** * Creates a new instance of the `GetFiatPriceReq` class. * The builder pattern allows step-by-step construction of a `GetFiatPriceReq` object. */ static builder() { return new GetFiatPriceReqBuilder(new GetFiatPriceReq()); } /** * Creates a new instance of the `GetFiatPriceReq` class with the given data. */ static create(data) { let obj = new GetFiatPriceReq(); if (data.base) { obj.base = data.base; } else { obj.base = 'USD'; } obj.currencies = data.currencies; 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 GetFiatPriceReq(), jsonObject); } } exports.GetFiatPriceReq = GetFiatPriceReq; class GetFiatPriceReqBuilder { constructor(obj) { this.obj = obj; this.obj = obj; } /** * Ticker symbol of a base currency, e.g. USD, EUR. Default is USD */ setBase(value) { this.obj.base = value; return this; } /** * Comma-separated cryptocurrencies to be converted into fiat, e.g.: BTC,ETH, etc. Default to return the fiat price of all currencies. */ setCurrencies(value) { this.obj.currencies = value; return this; } /** * Get the final object. */ build() { return this.obj; } } exports.GetFiatPriceReqBuilder = GetFiatPriceReqBuilder; //# sourceMappingURL=model_get_fiat_price_req.js.map