UNPKG

@pokt-network/pocket-js

Version:

Pocket-js core package with the main functionalities to interact with the Pocket Network.

58 lines 1.68 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.QueryAppResponse = void 0; var application_1 = require("../application"); /** * * * @class QueryAppResponse */ var QueryAppResponse = /** @class */ (function () { /** * Query app Response. * @constructor * @param {Application} application - Application object. */ function QueryAppResponse(application) { this.application = application; if (!this.isValid()) { throw new TypeError("Invalid Query app properties length."); } } /** * * Creates a QueryAppResponse object using a JSON string * @param {String} json - JSON string. * @returns {QueryAppResponse} - QueryAppResponse object. * @memberof QueryAppResponse */ QueryAppResponse.fromJSON = function (json) { try { return new QueryAppResponse(application_1.Application.fromJSON(json)); } catch (error) { throw error; } }; /** * * Creates a JSON object with the QueryAppResponse properties * @returns {JSON} - JSON Object. * @memberof QueryAppResponse */ QueryAppResponse.prototype.toJSON = function () { return this.application.toJSON(); }; /** * * Check if the QueryAppResponse object is valid * @returns {boolean} - True or false. * @memberof QueryAppResponse */ QueryAppResponse.prototype.isValid = function () { return this.application.isValid(); }; return QueryAppResponse; }()); exports.QueryAppResponse = QueryAppResponse; //# sourceMappingURL=query-app-response.js.map