UNPKG

@pokt-network/pocket-js

Version:

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

48 lines 1.59 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.QueryNodeReceiptResponse = void 0; var stored_receipt_1 = require("../stored-receipt"); /** * * * @class QueryNodeReceiptResponse */ var QueryNodeReceiptResponse = /** @class */ (function () { /** * QueryNodeReceiptResponse. * @constructor * @param {StoredReceipt} nodeReceipt - Amount staked by the node. */ function QueryNodeReceiptResponse(nodeReceipt) { this.nodeReceipt = nodeReceipt; } /** * * Creates a QueryNodeReceiptResponse object using a JSON string * @param {String} json - JSON string. * @returns {QueryNodeReceiptResponse} - QueryNodeReceiptResponse object. * @memberof QueryNodeReceiptResponse */ QueryNodeReceiptResponse.fromJSON = function (json) { try { var jsonObject = JSON.parse(json); var storedReceipt = stored_receipt_1.StoredReceipt.fromJSON(JSON.stringify(jsonObject.value)); return new QueryNodeReceiptResponse(storedReceipt); } catch (error) { throw error; } }; /** * * Creates a JSON object with the QueryNodeReceiptResponse properties * @returns {JSON} - JSON Object. * @memberof QueryNodeReceiptResponse */ QueryNodeReceiptResponse.prototype.toJSON = function () { return this.nodeReceipt.toJSON(); }; return QueryNodeReceiptResponse; }()); exports.QueryNodeReceiptResponse = QueryNodeReceiptResponse; //# sourceMappingURL=query-node-receipt-response.js.map