"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.registry = exports.load = exports.MessageComposer = void 0;
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
var _tx = require("./tx");
var registry = exports.registry = [["/cosmos.gov.v1.MsgSubmitProposal", _tx.MsgSubmitProposal], ["/cosmos.gov.v1.MsgExecLegacyContent", _tx.MsgExecLegacyContent], ["/cosmos.gov.v1.MsgVote", _tx.MsgVote], ["/cosmos.gov.v1.MsgVoteWeighted", _tx.MsgVoteWeighted], ["/cosmos.gov.v1.MsgDeposit", _tx.MsgDeposit]];
var load = exports.load = function load(protoRegistry) {
  registry.forEach(function (_ref) {
    var _ref2 = (0, _slicedToArray2["default"])(_ref, 2),
      typeUrl = _ref2[0],
      mod = _ref2[1];
    protoRegistry.register(typeUrl, mod);
  });
};
var MessageComposer = exports.MessageComposer = {
  encoded: {
    submitProposal: function submitProposal(value) {
      return {
        typeUrl: "/cosmos.gov.v1.MsgSubmitProposal",
        value: _tx.MsgSubmitProposal.encode(value).finish()
      };
    },
    execLegacyContent: function execLegacyContent(value) {
      return {
        typeUrl: "/cosmos.gov.v1.MsgExecLegacyContent",
        value: _tx.MsgExecLegacyContent.encode(value).finish()
      };
    },
    vote: function vote(value) {
      return {
        typeUrl: "/cosmos.gov.v1.MsgVote",
        value: _tx.MsgVote.encode(value).finish()
      };
    },
    voteWeighted: function voteWeighted(value) {
      return {
        typeUrl: "/cosmos.gov.v1.MsgVoteWeighted",
        value: _tx.MsgVoteWeighted.encode(value).finish()
      };
    },
    deposit: function deposit(value) {
      return {
        typeUrl: "/cosmos.gov.v1.MsgDeposit",
        value: _tx.MsgDeposit.encode(value).finish()
      };
    }
  },
  withTypeUrl: {
    submitProposal: function submitProposal(value) {
      return {
        typeUrl: "/cosmos.gov.v1.MsgSubmitProposal",
        value: value
      };
    },
    execLegacyContent: function execLegacyContent(value) {
      return {
        typeUrl: "/cosmos.gov.v1.MsgExecLegacyContent",
        value: value
      };
    },
    vote: function vote(value) {
      return {
        typeUrl: "/cosmos.gov.v1.MsgVote",
        value: value
      };
    },
    voteWeighted: function voteWeighted(value) {
      return {
        typeUrl: "/cosmos.gov.v1.MsgVoteWeighted",
        value: value
      };
    },
    deposit: function deposit(value) {
      return {
        typeUrl: "/cosmos.gov.v1.MsgDeposit",
        value: value
      };
    }
  },
  fromJSON: {
    submitProposal: function submitProposal(value) {
      return {
        typeUrl: "/cosmos.gov.v1.MsgSubmitProposal",
        value: _tx.MsgSubmitProposal.fromJSON(value)
      };
    },
    execLegacyContent: function execLegacyContent(value) {
      return {
        typeUrl: "/cosmos.gov.v1.MsgExecLegacyContent",
        value: _tx.MsgExecLegacyContent.fromJSON(value)
      };
    },
    vote: function vote(value) {
      return {
        typeUrl: "/cosmos.gov.v1.MsgVote",
        value: _tx.MsgVote.fromJSON(value)
      };
    },
    voteWeighted: function voteWeighted(value) {
      return {
        typeUrl: "/cosmos.gov.v1.MsgVoteWeighted",
        value: _tx.MsgVoteWeighted.fromJSON(value)
      };
    },
    deposit: function deposit(value) {
      return {
        typeUrl: "/cosmos.gov.v1.MsgDeposit",
        value: _tx.MsgDeposit.fromJSON(value)
      };
    }
  },
  fromPartial: {
    submitProposal: function submitProposal(value) {
      return {
        typeUrl: "/cosmos.gov.v1.MsgSubmitProposal",
        value: _tx.MsgSubmitProposal.fromPartial(value)
      };
    },
    execLegacyContent: function execLegacyContent(value) {
      return {
        typeUrl: "/cosmos.gov.v1.MsgExecLegacyContent",
        value: _tx.MsgExecLegacyContent.fromPartial(value)
      };
    },
    vote: function vote(value) {
      return {
        typeUrl: "/cosmos.gov.v1.MsgVote",
        value: _tx.MsgVote.fromPartial(value)
      };
    },
    voteWeighted: function voteWeighted(value) {
      return {
        typeUrl: "/cosmos.gov.v1.MsgVoteWeighted",
        value: _tx.MsgVoteWeighted.fromPartial(value)
      };
    },
    deposit: function deposit(value) {
      return {
        typeUrl: "/cosmos.gov.v1.MsgDeposit",
        value: _tx.MsgDeposit.fromPartial(value)
      };
    }
  }
};