# Msg Service

# Msg/CreateGroup

A new group can be created with the MsgCreateGroupRequest, which has an admin address, a list of members and some optional metadata bytes.

// MsgCreateGroupRequest is the Msg/CreateGroup request type.
message MsgCreateGroupRequest {

    // admin is the account address of the group admin.
    string admin = 1;
    
    // members defines the group members.
    repeated Member members = 2 [(gogoproto.nullable) = false];
    
    // metadata is any arbitrary metadata to attached to the group.
    bytes metadata = 3;
}

It's expecting to fail if metadata length is greater than some MaxMetadataLength.

# Msg/UpdateGroupMembers

Group members can be updated with the UpdateGroupMembersRequest.

// MsgUpdateGroupMembersRequest is the Msg/UpdateGroupMembers request type.
message MsgUpdateGroupMembersRequest {

    // admin is the account address of the group admin.
    string admin = 1;
    
    // 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];
}

In the list of MemberUpdates, an existing member can be removed by setting its weight to 0.

It's expecting to fail if the signer is not the admin of the group.

# Msg/UpdateGroupAdmin

The UpdateGroupAdminRequest can be used to update a group admin.

// MsgUpdateGroupAdminRequest is the Msg/UpdateGroupAdmin request type.
message MsgUpdateGroupAdminRequest {

    // admin is the current account address of the group admin.
    string admin = 1;
    
    // 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;
}

It's expecting to fail if the signer is not the admin of the group.

# Msg/UpdateGroupMetadata

The UpdateGroupMetadataRequest can be used to update a group metadata.

// MsgUpdateGroupMetadataRequest is the Msg/UpdateGroupMetadata request type.
message MsgUpdateGroupMetadataRequest {

    // admin is the account address of the group admin.
    string admin = 1;
    
    // group_id is the unique ID of the group.
    uint64 group_id = 2;
    
    // metadata is the updated group's metadata.
    bytes metadata = 3;
}

It's expecting to fail if:

  • new metadata length is greater than some MaxMetadataLength.
  • the signer is not the admin of the group.

# Msg/CreateGroupAccount

A new group account can be created with the MsgCreateGroupAccountRequest, which has an admin address, a group id, a decision policy and some optional metadata bytes.

// MsgCreateGroupAccountRequest is the Msg/CreateGroupAccount request type.
message MsgCreateGroupAccountRequest {
    option (gogoproto.goproto_getters) = false;

    // admin is the account address of the group admin.
    string admin = 1;
    
    // group_id is the unique ID of the group.
    uint64 group_id = 2;
    
    // metadata is any arbitrary metadata to attached to the group account.
    bytes metadata = 3;

    // decision_policy specifies the group account's decision policy.
    google.protobuf.Any decision_policy = 4 [(cosmos_proto.accepts_interface) = "DecisionPolicy"];
}

It's expecting to fail if metadata length is greater than some MaxMetadataLength.

# Msg/UpdateGroupAccountAdmin

The UpdateGroupAccountAdminRequest can be used to update a group account admin.

// MsgUpdateGroupAccountAdminRequest is the Msg/UpdateGroupAccountAdmin request type.
message MsgUpdateGroupAccountAdminRequest {

    // admin is the account address of the group admin.
    string admin = 1;
    
    // address is the group account address.
    string address = 2;
    
    // new_admin is the new group account admin.
    string new_admin = 3;
}

It's expecting to fail if the signer is not the admin of the group account.

# Msg/UpdateGroupAccountDecisionPolicy

The UpdateGroupAccountDecisionPolicyRequest can be used to update a decision policy.

// MsgUpdateGroupAccountDecisionPolicyRequest is the Msg/UpdateGroupAccountDecisionPolicy request type.
message MsgUpdateGroupAccountDecisionPolicyRequest {
    option (gogoproto.goproto_getters) = false;

    // admin is the account address of the group admin.
    string admin = 1;
    
    // address is the group account address.
    string address = 2;
    
    // decision_policy is the updated group account decision policy.
    google.protobuf.Any decision_policy = 3 [(cosmos_proto.accepts_interface) = "DecisionPolicy"];
}

It's expecting to fail if the signer is not the admin of the group account.

# Msg/UpdateGroupAccountMetadata

The UpdateGroupAccountMetadataRequest can be used to update a group account metadata.

// MsgUpdateGroupAccountMetadataRequest is the Msg/UpdateGroupAccountMetadata request type.
message MsgUpdateGroupAccountMetadataRequest {

    // admin is the account address of the group admin.
    string admin = 1;
    
    // address is the group account address.
    string address = 2;
    
    // metadata is the updated group account metadata.
    bytes metadata = 3;
}

It's expecting to fail if:

  • new metadata length is greater than some MaxMetadataLength.
  • the signer is not the admin of the group.

# Msg/CreateProposal

A new group account can be created with the MsgCreateProposalRequest, which has a group account address, a list of proposers addresses, a list of messages to execute if the proposal is accepted and some optional metadata bytes. An optional Exec value can be provided to try to execute the proposal immediately after proposal creation. Proposers signatures are considered as yes votes in this case.

// MsgCreateProposalRequest is the Msg/CreateProposal request type.
message MsgCreateProposalRequest {
    option (gogoproto.goproto_getters) = false;

    // address is the group account address.
    string address = 1;
    
    // 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.
    bytes metadata = 3;

    // msgs is a list of Msgs that will be executed if the proposal passes.
    repeated google.protobuf.Any msgs = 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;
}

It's expecting to fail if metadata length is greater than some MaxMetadataLength.

# Msg/Vote

A new vote can be created with the MsgVoteRequest, given a proposal id, a voter address, a choice (yes, no, veto or abstain) and some optional metadata bytes. An optional Exec value can be provided to try to execute the proposal immediately after voting.

// MsgVoteRequest is the Msg/Vote request type.
message MsgVoteRequest {

    // proposal is the unique ID of the proposal.
    uint64 proposal_id = 1;
    
    // voter is the voter account address.
    string voter = 2;
    
    // choice is the voter's choice on the proposal.
    Choice choice = 3;

    // metadata is any arbitrary metadata to attached to the vote.
    bytes metadata = 4;

    // exec defines whether the proposal should be executed
    // immediately after voting or not.
    Exec exec = 5;
}

It's expecting to fail if metadata length is greater than some MaxMetadataLength.

# Msg/Exec

A proposal can be executed with the MsgExecRequest.

// MsgExecRequest is the Msg/Exec request type.
message MsgExecRequest {

    // 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;
}

The messages that are part of this proposal won't be executed if:

  • the group has been modified before tally.
  • the group account has been modified before tally.
  • the proposal has not been accepted.
  • the proposal status is not closed.
  • the proposal has already been successfully executed.