Skip to main content

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

FieldTypeDescription
idNatUnique quest identifier
titleTextQuest title
subtitleTextShort description or call to action
descriptionTextFull quest instructions
rewardXpNatXP awarded for completion
campaignIdNatID of the campaign this quest belongs to
tags[Text]Tags for filtering/search
estimatedTimeTextHow long the quest should take
difficultyNatDifficulty level (1 = easy, 5 = hard, etc.)
prerequisitesTextAny requirements before starting

Tip: You can provide multiple quests in a single JSON file as an array.