UNPKG

@pokt-network/pocket-js

Version:

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

61 lines 2.16 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); exports.MsgNodeUnstake = void 0; var tx_msg_1 = require("./tx-msg"); var utils_1 = require("./../../../utils"); /** * Model representing a MsgNodeStake to unstake as an Node in the Pocket Network */ var MsgNodeUnstake = /** @class */ (function (_super) { __extends(MsgNodeUnstake, _super); /** * @param {string} nodeAddress - Node address */ function MsgNodeUnstake(nodeAddress) { var _this = _super.call(this) || this; _this.AMINO_KEY = "pos/MsgBeginUnstake"; _this.nodeAddress = nodeAddress; var errorOrUndefined = utils_1.validateAddressHex(_this.nodeAddress); if (utils_1.typeGuard(errorOrUndefined, Error)) { throw errorOrUndefined; } return _this; } /** * Converts an Msg Object to StdSignDoc * @returns {object} - Msg type key value. * @memberof MsgNodeUnstake */ MsgNodeUnstake.prototype.toStdSignDocMsgObj = function () { return { type: this.AMINO_KEY, value: { validator_address: this.nodeAddress.toLowerCase() } }; }; /** * Converts an Msg Object to StdTx * @returns {any} - Msg type key value. * @memberof MsgNodeUnstake */ MsgNodeUnstake.prototype.toStdTxMsgObj = function () { return this.toStdSignDocMsgObj(); }; return MsgNodeUnstake; }(tx_msg_1.TxMsg)); exports.MsgNodeUnstake = MsgNodeUnstake; //# sourceMappingURL=msg-node-unstake.js.map