Events Rewards
Reward Lifecycle
Event Creation
Rewards are pre-configured using the
EventRewardType
schema
User Participation
Users participate in the event
Become eligible for rewards based on criteria (e.g., leaderboard rank)
Reward Allocation
Eligible users receive reward allocations
Allocations can be fetched via
useQuestEventRewardAllocations
hook
Reward Claim
Users claim rewards after event conclusion
Claims processed using
claimRewardAllocation
mutation
Event Reward Structure
Type Definition
Key Fields Explained
eventRewardId
: Unique identifier for this specific reward in the eventresolutionType
: Specifies the reward's resolution methodresolutionValueRange
: Defines eligible leaderboard ranksreward
: Contains actual reward data (resources or assets)EventGiveResourcesReward
: Virtual currencies, tokens, or pointsEventGiveAssetsReward
: In-game items, badges, or other assets
rewardHandlerArgs
: Configuration for reward distribution logiceventId
: Associated event identifier
Example Configuration
Fetching Reward Allocations
Use the useQuestEventRewardAllocations
hook to fetch user-specific reward allocations.
Hook Implementation
Allocation Type Definition
Example Allocation Data
Claiming Rewards
Use the useMutateQuestEventReward
hook to handle reward claims after event conclusion.
Implementation Example
Best Practices
Type Safety
Use TypeScript types for reward and allocation handling
Validate reward data structure before display
Error Handling
Implement proper error handling for claim operations
Show appropriate loading and error states
User Experience
Display clear claim status to users
Disable claim buttons for already claimed rewards
Show loading state during claim operations
Last updated