@provenanceio/wallet-utils
Version:
Typescript Utilities for Provenance Blockchain Wallet
30 lines (26 loc) • 783 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.msgVoteWeighted = void 0;
var _utils = require("../../../../utils");
/**
* Formats MsgVoteWeighted messages for display
* @param message of type MsgVoteWeighted
* @returns object with MsgVoteWeighted fields
*/
var msgVoteWeighted = function msgVoteWeighted(message) {
return {
typeName: 'MsgVoteWeighted',
proposalId: message.getProposalId(),
voter: message.getVoter(),
optionsList: message.getOptionsList().map(function (item) {
return {
option: _utils.govVoteOptions[item.getOption()],
// Convert weight to a percent
weight: "".concat(Number(item.getWeight()) * 100, "%")
};
})
};
};
exports.msgVoteWeighted = msgVoteWeighted;