@pokt-network/pocket-js
Version:
Pocket-js core package with the main functionalities to interact with the Pocket Network.
60 lines • 1.89 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.QueryNodeClaimResponse = void 0;
var msg_claim_1 = require("./msg-claim");
/**
*
*
* @class QueryNodeClaimResponse
*/
var QueryNodeClaimResponse = /** @class */ (function () {
/**
* Query Node Claim Response.
* @constructor
* @param {MsgClaim} msgClaim - Message claim object.
*/
function QueryNodeClaimResponse(msgClaim) {
this.msgClaim = msgClaim;
if (!this.isValid()) {
throw new TypeError("Invalid QueryNodeClaimResponse properties.");
}
}
/**
*
* Creates a QueryNodeClaimResponse object using a JSON string
* @param {String} json - JSON string.
* @returns {QueryNodeClaimResponse} - QueryNodeClaimResponse object.
* @memberof QueryNodeClaimResponse
*/
QueryNodeClaimResponse.fromJSON = function (json) {
try {
var jsonObject = JSON.parse(json);
var msgClaim = msg_claim_1.MsgClaim.fromJSON(JSON.stringify(jsonObject.value));
return new QueryNodeClaimResponse(msgClaim);
}
catch (error) {
throw error;
}
};
/**
*
* Creates a JSON object with the QueryNodeClaimResponse properties
* @returns {JSON} - JSON Object.
* @memberof QueryNodeClaimResponse
*/
QueryNodeClaimResponse.prototype.toJSON = function () {
return this.msgClaim.toJSON();
};
/**
*
* Check if the QueryNodeClaimResponse object is valid
* @returns {boolean} - True or false.
* @memberof QueryNodeClaimResponse
*/
QueryNodeClaimResponse.prototype.isValid = function () {
return this.msgClaim.isValid();
};
return QueryNodeClaimResponse;
}());
exports.QueryNodeClaimResponse = QueryNodeClaimResponse;
//# sourceMappingURL=query-node-claim-response.js.map