import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; import { VoteOption, WeightedVoteOption, WeightedVoteOptionAmino, WeightedVoteOptionSDKType, voteOptionFromJSON, voteOptionToJSON } from "./gov"; import { CommunityPoolSpendProposal, CommunityPoolSpendProposalProtoMsg, CommunityPoolSpendProposalSDKType, CommunityPoolSpendProposalWithDeposit, CommunityPoolSpendProposalWithDepositProtoMsg, CommunityPoolSpendProposalWithDepositSDKType } from "../../distribution/v1beta1/distribution"; import { TextProposal, TextProposalProtoMsg, TextProposalSDKType } from "../v1beta1/gov"; import { ParameterChangeProposal, ParameterChangeProposalProtoMsg, ParameterChangeProposalSDKType } from "../../params/v1beta1/params"; import { SoftwareUpgradeProposal, SoftwareUpgradeProposalProtoMsg, SoftwareUpgradeProposalSDKType, CancelSoftwareUpgradeProposal, CancelSoftwareUpgradeProposalProtoMsg, CancelSoftwareUpgradeProposalSDKType } from "../../upgrade/v1beta1/upgrade"; import { ClientUpdateProposal, ClientUpdateProposalProtoMsg, ClientUpdateProposalSDKType, UpgradeProposal, UpgradeProposalProtoMsg, UpgradeProposalSDKType } from "../../../ibc/core/client/v1/client"; import { BinaryReader, BinaryWriter } from "../../../binary"; /** * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary * proposal Content. */ export interface MsgSubmitProposal { messages: Any[]; initialDeposit: Coin[]; proposer: string; /** metadata is any arbitrary metadata attached to the proposal. */ metadata: string; } export interface MsgSubmitProposalProtoMsg { typeUrl: "/cosmos.gov.v1.MsgSubmitProposal"; value: Uint8Array; } /** * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary * proposal Content. */ export interface MsgSubmitProposalAmino { messages?: AnyAmino[]; initial_deposit?: CoinAmino[]; proposer?: string; /** metadata is any arbitrary metadata attached to the proposal. */ metadata?: string; } export interface MsgSubmitProposalAminoMsg { type: "cosmos-sdk/v1/MsgSubmitProposal"; value: MsgSubmitProposalAmino; } /** * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary * proposal Content. */ export interface MsgSubmitProposalSDKType { messages: AnySDKType[]; initial_deposit: CoinSDKType[]; proposer: string; metadata: string; } /** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ export interface MsgSubmitProposalResponse { proposalId: bigint; } export interface MsgSubmitProposalResponseProtoMsg { typeUrl: "/cosmos.gov.v1.MsgSubmitProposalResponse"; value: Uint8Array; } /** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ export interface MsgSubmitProposalResponseAmino { proposal_id?: string; } export interface MsgSubmitProposalResponseAminoMsg { type: "cosmos-sdk/v1/MsgSubmitProposalResponse"; value: MsgSubmitProposalResponseAmino; } /** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ export interface MsgSubmitProposalResponseSDKType { proposal_id: bigint; } /** * MsgExecLegacyContent is used to wrap the legacy content field into a message. * This ensures backwards compatibility with v1beta1.MsgSubmitProposal. */ export interface MsgExecLegacyContent { /** content is the proposal's content. */ content?: (CommunityPoolSpendProposal & CommunityPoolSpendProposalWithDeposit & TextProposal & ParameterChangeProposal & SoftwareUpgradeProposal & CancelSoftwareUpgradeProposal & ClientUpdateProposal & UpgradeProposal & Any) | undefined; /** authority must be the gov module address. */ authority: string; } export interface MsgExecLegacyContentProtoMsg { typeUrl: "/cosmos.gov.v1.MsgExecLegacyContent"; value: Uint8Array; } export type MsgExecLegacyContentEncoded = Omit & { /** content is the proposal's content. */content?: CommunityPoolSpendProposalProtoMsg | CommunityPoolSpendProposalWithDepositProtoMsg | TextProposalProtoMsg | ParameterChangeProposalProtoMsg | SoftwareUpgradeProposalProtoMsg | CancelSoftwareUpgradeProposalProtoMsg | ClientUpdateProposalProtoMsg | UpgradeProposalProtoMsg | AnyProtoMsg | undefined; }; /** * MsgExecLegacyContent is used to wrap the legacy content field into a message. * This ensures backwards compatibility with v1beta1.MsgSubmitProposal. */ export interface MsgExecLegacyContentAmino { /** content is the proposal's content. */ content?: AnyAmino; /** authority must be the gov module address. */ authority?: string; } export interface MsgExecLegacyContentAminoMsg { type: "cosmos-sdk/v1/MsgExecLegacyContent"; value: MsgExecLegacyContentAmino; } /** * MsgExecLegacyContent is used to wrap the legacy content field into a message. * This ensures backwards compatibility with v1beta1.MsgSubmitProposal. */ export interface MsgExecLegacyContentSDKType { content?: CommunityPoolSpendProposalSDKType | CommunityPoolSpendProposalWithDepositSDKType | TextProposalSDKType | ParameterChangeProposalSDKType | SoftwareUpgradeProposalSDKType | CancelSoftwareUpgradeProposalSDKType | ClientUpdateProposalSDKType | UpgradeProposalSDKType | AnySDKType | undefined; authority: string; } /** MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type. */ export interface MsgExecLegacyContentResponse {} export interface MsgExecLegacyContentResponseProtoMsg { typeUrl: "/cosmos.gov.v1.MsgExecLegacyContentResponse"; value: Uint8Array; } /** MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type. */ export interface MsgExecLegacyContentResponseAmino {} export interface MsgExecLegacyContentResponseAminoMsg { type: "cosmos-sdk/v1/MsgExecLegacyContentResponse"; value: MsgExecLegacyContentResponseAmino; } /** MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type. */ export interface MsgExecLegacyContentResponseSDKType {} /** MsgVote defines a message to cast a vote. */ export interface MsgVote { proposalId: bigint; voter: string; option: VoteOption; metadata: string; } export interface MsgVoteProtoMsg { typeUrl: "/cosmos.gov.v1.MsgVote"; value: Uint8Array; } /** MsgVote defines a message to cast a vote. */ export interface MsgVoteAmino { proposal_id?: string; voter?: string; option?: VoteOption; metadata?: string; } export interface MsgVoteAminoMsg { type: "cosmos-sdk/v1/MsgVote"; value: MsgVoteAmino; } /** MsgVote defines a message to cast a vote. */ export interface MsgVoteSDKType { proposal_id: bigint; voter: string; option: VoteOption; metadata: string; } /** MsgVoteResponse defines the Msg/Vote response type. */ export interface MsgVoteResponse {} export interface MsgVoteResponseProtoMsg { typeUrl: "/cosmos.gov.v1.MsgVoteResponse"; value: Uint8Array; } /** MsgVoteResponse defines the Msg/Vote response type. */ export interface MsgVoteResponseAmino {} export interface MsgVoteResponseAminoMsg { type: "cosmos-sdk/v1/MsgVoteResponse"; value: MsgVoteResponseAmino; } /** MsgVoteResponse defines the Msg/Vote response type. */ export interface MsgVoteResponseSDKType {} /** MsgVoteWeighted defines a message to cast a vote. */ export interface MsgVoteWeighted { proposalId: bigint; voter: string; options: WeightedVoteOption[]; metadata: string; } export interface MsgVoteWeightedProtoMsg { typeUrl: "/cosmos.gov.v1.MsgVoteWeighted"; value: Uint8Array; } /** MsgVoteWeighted defines a message to cast a vote. */ export interface MsgVoteWeightedAmino { proposal_id?: string; voter?: string; options?: WeightedVoteOptionAmino[]; metadata?: string; } export interface MsgVoteWeightedAminoMsg { type: "cosmos-sdk/v1/MsgVoteWeighted"; value: MsgVoteWeightedAmino; } /** MsgVoteWeighted defines a message to cast a vote. */ export interface MsgVoteWeightedSDKType { proposal_id: bigint; voter: string; options: WeightedVoteOptionSDKType[]; metadata: string; } /** MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. */ export interface MsgVoteWeightedResponse {} export interface MsgVoteWeightedResponseProtoMsg { typeUrl: "/cosmos.gov.v1.MsgVoteWeightedResponse"; value: Uint8Array; } /** MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. */ export interface MsgVoteWeightedResponseAmino {} export interface MsgVoteWeightedResponseAminoMsg { type: "cosmos-sdk/v1/MsgVoteWeightedResponse"; value: MsgVoteWeightedResponseAmino; } /** MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. */ export interface MsgVoteWeightedResponseSDKType {} /** MsgDeposit defines a message to submit a deposit to an existing proposal. */ export interface MsgDeposit { proposalId: bigint; depositor: string; amount: Coin[]; } export interface MsgDepositProtoMsg { typeUrl: "/cosmos.gov.v1.MsgDeposit"; value: Uint8Array; } /** MsgDeposit defines a message to submit a deposit to an existing proposal. */ export interface MsgDepositAmino { proposal_id?: string; depositor?: string; amount?: CoinAmino[]; } export interface MsgDepositAminoMsg { type: "cosmos-sdk/v1/MsgDeposit"; value: MsgDepositAmino; } /** MsgDeposit defines a message to submit a deposit to an existing proposal. */ export interface MsgDepositSDKType { proposal_id: bigint; depositor: string; amount: CoinSDKType[]; } /** MsgDepositResponse defines the Msg/Deposit response type. */ export interface MsgDepositResponse {} export interface MsgDepositResponseProtoMsg { typeUrl: "/cosmos.gov.v1.MsgDepositResponse"; value: Uint8Array; } /** MsgDepositResponse defines the Msg/Deposit response type. */ export interface MsgDepositResponseAmino {} export interface MsgDepositResponseAminoMsg { type: "cosmos-sdk/v1/MsgDepositResponse"; value: MsgDepositResponseAmino; } /** MsgDepositResponse defines the Msg/Deposit response type. */ export interface MsgDepositResponseSDKType {} function createBaseMsgSubmitProposal(): MsgSubmitProposal { return { messages: [], initialDeposit: [], proposer: "", metadata: "" }; } export const MsgSubmitProposal = { typeUrl: "/cosmos.gov.v1.MsgSubmitProposal", encode(message: MsgSubmitProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.messages) { Any.encode(v!, writer.uint32(10).fork()).ldelim(); } for (const v of message.initialDeposit) { Coin.encode(v!, writer.uint32(18).fork()).ldelim(); } if (message.proposer !== "") { writer.uint32(26).string(message.proposer); } if (message.metadata !== "") { writer.uint32(34).string(message.metadata); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): MsgSubmitProposal { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSubmitProposal(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.messages.push(Any.decode(reader, reader.uint32())); break; case 2: message.initialDeposit.push(Coin.decode(reader, reader.uint32())); break; case 3: message.proposer = reader.string(); break; case 4: message.metadata = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: Partial): MsgSubmitProposal { const message = createBaseMsgSubmitProposal(); message.messages = object.messages?.map(e => Any.fromPartial(e)) || []; message.initialDeposit = object.initialDeposit?.map(e => Coin.fromPartial(e)) || []; message.proposer = object.proposer ?? ""; message.metadata = object.metadata ?? ""; return message; }, fromAmino(object: MsgSubmitProposalAmino): MsgSubmitProposal { const message = createBaseMsgSubmitProposal(); message.messages = object.messages?.map(e => Any.fromAmino(e)) || []; message.initialDeposit = object.initial_deposit?.map(e => Coin.fromAmino(e)) || []; if (object.proposer !== undefined && object.proposer !== null) { message.proposer = object.proposer; } if (object.metadata !== undefined && object.metadata !== null) { message.metadata = object.metadata; } return message; }, toAmino(message: MsgSubmitProposal): MsgSubmitProposalAmino { const obj: any = {}; if (message.messages) { obj.messages = message.messages.map(e => e ? Any.toAmino(e) : undefined); } else { obj.messages = []; } if (message.initialDeposit) { obj.initial_deposit = message.initialDeposit.map(e => e ? Coin.toAmino(e) : undefined); } else { obj.initial_deposit = []; } obj.proposer = message.proposer; obj.metadata = message.metadata; return obj; }, fromAminoMsg(object: MsgSubmitProposalAminoMsg): MsgSubmitProposal { return MsgSubmitProposal.fromAmino(object.value); }, toAminoMsg(message: MsgSubmitProposal): MsgSubmitProposalAminoMsg { return { type: "cosmos-sdk/v1/MsgSubmitProposal", value: MsgSubmitProposal.toAmino(message) }; }, fromProtoMsg(message: MsgSubmitProposalProtoMsg): MsgSubmitProposal { return MsgSubmitProposal.decode(message.value); }, toProto(message: MsgSubmitProposal): Uint8Array { return MsgSubmitProposal.encode(message).finish(); }, toProtoMsg(message: MsgSubmitProposal): MsgSubmitProposalProtoMsg { return { typeUrl: "/cosmos.gov.v1.MsgSubmitProposal", value: MsgSubmitProposal.encode(message).finish() }; } }; function createBaseMsgSubmitProposalResponse(): MsgSubmitProposalResponse { return { proposalId: BigInt(0) }; } export const MsgSubmitProposalResponse = { typeUrl: "/cosmos.gov.v1.MsgSubmitProposalResponse", encode(message: MsgSubmitProposalResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): MsgSubmitProposalResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSubmitProposalResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.proposalId = reader.uint64(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: Partial): MsgSubmitProposalResponse { const message = createBaseMsgSubmitProposalResponse(); message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); return message; }, fromAmino(object: MsgSubmitProposalResponseAmino): MsgSubmitProposalResponse { const message = createBaseMsgSubmitProposalResponse(); if (object.proposal_id !== undefined && object.proposal_id !== null) { message.proposalId = BigInt(object.proposal_id); } return message; }, toAmino(message: MsgSubmitProposalResponse): MsgSubmitProposalResponseAmino { const obj: any = {}; obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; return obj; }, fromAminoMsg(object: MsgSubmitProposalResponseAminoMsg): MsgSubmitProposalResponse { return MsgSubmitProposalResponse.fromAmino(object.value); }, toAminoMsg(message: MsgSubmitProposalResponse): MsgSubmitProposalResponseAminoMsg { return { type: "cosmos-sdk/v1/MsgSubmitProposalResponse", value: MsgSubmitProposalResponse.toAmino(message) }; }, fromProtoMsg(message: MsgSubmitProposalResponseProtoMsg): MsgSubmitProposalResponse { return MsgSubmitProposalResponse.decode(message.value); }, toProto(message: MsgSubmitProposalResponse): Uint8Array { return MsgSubmitProposalResponse.encode(message).finish(); }, toProtoMsg(message: MsgSubmitProposalResponse): MsgSubmitProposalResponseProtoMsg { return { typeUrl: "/cosmos.gov.v1.MsgSubmitProposalResponse", value: MsgSubmitProposalResponse.encode(message).finish() }; } }; function createBaseMsgExecLegacyContent(): MsgExecLegacyContent { return { content: undefined, authority: "" }; } export const MsgExecLegacyContent = { typeUrl: "/cosmos.gov.v1.MsgExecLegacyContent", encode(message: MsgExecLegacyContent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.content !== undefined) { Any.encode((message.content as Any), writer.uint32(10).fork()).ldelim(); } if (message.authority !== "") { writer.uint32(18).string(message.authority); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): MsgExecLegacyContent { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgExecLegacyContent(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.content = (Cosmos_govv1beta1Content_InterfaceDecoder(reader) as Any); break; case 2: message.authority = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: Partial): MsgExecLegacyContent { const message = createBaseMsgExecLegacyContent(); message.content = object.content !== undefined && object.content !== null ? Any.fromPartial(object.content) : undefined; message.authority = object.authority ?? ""; return message; }, fromAmino(object: MsgExecLegacyContentAmino): MsgExecLegacyContent { const message = createBaseMsgExecLegacyContent(); if (object.content !== undefined && object.content !== null) { message.content = Cosmos_govv1beta1Content_FromAmino(object.content); } if (object.authority !== undefined && object.authority !== null) { message.authority = object.authority; } return message; }, toAmino(message: MsgExecLegacyContent): MsgExecLegacyContentAmino { const obj: any = {}; obj.content = message.content ? Cosmos_govv1beta1Content_ToAmino((message.content as Any)) : undefined; obj.authority = message.authority; return obj; }, fromAminoMsg(object: MsgExecLegacyContentAminoMsg): MsgExecLegacyContent { return MsgExecLegacyContent.fromAmino(object.value); }, toAminoMsg(message: MsgExecLegacyContent): MsgExecLegacyContentAminoMsg { return { type: "cosmos-sdk/v1/MsgExecLegacyContent", value: MsgExecLegacyContent.toAmino(message) }; }, fromProtoMsg(message: MsgExecLegacyContentProtoMsg): MsgExecLegacyContent { return MsgExecLegacyContent.decode(message.value); }, toProto(message: MsgExecLegacyContent): Uint8Array { return MsgExecLegacyContent.encode(message).finish(); }, toProtoMsg(message: MsgExecLegacyContent): MsgExecLegacyContentProtoMsg { return { typeUrl: "/cosmos.gov.v1.MsgExecLegacyContent", value: MsgExecLegacyContent.encode(message).finish() }; } }; function createBaseMsgExecLegacyContentResponse(): MsgExecLegacyContentResponse { return {}; } export const MsgExecLegacyContentResponse = { typeUrl: "/cosmos.gov.v1.MsgExecLegacyContentResponse", encode(_: MsgExecLegacyContentResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): MsgExecLegacyContentResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgExecLegacyContentResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(_: Partial): MsgExecLegacyContentResponse { const message = createBaseMsgExecLegacyContentResponse(); return message; }, fromAmino(_: MsgExecLegacyContentResponseAmino): MsgExecLegacyContentResponse { const message = createBaseMsgExecLegacyContentResponse(); return message; }, toAmino(_: MsgExecLegacyContentResponse): MsgExecLegacyContentResponseAmino { const obj: any = {}; return obj; }, fromAminoMsg(object: MsgExecLegacyContentResponseAminoMsg): MsgExecLegacyContentResponse { return MsgExecLegacyContentResponse.fromAmino(object.value); }, toAminoMsg(message: MsgExecLegacyContentResponse): MsgExecLegacyContentResponseAminoMsg { return { type: "cosmos-sdk/v1/MsgExecLegacyContentResponse", value: MsgExecLegacyContentResponse.toAmino(message) }; }, fromProtoMsg(message: MsgExecLegacyContentResponseProtoMsg): MsgExecLegacyContentResponse { return MsgExecLegacyContentResponse.decode(message.value); }, toProto(message: MsgExecLegacyContentResponse): Uint8Array { return MsgExecLegacyContentResponse.encode(message).finish(); }, toProtoMsg(message: MsgExecLegacyContentResponse): MsgExecLegacyContentResponseProtoMsg { return { typeUrl: "/cosmos.gov.v1.MsgExecLegacyContentResponse", value: MsgExecLegacyContentResponse.encode(message).finish() }; } }; function createBaseMsgVote(): MsgVote { return { proposalId: BigInt(0), voter: "", option: 0, metadata: "" }; } export const MsgVote = { typeUrl: "/cosmos.gov.v1.MsgVote", encode(message: MsgVote, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.voter !== "") { writer.uint32(18).string(message.voter); } if (message.option !== 0) { writer.uint32(24).int32(message.option); } if (message.metadata !== "") { writer.uint32(34).string(message.metadata); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): MsgVote { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgVote(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.proposalId = reader.uint64(); break; case 2: message.voter = reader.string(); break; case 3: message.option = (reader.int32() as any); break; case 4: message.metadata = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: Partial): MsgVote { const message = createBaseMsgVote(); message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); message.voter = object.voter ?? ""; message.option = object.option ?? 0; message.metadata = object.metadata ?? ""; return message; }, fromAmino(object: MsgVoteAmino): MsgVote { const message = createBaseMsgVote(); if (object.proposal_id !== undefined && object.proposal_id !== null) { message.proposalId = BigInt(object.proposal_id); } if (object.voter !== undefined && object.voter !== null) { message.voter = object.voter; } if (object.option !== undefined && object.option !== null) { message.option = voteOptionFromJSON(object.option); } if (object.metadata !== undefined && object.metadata !== null) { message.metadata = object.metadata; } return message; }, toAmino(message: MsgVote): MsgVoteAmino { const obj: any = {}; obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; obj.voter = message.voter; obj.option = voteOptionToJSON(message.option); obj.metadata = message.metadata; return obj; }, fromAminoMsg(object: MsgVoteAminoMsg): MsgVote { return MsgVote.fromAmino(object.value); }, toAminoMsg(message: MsgVote): MsgVoteAminoMsg { return { type: "cosmos-sdk/v1/MsgVote", value: MsgVote.toAmino(message) }; }, fromProtoMsg(message: MsgVoteProtoMsg): MsgVote { return MsgVote.decode(message.value); }, toProto(message: MsgVote): Uint8Array { return MsgVote.encode(message).finish(); }, toProtoMsg(message: MsgVote): MsgVoteProtoMsg { return { typeUrl: "/cosmos.gov.v1.MsgVote", value: MsgVote.encode(message).finish() }; } }; function createBaseMsgVoteResponse(): MsgVoteResponse { return {}; } export const MsgVoteResponse = { typeUrl: "/cosmos.gov.v1.MsgVoteResponse", encode(_: MsgVoteResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): MsgVoteResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgVoteResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(_: Partial): MsgVoteResponse { const message = createBaseMsgVoteResponse(); return message; }, fromAmino(_: MsgVoteResponseAmino): MsgVoteResponse { const message = createBaseMsgVoteResponse(); return message; }, toAmino(_: MsgVoteResponse): MsgVoteResponseAmino { const obj: any = {}; return obj; }, fromAminoMsg(object: MsgVoteResponseAminoMsg): MsgVoteResponse { return MsgVoteResponse.fromAmino(object.value); }, toAminoMsg(message: MsgVoteResponse): MsgVoteResponseAminoMsg { return { type: "cosmos-sdk/v1/MsgVoteResponse", value: MsgVoteResponse.toAmino(message) }; }, fromProtoMsg(message: MsgVoteResponseProtoMsg): MsgVoteResponse { return MsgVoteResponse.decode(message.value); }, toProto(message: MsgVoteResponse): Uint8Array { return MsgVoteResponse.encode(message).finish(); }, toProtoMsg(message: MsgVoteResponse): MsgVoteResponseProtoMsg { return { typeUrl: "/cosmos.gov.v1.MsgVoteResponse", value: MsgVoteResponse.encode(message).finish() }; } }; function createBaseMsgVoteWeighted(): MsgVoteWeighted { return { proposalId: BigInt(0), voter: "", options: [], metadata: "" }; } export const MsgVoteWeighted = { typeUrl: "/cosmos.gov.v1.MsgVoteWeighted", encode(message: MsgVoteWeighted, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.voter !== "") { writer.uint32(18).string(message.voter); } for (const v of message.options) { WeightedVoteOption.encode(v!, writer.uint32(26).fork()).ldelim(); } if (message.metadata !== "") { writer.uint32(34).string(message.metadata); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): MsgVoteWeighted { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgVoteWeighted(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.proposalId = reader.uint64(); break; case 2: message.voter = reader.string(); break; case 3: message.options.push(WeightedVoteOption.decode(reader, reader.uint32())); break; case 4: message.metadata = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: Partial): MsgVoteWeighted { const message = createBaseMsgVoteWeighted(); message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); message.voter = object.voter ?? ""; message.options = object.options?.map(e => WeightedVoteOption.fromPartial(e)) || []; message.metadata = object.metadata ?? ""; return message; }, fromAmino(object: MsgVoteWeightedAmino): MsgVoteWeighted { const message = createBaseMsgVoteWeighted(); if (object.proposal_id !== undefined && object.proposal_id !== null) { message.proposalId = BigInt(object.proposal_id); } if (object.voter !== undefined && object.voter !== null) { message.voter = object.voter; } message.options = object.options?.map(e => WeightedVoteOption.fromAmino(e)) || []; if (object.metadata !== undefined && object.metadata !== null) { message.metadata = object.metadata; } return message; }, toAmino(message: MsgVoteWeighted): MsgVoteWeightedAmino { const obj: any = {}; obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; obj.voter = message.voter; if (message.options) { obj.options = message.options.map(e => e ? WeightedVoteOption.toAmino(e) : undefined); } else { obj.options = []; } obj.metadata = message.metadata; return obj; }, fromAminoMsg(object: MsgVoteWeightedAminoMsg): MsgVoteWeighted { return MsgVoteWeighted.fromAmino(object.value); }, toAminoMsg(message: MsgVoteWeighted): MsgVoteWeightedAminoMsg { return { type: "cosmos-sdk/v1/MsgVoteWeighted", value: MsgVoteWeighted.toAmino(message) }; }, fromProtoMsg(message: MsgVoteWeightedProtoMsg): MsgVoteWeighted { return MsgVoteWeighted.decode(message.value); }, toProto(message: MsgVoteWeighted): Uint8Array { return MsgVoteWeighted.encode(message).finish(); }, toProtoMsg(message: MsgVoteWeighted): MsgVoteWeightedProtoMsg { return { typeUrl: "/cosmos.gov.v1.MsgVoteWeighted", value: MsgVoteWeighted.encode(message).finish() }; } }; function createBaseMsgVoteWeightedResponse(): MsgVoteWeightedResponse { return {}; } export const MsgVoteWeightedResponse = { typeUrl: "/cosmos.gov.v1.MsgVoteWeightedResponse", encode(_: MsgVoteWeightedResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): MsgVoteWeightedResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgVoteWeightedResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(_: Partial): MsgVoteWeightedResponse { const message = createBaseMsgVoteWeightedResponse(); return message; }, fromAmino(_: MsgVoteWeightedResponseAmino): MsgVoteWeightedResponse { const message = createBaseMsgVoteWeightedResponse(); return message; }, toAmino(_: MsgVoteWeightedResponse): MsgVoteWeightedResponseAmino { const obj: any = {}; return obj; }, fromAminoMsg(object: MsgVoteWeightedResponseAminoMsg): MsgVoteWeightedResponse { return MsgVoteWeightedResponse.fromAmino(object.value); }, toAminoMsg(message: MsgVoteWeightedResponse): MsgVoteWeightedResponseAminoMsg { return { type: "cosmos-sdk/v1/MsgVoteWeightedResponse", value: MsgVoteWeightedResponse.toAmino(message) }; }, fromProtoMsg(message: MsgVoteWeightedResponseProtoMsg): MsgVoteWeightedResponse { return MsgVoteWeightedResponse.decode(message.value); }, toProto(message: MsgVoteWeightedResponse): Uint8Array { return MsgVoteWeightedResponse.encode(message).finish(); }, toProtoMsg(message: MsgVoteWeightedResponse): MsgVoteWeightedResponseProtoMsg { return { typeUrl: "/cosmos.gov.v1.MsgVoteWeightedResponse", value: MsgVoteWeightedResponse.encode(message).finish() }; } }; function createBaseMsgDeposit(): MsgDeposit { return { proposalId: BigInt(0), depositor: "", amount: [] }; } export const MsgDeposit = { typeUrl: "/cosmos.gov.v1.MsgDeposit", encode(message: MsgDeposit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.depositor !== "") { writer.uint32(18).string(message.depositor); } for (const v of message.amount) { Coin.encode(v!, writer.uint32(26).fork()).ldelim(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): MsgDeposit { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgDeposit(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.proposalId = reader.uint64(); break; case 2: message.depositor = reader.string(); break; case 3: message.amount.push(Coin.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: Partial): MsgDeposit { const message = createBaseMsgDeposit(); message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); message.depositor = object.depositor ?? ""; message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; return message; }, fromAmino(object: MsgDepositAmino): MsgDeposit { const message = createBaseMsgDeposit(); if (object.proposal_id !== undefined && object.proposal_id !== null) { message.proposalId = BigInt(object.proposal_id); } if (object.depositor !== undefined && object.depositor !== null) { message.depositor = object.depositor; } message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; return message; }, toAmino(message: MsgDeposit): MsgDepositAmino { const obj: any = {}; obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; obj.depositor = message.depositor; if (message.amount) { obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); } else { obj.amount = []; } return obj; }, fromAminoMsg(object: MsgDepositAminoMsg): MsgDeposit { return MsgDeposit.fromAmino(object.value); }, toAminoMsg(message: MsgDeposit): MsgDepositAminoMsg { return { type: "cosmos-sdk/v1/MsgDeposit", value: MsgDeposit.toAmino(message) }; }, fromProtoMsg(message: MsgDepositProtoMsg): MsgDeposit { return MsgDeposit.decode(message.value); }, toProto(message: MsgDeposit): Uint8Array { return MsgDeposit.encode(message).finish(); }, toProtoMsg(message: MsgDeposit): MsgDepositProtoMsg { return { typeUrl: "/cosmos.gov.v1.MsgDeposit", value: MsgDeposit.encode(message).finish() }; } }; function createBaseMsgDepositResponse(): MsgDepositResponse { return {}; } export const MsgDepositResponse = { typeUrl: "/cosmos.gov.v1.MsgDepositResponse", encode(_: MsgDepositResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): MsgDepositResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgDepositResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(_: Partial): MsgDepositResponse { const message = createBaseMsgDepositResponse(); return message; }, fromAmino(_: MsgDepositResponseAmino): MsgDepositResponse { const message = createBaseMsgDepositResponse(); return message; }, toAmino(_: MsgDepositResponse): MsgDepositResponseAmino { const obj: any = {}; return obj; }, fromAminoMsg(object: MsgDepositResponseAminoMsg): MsgDepositResponse { return MsgDepositResponse.fromAmino(object.value); }, toAminoMsg(message: MsgDepositResponse): MsgDepositResponseAminoMsg { return { type: "cosmos-sdk/v1/MsgDepositResponse", value: MsgDepositResponse.toAmino(message) }; }, fromProtoMsg(message: MsgDepositResponseProtoMsg): MsgDepositResponse { return MsgDepositResponse.decode(message.value); }, toProto(message: MsgDepositResponse): Uint8Array { return MsgDepositResponse.encode(message).finish(); }, toProtoMsg(message: MsgDepositResponse): MsgDepositResponseProtoMsg { return { typeUrl: "/cosmos.gov.v1.MsgDepositResponse", value: MsgDepositResponse.encode(message).finish() }; } }; export const Cosmos_govv1beta1Content_InterfaceDecoder = (input: BinaryReader | Uint8Array): CommunityPoolSpendProposal | CommunityPoolSpendProposalWithDeposit | TextProposal | ParameterChangeProposal | SoftwareUpgradeProposal | CancelSoftwareUpgradeProposal | ClientUpdateProposal | UpgradeProposal | Any => { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const data = Any.decode(reader, reader.uint32(), true); switch (data.typeUrl) { case "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal": return CommunityPoolSpendProposal.decode(data.value, undefined, true); case "/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit": return CommunityPoolSpendProposalWithDeposit.decode(data.value, undefined, true); case "/cosmos.gov.v1beta1.TextProposal": return TextProposal.decode(data.value, undefined, true); case "/cosmos.params.v1beta1.ParameterChangeProposal": return ParameterChangeProposal.decode(data.value, undefined, true); case "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal": return SoftwareUpgradeProposal.decode(data.value, undefined, true); case "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal": return CancelSoftwareUpgradeProposal.decode(data.value, undefined, true); case "/ibc.core.client.v1.ClientUpdateProposal": return ClientUpdateProposal.decode(data.value, undefined, true); case "/ibc.core.client.v1.UpgradeProposal": return UpgradeProposal.decode(data.value, undefined, true); default: return data; } }; export const Cosmos_govv1beta1Content_FromAmino = (content: AnyAmino) => { switch (content.type) { case "cosmos-sdk/v1/CommunityPoolSpendProposal": return Any.fromPartial({ typeUrl: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal", value: CommunityPoolSpendProposal.encode(CommunityPoolSpendProposal.fromPartial(CommunityPoolSpendProposal.fromAmino(content.value))).finish() }); case "cosmos-sdk/v1/CommunityPoolSpendProposalWithDeposit": return Any.fromPartial({ typeUrl: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit", value: CommunityPoolSpendProposalWithDeposit.encode(CommunityPoolSpendProposalWithDeposit.fromPartial(CommunityPoolSpendProposalWithDeposit.fromAmino(content.value))).finish() }); case "cosmos-sdk/v1/TextProposal": return Any.fromPartial({ typeUrl: "/cosmos.gov.v1beta1.TextProposal", value: TextProposal.encode(TextProposal.fromPartial(TextProposal.fromAmino(content.value))).finish() }); case "cosmos-sdk/v1/ParameterChangeProposal": return Any.fromPartial({ typeUrl: "/cosmos.params.v1beta1.ParameterChangeProposal", value: ParameterChangeProposal.encode(ParameterChangeProposal.fromPartial(ParameterChangeProposal.fromAmino(content.value))).finish() }); case "cosmos-sdk/v1/SoftwareUpgradeProposal": return Any.fromPartial({ typeUrl: "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal", value: SoftwareUpgradeProposal.encode(SoftwareUpgradeProposal.fromPartial(SoftwareUpgradeProposal.fromAmino(content.value))).finish() }); case "cosmos-sdk/v1/CancelSoftwareUpgradeProposal": return Any.fromPartial({ typeUrl: "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal", value: CancelSoftwareUpgradeProposal.encode(CancelSoftwareUpgradeProposal.fromPartial(CancelSoftwareUpgradeProposal.fromAmino(content.value))).finish() }); case "cosmos-sdk/ClientUpdateProposal": return Any.fromPartial({ typeUrl: "/ibc.core.client.v1.ClientUpdateProposal", value: ClientUpdateProposal.encode(ClientUpdateProposal.fromPartial(ClientUpdateProposal.fromAmino(content.value))).finish() }); case "cosmos-sdk/UpgradeProposal": return Any.fromPartial({ typeUrl: "/ibc.core.client.v1.UpgradeProposal", value: UpgradeProposal.encode(UpgradeProposal.fromPartial(UpgradeProposal.fromAmino(content.value))).finish() }); default: return Any.fromAmino(content); } }; export const Cosmos_govv1beta1Content_ToAmino = (content: Any) => { switch (content.typeUrl) { case "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal": return { type: "cosmos-sdk/v1/CommunityPoolSpendProposal", value: CommunityPoolSpendProposal.toAmino(CommunityPoolSpendProposal.decode(content.value, undefined)) }; case "/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit": return { type: "cosmos-sdk/v1/CommunityPoolSpendProposalWithDeposit", value: CommunityPoolSpendProposalWithDeposit.toAmino(CommunityPoolSpendProposalWithDeposit.decode(content.value, undefined)) }; case "/cosmos.gov.v1beta1.TextProposal": return { type: "cosmos-sdk/v1/TextProposal", value: TextProposal.toAmino(TextProposal.decode(content.value, undefined)) }; case "/cosmos.params.v1beta1.ParameterChangeProposal": return { type: "cosmos-sdk/v1/ParameterChangeProposal", value: ParameterChangeProposal.toAmino(ParameterChangeProposal.decode(content.value, undefined)) }; case "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal": return { type: "cosmos-sdk/v1/SoftwareUpgradeProposal", value: SoftwareUpgradeProposal.toAmino(SoftwareUpgradeProposal.decode(content.value, undefined)) }; case "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal": return { type: "cosmos-sdk/v1/CancelSoftwareUpgradeProposal", value: CancelSoftwareUpgradeProposal.toAmino(CancelSoftwareUpgradeProposal.decode(content.value, undefined)) }; case "/ibc.core.client.v1.ClientUpdateProposal": return { type: "cosmos-sdk/ClientUpdateProposal", value: ClientUpdateProposal.toAmino(ClientUpdateProposal.decode(content.value, undefined)) }; case "/ibc.core.client.v1.UpgradeProposal": return { type: "cosmos-sdk/UpgradeProposal", value: UpgradeProposal.toAmino(UpgradeProposal.decode(content.value, undefined)) }; default: return Any.toAmino(content); } };