import { Any } from "../../../google/protobuf/any"; import { Coin } from "../../base/v1beta1/coin"; import { VoteOption, WeightedVoteOption } from "./gov"; import { Rpc } from "@osmonauts/helpers"; import * as _m0 from "protobufjs/minimal"; import { MsgSubmitProposal, MsgSubmitProposalResponse, MsgExecLegacyContent, MsgExecLegacyContentResponse, MsgVote, MsgVoteResponse, MsgVoteWeighted, MsgVoteWeightedResponse, MsgDeposit, MsgDepositResponse } from "./tx"; /** Msg defines the RPC service */ export interface Msg { submitProposal(request: MsgSubmitProposal): Promise; /*SubmitProposal defines a method to create new proposal given a content.*/ execLegacyContent(request: MsgExecLegacyContent): Promise; /*ExecLegacyContent defines a Msg to be in included in a MsgSubmitProposal to execute a legacy content-based proposal.*/ vote(request: MsgVote): Promise; /*Vote defines a method to add a vote on a specific proposal.*/ voteWeighted(request: MsgVoteWeighted): Promise; /*VoteWeighted defines a method to add a weighted vote on a specific proposal.*/ deposit(request: MsgDeposit): Promise; /*Deposit defines a method to add deposit on a specific proposal.*/ } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; constructor(rpc: Rpc) { this.rpc = rpc; this.submitProposal = this.submitProposal.bind(this); this.execLegacyContent = this.execLegacyContent.bind(this); this.vote = this.vote.bind(this); this.voteWeighted = this.voteWeighted.bind(this); this.deposit = this.deposit.bind(this); } submitProposal(request: MsgSubmitProposal): Promise { const data = MsgSubmitProposal.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1.Msg", "SubmitProposal", data); return promise.then(data => MsgSubmitProposalResponse.decode(new _m0.Reader(data))); } execLegacyContent(request: MsgExecLegacyContent): Promise { const data = MsgExecLegacyContent.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1.Msg", "ExecLegacyContent", data); return promise.then(data => MsgExecLegacyContentResponse.decode(new _m0.Reader(data))); } vote(request: MsgVote): Promise { const data = MsgVote.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1.Msg", "Vote", data); return promise.then(data => MsgVoteResponse.decode(new _m0.Reader(data))); } voteWeighted(request: MsgVoteWeighted): Promise { const data = MsgVoteWeighted.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1.Msg", "VoteWeighted", data); return promise.then(data => MsgVoteWeightedResponse.decode(new _m0.Reader(data))); } deposit(request: MsgDeposit): Promise { const data = MsgDeposit.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1.Msg", "Deposit", data); return promise.then(data => MsgDepositResponse.decode(new _m0.Reader(data))); } }