Add support for MsgSubmitProposal and MsgVote
This commit is contained in:
parent
07b7bb7ec5
commit
1b8eed0479
@ -26,6 +26,7 @@ and this project adheres to
|
||||
configure the HD path of the faucet accounts ([#832]).
|
||||
- @cosmjs/cosmwasm-stargate: Add field `ibcPortId` to `Contract` ([#836]).
|
||||
- @cosmjs/stargate: Add `GovExtension` for query client.
|
||||
- @cosmjs/stargate: Add support for `MsgSubmitProposal` and `MsgVote`.
|
||||
|
||||
[#832]: https://github.com/cosmos/cosmjs/issues/832
|
||||
[#836]: https://github.com/cosmos/cosmjs/issues/836
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import { EncodeObject } from "@cosmjs/proto-signing";
|
||||
import { MsgSend } from "cosmjs-types/cosmos/bank/v1beta1/tx";
|
||||
import { MsgWithdrawDelegatorReward } from "cosmjs-types/cosmos/distribution/v1beta1/tx";
|
||||
import { MsgSubmitProposal, MsgVote } from "cosmjs-types/cosmos/gov/v1beta1/tx";
|
||||
import { MsgDelegate, MsgUndelegate } from "cosmjs-types/cosmos/staking/v1beta1/tx";
|
||||
import { MsgTransfer } from "cosmjs-types/ibc/applications/transfer/v1/tx";
|
||||
|
||||
@ -59,3 +60,23 @@ export function isMsgTransferEncodeObject(
|
||||
): encodeObject is MsgTransferEncodeObject {
|
||||
return (encodeObject as MsgTransferEncodeObject).typeUrl === "/ibc.applications.transfer.v1.MsgTransfer";
|
||||
}
|
||||
|
||||
export interface MsgSubmitProposalEncodeObject extends EncodeObject {
|
||||
readonly typeUrl: "/cosmos.gov.v1beta1.MsgSubmitProposal";
|
||||
readonly value: Partial<MsgSubmitProposal>;
|
||||
}
|
||||
|
||||
export function isMsgSubmitProposalEncodeObject(
|
||||
encodeObject: EncodeObject,
|
||||
): encodeObject is MsgSubmitProposalEncodeObject {
|
||||
return (encodeObject as MsgSubmitProposalEncodeObject).typeUrl === "/cosmos.gov.v1beta1.MsgSubmitProposal";
|
||||
}
|
||||
|
||||
export interface MsgVoteEncodeObject extends EncodeObject {
|
||||
readonly typeUrl: "/cosmos.gov.v1beta1.MsgVote";
|
||||
readonly value: Partial<MsgVote>;
|
||||
}
|
||||
|
||||
export function isMsgVoteEncodeObject(encodeObject: EncodeObject): encodeObject is MsgVoteEncodeObject {
|
||||
return (encodeObject as MsgVoteEncodeObject).typeUrl === "/cosmos.gov.v1beta1.MsgVote";
|
||||
}
|
||||
|
||||
@ -42,13 +42,17 @@ export { AminoConverter, AminoTypes } from "./aminotypes";
|
||||
export {
|
||||
isMsgDelegateEncodeObject,
|
||||
isMsgSendEncodeObject,
|
||||
isMsgSubmitProposalEncodeObject,
|
||||
isMsgTransferEncodeObject,
|
||||
isMsgUndelegateEncodeObject,
|
||||
isMsgVoteEncodeObject,
|
||||
isMsgWithdrawDelegatorRewardEncodeObject,
|
||||
MsgDelegateEncodeObject,
|
||||
MsgSendEncodeObject,
|
||||
MsgSubmitProposalEncodeObject,
|
||||
MsgTransferEncodeObject,
|
||||
MsgUndelegateEncodeObject,
|
||||
MsgVoteEncodeObject,
|
||||
MsgWithdrawDelegatorRewardEncodeObject,
|
||||
} from "./encodeobjects";
|
||||
export { calculateFee, GasPrice } from "./fee";
|
||||
|
||||
@ -22,6 +22,7 @@ import {
|
||||
MsgWithdrawDelegatorReward,
|
||||
MsgWithdrawValidatorCommission,
|
||||
} from "cosmjs-types/cosmos/distribution/v1beta1/tx";
|
||||
import { MsgSubmitProposal, MsgVote } from "cosmjs-types/cosmos/gov/v1beta1/tx";
|
||||
import {
|
||||
MsgBeginRedelegate,
|
||||
MsgCreateValidator,
|
||||
@ -75,6 +76,8 @@ export const defaultRegistryTypes: ReadonlyArray<[string, GeneratedType]> = [
|
||||
["/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", MsgSetWithdrawAddress],
|
||||
["/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", MsgWithdrawDelegatorReward],
|
||||
["/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", MsgWithdrawValidatorCommission],
|
||||
["/cosmos.gov.v1beta1.MsgSubmitProposal", MsgSubmitProposal],
|
||||
["/cosmos.gov.v1beta1.MsgVote", MsgVote],
|
||||
["/cosmos.staking.v1beta1.MsgBeginRedelegate", MsgBeginRedelegate],
|
||||
["/cosmos.staking.v1beta1.MsgCreateValidator", MsgCreateValidator],
|
||||
["/cosmos.staking.v1beta1.MsgDelegate", MsgDelegate],
|
||||
|
||||
Loading…
Reference in New Issue
Block a user