UNPKG

@pokt-network/pocket-js

Version:

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

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