Gamification
Overview
The primary purpose of the gamification module is to offer APIs designed to enhance the user experience.
Concepts
Badges
Badges in gamification serve as powerful visual representations of achievement and progress, offering users tangible recognition for their efforts. Badges can be designed to signify specifications of a user. For instance, you can reward loyal users with a badge, offer them exclusive benefits, highlight their status to others, or enable filtering options to identify badge holders. Currently badges are used as part of trading platform to filter the matching candidates.
Messages
MsgMintBadge
This message mints a badge. The response includes the denom of minted badge.
message MsgMintBadge {
option (cosmos.msg.v1.signer) = "admin";
string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
string badge_name = 2;
}
message MsgMintBadgeResponse {
string badge_denom = 1;
}
MsgAssignBadge
This message assigns a badge to a specific account.
message MsgAssignBadge {
option (cosmos.msg.v1.signer) = "assigner";
string assigner = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
string assignee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
string badge_denom = 3;
}
message MsgAssignBadgeResponse {}
MsgUnAssignBadge
This message unassigns a badge from a specific account.
message MsgUnAssignBadge {
option (cosmos.msg.v1.signer) = "assigner";
string assigner = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
string assignee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
string badge_denom = 3;
}
message MsgUnAssignBadgeResponse {}
MsgUpdateModuleParams
This message updates the module parameters. Only the governance can execute this message.
message MsgUpdateModuleParams {
option (cosmos.msg.v1.signer) = "authority";
string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
Params params = 2 [(gogoproto.nullable) = false];
}
message Params {
option (amino.name) = "gamification/x/badge/Params";
option (gogoproto.equal) = true;
}
message MsgUpdateModuleParamsResponse {}
Queries
Params
This query fetches the parameters of the module.
message QueryParamsRequest {}
message QueryParamsResponse {
// params holds all the parameters of this module.
Params params = 1 [
(gogoproto.nullable) = false,
(amino.dont_omitempty) = true
];
}
Badge
This query retrieves a badge using its id.
message QueryGetBadgeRequest {
uint64 id = 1;
}
message QueryGetBadgeResponse {
Badge badge = 1 [(gogoproto.nullable) = true];
}
BadgeAll
This query fetches all badges.
message QueryAllBadgeRequest {
cosmos.base.query.v1beta1.PageRequest pagination = 1;
}
message QueryAllBadgeResponse {
repeated Badge badges = 1 [(gogoproto.nullable) = false];
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
Events
There is no specific events yet.
State
The current implementation is just a wrapper on top of tokenfactory module. So there are no specific stores for badges now.
Parameters
The is no specific parameters yet.
Genesis
The genesis state of this module includes:
Params
: Parameters for the trading module.