Skip to main content

Missions

Pre-requisites

Please make sure that you've followed our getting started guide and set up your development environment.

You'll also need the following:

  1. A project
  2. At least one resource
  3. Characters

In order to participate in missions, your users will need to have created a profile for your project. They'll also need eligible characters that can go on the missions you create (more on this below).

Overview

Honeycomb Protocol offers timed-missions that users can participate in to earn rewards.

Developers, when creating a mission, can decide how long the mission will take to complete and what the rewards will be.

Each mission has a mission pool that defines the criteria regarding which character models can participate in the mission.

Create a mission pool

Missions pools group missions together based on the criteria you define. For example, you could create a mission pool for all missions that require a certain character model.

Users who don't have a character based on that model won't be able to participate in the missions in that pool.

const {
createCreateMissionPoolTransaction: {
missionPoolAddress, // The address of the mission pool
tx, // The transaction response, you'll need to sign and send this transaction
},
} = await client.createCreateMissionPoolTransaction({
data: {
name: "Test Mission Pool",
project: projectAddress.toString(),
payer: adminPublicKey.toString(),
authority: adminPublicKey.toString(),
delegateAuthority: delegateAuthority.toString(), // Optional
characterModel: characterModelAddress.toString(),
},
});

Create a mission

import { RewardKind } from "@honeycomb-protocol/edge-client";

const {
createCreateMissionTransaction: {
missionAddress, // The address of the mission
tx, // The transaction response, you'll need to sign and send this transaction
},
} = await client.createCreateMissionTransaction({
data: {
name: "Test mission",
project: projectAddress.toString(),
cost: {
address: resourceAddress.toString(),
amount: "100000",
},
duration: "86400", // 1 day
minXp: "50000", // Minimum XP required to participate in the mission
rewards: [
{
kind: RewardKind.Xp,
max: "100",
min: "100",
},
{
kind: RewardKind.Resource,
max: "25000000",
min: "50000000",
resource: resourceAddress.toString(),
},
],
missionPool: missionPoolAddress.toString(),
authority: adminPublicKey.toString(),
payer: adminPublicKey.toString(),
},
});

Send characters on mission

const {
createSendCharactersOnMissionTransaction: txResponse // This is the transaction response, you'll need to sign and send this transaction
} = await client.createSendCharactersOnMissionTransaction({
data: {
mission: missionAddress.toString(),
characterAddresses: [
characterAddress.toString(),
],
authority: userPublicKey.toString(),
payer: payerPublicKey.toString(), // Optional
},
});

Recall characters from a mission

const {
createRecallCharactersTransaction: txResponse // This is the transaction response, you'll need to sign and send this transaction
} = await client.createRecallCharactersTransaction({
data: {
mission: missionAddress.toString(),
characterAddresses: [
characterAddress.toString()
],
authority: userPublicKey.toString(),
payer: payerPublicKey.toString(), // Optional
},
lutAddresses: [lookupTableAddress],
});

Fetching a character's history

Please see the character history guide to learn how to fetch a character's history.