sidebar_position |
---|
9 |
The group
module is responsible for the creation and management of on-chain multisig accounts and enables voting for message execution based on configurable decision policies.
For more information, visit https://docs.cosmos.network/main/modules/group/
Msg
is the cosmos.group.v1 Msg service.
service Msg {
// CreateGroup creates a new group with an admin account address, a list of members and some optional metadata.
rpc CreateGroup(MsgCreateGroup) returns (MsgCreateGroupResponse);
// UpdateGroupMembers updates the group members with given group id and admin address.
rpc UpdateGroupMembers(MsgUpdateGroupMembers) returns (MsgUpdateGroupMembersResponse);
// UpdateGroupAdmin updates the group admin with given group id and previous admin address.
rpc UpdateGroupAdmin(MsgUpdateGroupAdmin) returns (MsgUpdateGroupAdminResponse);
// UpdateGroupMetadata updates the group metadata with given group id and admin address.
rpc UpdateGroupMetadata(MsgUpdateGroupMetadata) returns (MsgUpdateGroupMetadataResponse);
// CreateGroupPolicy creates a new group policy using given DecisionPolicy.
rpc CreateGroupPolicy(MsgCreateGroupPolicy) returns (MsgCreateGroupPolicyResponse);
// CreateGroupWithPolicy creates a new group with policy.
rpc CreateGroupWithPolicy(MsgCreateGroupWithPolicy) returns (MsgCreateGroupWithPolicyResponse);
// UpdateGroupPolicyAdmin updates a group policy admin.
rpc UpdateGroupPolicyAdmin(MsgUpdateGroupPolicyAdmin) returns (MsgUpdateGroupPolicyAdminResponse);
// UpdateGroupPolicyDecisionPolicy allows a group policy's decision policy to be updated.
rpc UpdateGroupPolicyDecisionPolicy(MsgUpdateGroupPolicyDecisionPolicy)
returns (MsgUpdateGroupPolicyDecisionPolicyResponse);
// UpdateGroupPolicyMetadata updates a group policy metadata.
rpc UpdateGroupPolicyMetadata(MsgUpdateGroupPolicyMetadata) returns (MsgUpdateGroupPolicyMetadataResponse);
// SubmitProposal submits a new proposal.
rpc SubmitProposal(MsgSubmitProposal) returns (MsgSubmitProposalResponse);
// WithdrawProposal aborts a proposal.
rpc WithdrawProposal(MsgWithdrawProposal) returns (MsgWithdrawProposalResponse);
// Vote allows a voter to vote on a proposal.
rpc Vote(MsgVote) returns (MsgVoteResponse);
// Exec executes a proposal.
rpc Exec(MsgExec) returns (MsgExecResponse);
// LeaveGroup allows a group member to leave the group.
rpc LeaveGroup(MsgLeaveGroup) returns (MsgLeaveGroupResponse);
}
MsgCreateGroup
is the Msg/CreateGroup
request type.
message MsgCreateGroup {
option (cosmos.msg.v1.signer) = "admin";
// admin is the account address of the group admin.
string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// members defines the group members.
repeated Member members = 2 [(gogoproto.nullable) = false];
// metadata is any arbitrary metadata to attached to the group.
string metadata = 3;
}
MsgCreateGroupResponse
is the Msg/CreateGroup
response type.
message MsgCreateGroupResponse {
// group_id is the unique ID of the newly created group.
uint64 group_id = 1;
}
MsgUpdateGroupMembers
is the Msg/UpdateGroupMembers
request type.
message MsgUpdateGroupMembers {
option (cosmos.msg.v1.signer) = "admin";
// admin is the account address of the group admin.
string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// group_id is the unique ID of the group.
uint64 group_id = 2;
// member_updates is the list of members to update,
// set weight to 0 to remove a member.
repeated Member member_updates = 3 [(gogoproto.nullable) = false];
}
MsgUpdateGroupMembersResponse
is the Msg/UpdateGroupMembers
response type.
message MsgUpdateGroupMembersResponse {}
MsgUpdateGroupAdmin
is the Msg/UpdateGroupAdmin
request type.
message MsgUpdateGroupAdmin {
option (cosmos.msg.v1.signer) = "admin";
// admin is the current account address of the group admin.
string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// group_id is the unique ID of the group.
uint64 group_id = 2;
// new_admin is the group new admin account address.
string new_admin = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"];
}
MsgUpdateGroupAdminResponse
is the Msg/UpdateGroupAdmin
response type.
message MsgUpdateGroupAdminResponse {}
MsgUpdateGroupMetadata
is the Msg/UpdateGroupMetadata
request type.
message MsgUpdateGroupMetadata {
option (cosmos.msg.v1.signer) = "admin";
// admin is the account address of the group admin.
string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// group_id is the unique ID of the group.
uint64 group_id = 2;
// metadata is the updated group's metadata.
string metadata = 3;
}
MsgUpdateGroupMetadataResponse
is the Msg/UpdateGroupMetadata
response type.
message MsgUpdateGroupMetadataResponse {}
MsgCreateGroupPolicy
is the Msg/CreateGroupPolicy
request type.
message MsgCreateGroupPolicy {
option (cosmos.msg.v1.signer) = "admin";
option (gogoproto.goproto_getters) = false;
// admin is the account address of the group admin.
string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// group_id is the unique ID of the group.
uint64 group_id = 2;
// metadata is any arbitrary metadata attached to the group policy.
string metadata = 3;
// decision_policy specifies the group policy's decision policy.
google.protobuf.Any decision_policy = 4 [(cosmos_proto.accepts_interface) = "DecisionPolicy"];
}
MsgCreateGroupPolicyResponse
is the Msg/CreateGroupPolicy
response type.
message MsgCreateGroupPolicyResponse {
// address is the account address of the newly created group policy.
string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
}
MsgCreateGroupWithPolicy
is the Msg/CreateGroupWithPolicy
request type.
message MsgCreateGroupWithPolicy {
option (gogoproto.goproto_getters) = false;
// admin is the account address of the group and group policy admin.
string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// members defines the group members.
repeated Member members = 2 [(gogoproto.nullable) = false];
// group_metadata is any arbitrary metadata attached to the group.
string group_metadata = 3;
// group_policy_metadata is any arbitrary metadata attached to the group policy.
string group_policy_metadata = 4;
// group_policy_as_admin is a boolean field, if set to true, the group policy account address will be used as group and group policy admin.
bool group_policy_as_admin = 5;
// decision_policy specifies the group policy's decision policy.
google.protobuf.Any decision_policy = 6 [(cosmos_proto.accepts_interface) = "DecisionPolicy"];
}
MsgCreateGroupWithPolicyResponse
is the Msg/CreateGroupWithPolicy
response type.
message MsgCreateGroupWithPolicyResponse {
// group_id is the unique ID of the newly created group with policy.
uint64 group_id = 1;
// group_policy_address is the account address of the newly created group policy.
string group_policy_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
}
MsgUpdateGroupPolicyAdmin
is the Msg/UpdateGroupPolicyAdmin
request type.
message MsgUpdateGroupPolicyAdmin {
option (cosmos.msg.v1.signer) = "admin";
// admin is the account address of the group admin.
string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// address is the account address of the group policy.
string address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// new_admin is the new group policy admin.
string new_admin = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"];
}
MsgUpdateGroupPolicyAdminResponse
is the Msg/UpdateGroupPolicyAdmin
response type.
message MsgUpdateGroupPolicyAdminResponse {}
MsgUpdateGroupPolicyDecisionPolicy
is the Msg/UpdateGroupPolicyDecisionPolicy
request type.
message MsgUpdateGroupPolicyDecisionPolicy {
option (cosmos.msg.v1.signer) = "admin";
option (gogoproto.goproto_getters) = false;
// admin is the account address of the group admin.
string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// address is the account address of group policy.
string address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// decision_policy is the updated group policy's decision policy.
google.protobuf.Any decision_policy = 3 [(cosmos_proto.accepts_interface) = "DecisionPolicy"];
}
MsgUpdateGroupPolicyDecisionPolicyResponse
is the Msg/UpdateGroupPolicyDecisionPolicy
response type.
message MsgUpdateGroupPolicyDecisionPolicyResponse {}
MsgUpdateGroupPolicyMetadata
is the Msg/UpdateGroupPolicyMetadata
request type.
message MsgUpdateGroupPolicyMetadata {
option (cosmos.msg.v1.signer) = "admin";
// admin is the account address of the group admin.
string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// address is the account address of group policy.
string address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// metadata is the updated group policy metadata.
string metadata = 3;
}
MsgUpdateGroupPolicyMetadataResponse
is the Msg/UpdateGroupPolicyMetadata
response type.
message MsgUpdateGroupPolicyMetadataResponse {}
MsgSubmitProposal
is the Msg/SubmitProposal
request type.
message MsgSubmitProposal {
option (cosmos.msg.v1.signer) = "proposers";
option (gogoproto.goproto_getters) = false;
// address is the account address of group policy.
string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// proposers are the account addresses of the proposers.
// Proposers signatures will be counted as yes votes.
repeated string proposers = 2;
// metadata is any arbitrary metadata to attached to the proposal.
string metadata = 3;
// messages is a list of `sdk.Msg`s that will be executed if the proposal passes.
repeated google.protobuf.Any messages = 4;
// exec defines the mode of execution of the proposal,
// whether it should be executed immediately on creation or not.
// If so, proposers signatures are considered as Yes votes.
Exec exec = 5;
}
MsgSubmitProposalResponse
is the Msg/SubmitProposal
response type.
message MsgSubmitProposalResponse {
// proposal is the unique ID of the proposal.
uint64 proposal_id = 1;
}
MsgWithdrawProposal
is the Msg/WithdrawProposal
request type.
message MsgWithdrawProposal {
// proposal is the unique ID of the proposal.
uint64 proposal_id = 1;
// address is the admin of the group policy or one of the proposer of the proposal.
string address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
}
MsgWithdrawProposalResponse
is the Msg/WithdrawProposal
response type.
message MsgWithdrawProposalResponse {}
MsgVote
is the Msg/Vote
request type.
message MsgVote {
option (cosmos.msg.v1.signer) = "voter";
// proposal is the unique ID of the proposal.
uint64 proposal_id = 1;
// voter is the voter account address.
string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// option is the voter's choice on the proposal.
VoteOption option = 3;
// metadata is any arbitrary metadata to attached to the vote.
string metadata = 4;
// exec defines whether the proposal should be executed
// immediately after voting or not.
Exec exec = 5;
}
MsgVoteResponse
is the Msg/Vote
response type.
message MsgVoteResponse {}
MsgExec
is the Msg/Exec
request type.
message MsgExec {
option (cosmos.msg.v1.signer) = "signer";
// proposal is the unique ID of the proposal.
uint64 proposal_id = 1;
// signer is the account address used to execute the proposal.
string signer = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
}
MsgExecResponse
is the Msg/Exec
request type.
message MsgExecResponse {}
MsgLeaveGroup
is the Msg/LeaveGroup
request type.
message MsgLeaveGroup {
option (cosmos.msg.v1.signer) = "address";
// address is the account address of the group member.
string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// group_id is the unique ID of the group.
uint64 group_id = 2;
}
MsgLeaveGroupResponse
is the Msg/LeaveGroup
response type.
message MsgLeaveGroupResponse {}
Query
is the cosmos.group.v1 Query service.
service Query {
// GroupInfo queries group info based on group id.
rpc GroupInfo(QueryGroupInfoRequest) returns (QueryGroupInfoResponse) {
option (google.api.http).get = "/cosmos/group/v1/group_info/{group_id}";
};
// GroupPolicyInfo queries group policy info based on account address of group policy.
rpc GroupPolicyInfo(QueryGroupPolicyInfoRequest) returns (QueryGroupPolicyInfoResponse) {
option (google.api.http).get = "/cosmos/group/v1/group_policy_info/{address}";
};
// GroupMembers queries members of a group
rpc GroupMembers(QueryGroupMembersRequest) returns (QueryGroupMembersResponse) {
option (google.api.http).get = "/cosmos/group/v1/group_members/{group_id}";
};
// GroupsByAdmin queries groups by admin address.
rpc GroupsByAdmin(QueryGroupsByAdminRequest) returns (QueryGroupsByAdminResponse) {
option (google.api.http).get = "/cosmos/group/v1/groups_by_admin/{admin}";
};
// GroupPoliciesByGroup queries group policies by group id.
rpc GroupPoliciesByGroup(QueryGroupPoliciesByGroupRequest) returns (QueryGroupPoliciesByGroupResponse) {
option (google.api.http).get = "/cosmos/group/v1/group_policies_by_group/{group_id}";
};
// GroupsByAdmin queries group policies by admin address.
rpc GroupPoliciesByAdmin(QueryGroupPoliciesByAdminRequest) returns (QueryGroupPoliciesByAdminResponse) {
option (google.api.http).get = "/cosmos/group/v1/group_policies_by_admin/{admin}";
};
// Proposal queries a proposal based on proposal id.
rpc Proposal(QueryProposalRequest) returns (QueryProposalResponse) {
option (google.api.http).get = "/cosmos/group/v1/proposal/{proposal_id}";
};
// ProposalsByGroupPolicy queries proposals based on account address of group policy.
rpc ProposalsByGroupPolicy(QueryProposalsByGroupPolicyRequest) returns (QueryProposalsByGroupPolicyResponse) {
option (google.api.http).get = "/cosmos/group/v1/proposals_by_group_policy/{address}";
};
// VoteByProposalVoter queries a vote by proposal id and voter.
rpc VoteByProposalVoter(QueryVoteByProposalVoterRequest) returns (QueryVoteByProposalVoterResponse) {
option (google.api.http).get = "/cosmos/group/v1/vote_by_proposal_voter/{proposal_id}/{voter}";
};
// VotesByProposal queries a vote by proposal.
rpc VotesByProposal(QueryVotesByProposalRequest) returns (QueryVotesByProposalResponse) {
option (google.api.http).get = "/cosmos/group/v1/votes_by_proposal/{proposal_id}";
};
// VotesByVoter queries a vote by voter.
rpc VotesByVoter(QueryVotesByVoterRequest) returns (QueryVotesByVoterResponse) {
option (google.api.http).get = "/cosmos/group/v1/votes_by_voter/{voter}";
};
// GroupsByMember queries groups by member address.
rpc GroupsByMember(QueryGroupsByMemberRequest) returns (QueryGroupsByMemberResponse) {
option (google.api.http).get = "/cosmos/group/v1/groups_by_member/{address}";
};
// TallyResult queries the tally of a proposal votes.
rpc TallyResult(QueryTallyResultRequest) returns (QueryTallyResultResponse) {
option (google.api.http).get = "/cosmos/group/v1/proposals/{proposal_id}/tally";
};
}
QueryGroupInfoRequest
is the Query/GroupInfo
request type.
message QueryGroupInfoRequest {
// group_id is the unique ID of the group.
uint64 group_id = 1;
}
QueryGroupInfoResponse
is the Query/GroupInfo
response type.
message QueryGroupInfoResponse {
// info is the GroupInfo for the group.
GroupInfo info = 1;
}
QueryGroupPolicyInfoRequest
is the Query/GroupPolicyInfo
request type.
message QueryGroupPolicyInfoRequest {
// address is the account address of the group policy.
string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
}
QueryGroupPolicyInfoResponse
is the Query/GroupPolicyInfo
response type.
message QueryGroupPolicyInfoResponse {
// info is the GroupPolicyInfo for the group policy.
GroupPolicyInfo info = 1;
}
QueryGroupMembersRequest
is the Query/GroupMembers
request type.
message QueryGroupMembersRequest {
// group_id is the unique ID of the group.
uint64 group_id = 1;
// pagination defines an optional pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 2;
}
QueryGroupMembersResponse
is the Query/GroupMembersResponse
response type.
message QueryGroupMembersResponse {
// members are the members of the group with given group_id.
repeated GroupMember members = 1;
// pagination defines the pagination in the response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
QueryGroupsByAdminRequest
is the Query/GroupsByAdmin
request type.
message QueryGroupsByAdminRequest {
// admin is the account address of a group's admin.
string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// pagination defines an optional pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 2;
}
QueryGroupsByAdminResponse
is the Query/GroupsByAdminResponse
response type.
message QueryGroupsByAdminResponse {
// groups are the groups info with the provided admin.
repeated GroupInfo groups = 1;
// pagination defines the pagination in the response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
QueryGroupPoliciesByGroupRequest
is the Query/GroupPoliciesByGroup
request type.
message QueryGroupPoliciesByGroupRequest {
// group_id is the unique ID of the group policy's group.
uint64 group_id = 1;
// pagination defines an optional pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 2;
}
QueryGroupPoliciesByGroupResponse
is the Query/GroupPoliciesByGroup
response type.
message QueryGroupPoliciesByGroupResponse {
// group_policies are the group policies info associated with the provided group.
repeated GroupPolicyInfo group_policies = 1;
// pagination defines the pagination in the response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
QueryGroupPoliciesByAdminRequest
is the Query/GroupPoliciesByAdmin
request type.
message QueryGroupPoliciesByAdminRequest {
// admin is the admin address of the group policy.
string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// pagination defines an optional pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 2;
}
QueryGroupPoliciesByAdminResponse
is the Query/GroupPoliciesByAdmin
response type.
message QueryGroupPoliciesByAdminResponse {
// group_policies are the group policies info with provided admin.
repeated GroupPolicyInfo group_policies = 1;
// pagination defines the pagination in the response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
QueryProposalRequest
is the Query/Proposal
request type.
message QueryProposalRequest {
// proposal_id is the unique ID of a proposal.
uint64 proposal_id = 1;
}
QueryProposalResponse
is the Query/Proposal
response type.
message QueryProposalResponse {
// proposal is the proposal info.
Proposal proposal = 1;
}
QueryProposalsByGroupPolicyRequest
is the Query/ProposalByGroupPolicy
request type.
message QueryProposalsByGroupPolicyRequest {
// address is the account address of the group policy related to proposals.
string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// pagination defines an optional pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 2;
}
QueryProposalsByGroupPolicyResponse
is the Query/ProposalByGroupPolicy
response type.
message QueryProposalsByGroupPolicyResponse {
// proposals are the proposals with given group policy.
repeated Proposal proposals = 1;
// pagination defines the pagination in the response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
QueryVoteByProposalVoterRequest
is the Query/VoteByProposalVoter
request type.
message QueryVoteByProposalVoterRequest {
// proposal_id is the unique ID of a proposal.
uint64 proposal_id = 1;
// voter is a proposal voter account address.
string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
}
QueryVoteByProposalVoterResponse
is the Query/VoteByProposalVoter
response type.
message QueryVoteByProposalVoterResponse {
// vote is the vote with given proposal_id and voter.
Vote vote = 1;
}
QueryVotesByProposalRequest
is the Query/VotesByProposal
request type.
message QueryVotesByProposalRequest {
// proposal_id is the unique ID of a proposal.
uint64 proposal_id = 1;
// pagination defines an optional pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 2;
}
QueryVotesByProposalResponse
is the Query/VotesByProposal
response type.
message QueryVotesByProposalResponse {
// votes are the list of votes for given proposal_id.
repeated Vote votes = 1;
// pagination defines the pagination in the response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
QueryVotesByVoterRequest
is the Query/VotesByVoter
request type.
message QueryVotesByVoterRequest {
// voter is a proposal voter account address.
string voter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// pagination defines an optional pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 2;
}
QueryVotesByVoterResponse
is the Query/VotesByVoter
response type.
message QueryVotesByVoterResponse {
// votes are the list of votes by given voter.
repeated Vote votes = 1;
// pagination defines the pagination in the response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
QueryGroupsByMemberRequest
is the Query/GroupsByMember
request type.
message QueryGroupsByMemberRequest {
// address is the group member address.
string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// pagination defines an optional pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 2;
}
QueryGroupsByMemberResponse
is the Query/GroupsByMember
response type.
message QueryGroupsByMemberResponse {
// groups are the groups info with the provided group member.
repeated GroupInfo groups = 1;
// pagination defines the pagination in the response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
QueryTallyResultRequest
is the Query/TallyResult
request type.
message QueryTallyResultRequest {
// proposal_id is the unique id of a proposal.
uint64 proposal_id = 1;
}
QueryTallyResultResponse
is the Query/TallyResult
response type.
message QueryTallyResultResponse {
// tally defines the requested tally.
TallyResult tally = 1 [(gogoproto.nullable) = false];
}