Quest Schema
To integrate with ICQuests, you need to define each quest using a standard schema. This ensures your quest can be listed, verified, and rewarded correctly.
Motoko Type
// In your canister code
type Quest = {
id : Nat;
title : Text;
subtitle : Text;
description : Text;
rewardXp : Nat;
campaignId : Nat;
tags : [Text];
estimatedTime : Text;
difficulty : Nat;
prerequisites : Text;
};
JSON Schema Example
{
"id": 1,
"title": "Swap on Sonic",
"subtitle": "Try your first DeFi swap",
"description": "Swap any amount of ICP for another token on Sonic DEX.",
"rewardXp": 100,
"campaignId": 1,
"tags": ["defi", "swap", "sonic"],
"estimatedTime": "2 min",
"difficulty": 1,
"prerequisites": "None"
}
Required Fields
Field | Type | Description |
---|---|---|
id | Nat | Unique quest identifier |
title | Text | Quest title |
subtitle | Text | Short description or call to action |
description | Text | Full quest instructions |
rewardXp | Nat | XP awarded for completion |
campaignId | Nat | ID of the campaign this quest belongs to |
tags | [Text] | Tags for filtering/search |
estimatedTime | Text | How long the quest should take |
difficulty | Nat | Difficulty level (1 = easy, 5 = hard, etc.) |
prerequisites | Text | Any requirements before starting |
Tip: You can provide multiple quests in a single JSON file as an array.