Creates a new NectarMissions instance.
The public key of the NectarMissions account on the blockchain.
The associated MissionPool instance representing the mission pool.
Protected _honeycombReadonly addressReadonly programThe program ID associated with the NectarMissions module.
Returns an array of public keys representing the collections associated with the mission pool.
An array of public keys representing the collections associated with the mission pool.
const collections = nectarMissions.collections;
console.log(collections); // Output: [collection1, collection2]
Returns an array of public keys representing the creators associated with the mission pool.
An array of public keys representing the creators associated with the mission pool.
const creators = nectarMissions.creators;
console.log(creators); // Output: [creator1, creator2]
Returns the name of the mission pool.
The name of the mission pool.
const poolName = nectarMissions.name;
console.log(poolName); // Output: "Mission Pool 1"
Installs the NectarMissions instance into the provided Honeycomb instance.
This method is used internally to link the mission pool to the Honeycomb instance.
The Honeycomb instance to install the mission pool into.
The Honeycomb instance with the mission pool installed.
const honeycomb = new Honeycomb(...); // Replace with the actual Honeycomb instance.
nectarMissions.install(honeycomb);
Retrieves a specific mission associated with the mission pool by its name or public key.
The name of the mission or the public key of the mission account.
Optional reFetch: booleanSet to true to force fetching the mission from the blockchain, even if cached.
Optional commitmentOrConfig: Commitment | GetAccountInfoConfigOptional commitment level or GetAccountInfoConfig object for fetching account data.
A promise that resolves to the NectarMission instance representing the requested mission.
const missionName = "Mission1"; // The name of the mission or the public key of the mission account
const mission = await nectarMissions.mission(missionName);
console.log(mission); // Output: NectarMission instance for Mission1
// Alternatively, you can use the public key directly to fetch the mission.
const missionPublicKey = new web3.PublicKey("MissionPublicKey");
const mission = await nectarMissions.mission(missionPublicKey);
console.log(mission); // Output: NectarMission instance for MissionPublicKey
Optional reFetch: booleanOptional commitmentOrConfig: Commitment | GetAccountInfoConfigRetrieves all missions associated with the mission pool.
Optional reFetch: booleanSet to true to force fetching missions from the blockchain, even if cached.
An array of NectarMission instances representing the missions associated with the mission pool.
const missions = await nectarMissions.missions();
console.log(missions); // Output: [NectarMission1, NectarMission2, ...]
Retrieves mission participations for a given wallet address associated with the mission pool.
Optional wallet: PublicKeyThe public key of the wallet for which to retrieve mission participations.
If not provided, the default wallet associated with the Honeycomb instance will be used.
Optional reFetch: booleanSet to true to force fetching participations from the blockchain, even if cached.
An array of NectarMissionParticipation instances representing the mission participations
associated with the wallet.
// Retrieve mission participations for the default wallet
const participations = await nectarMissions.participations();
console.log(participations); // Output: [NectarMissionParticipation1, NectarMissionParticipation2, ...]
// Alternatively, you can specify the wallet address to retrieve participations for a specific wallet
const walletAddress = new web3.PublicKey("WalletAddress");
const participations = await nectarMissions.participations(walletAddress);
console.log(participations); // Output: [NectarMissionParticipation1, NectarMissionParticipation2, ...]
Returns the HoneycombProject associated with the mission pool.
The HoneycombProject associated with the mission pool.
const project = nectarMissions.project();
console.log(project); // Output: HoneycombProject instance representing the project
Initiates a recall operation for a set of NectarMissionParticipation.
This method is used to recall rewards from completed missions for a given set of participations.
An array of NectarMissionParticipation instances for which to initiate the recall.
Optional confirmOptions: ConfirmOptionsOptional transaction confirmation options.
A promise that resolves to the transaction signature after the recall operation is complete.
const participations = [participation1, participation2, ...]; // Replace with actual NectarMissionParticipation instances
const confirmOptions: web3.ConfirmOptions = {
skipPreflight: false, // Optional, set to true to skip preflight checks
};
const recallSignature = await nectarMissions.recall(participations, confirmOptions);
Registers a new NectarMission or NectarMissionParticipation with the NectarMissions instance.
This method is used to add missions or mission participations to the cache to avoid unnecessary fetching.
The NectarMission instance to register.
The NectarMissions instance with the mission or participation added to the cache.
const newMission = new NectarMission(...); // Replace with the actual NectarMission instance.
nectarMissions.register(newMission);
// Alternatively, you can register an array of participations at once
const participations = [participation1, participation2, ...]; // Replace with actual NectarMissionParticipation instances
nectarMissions.register(participations);
Updates an existing mission pool with new data.
The UpdateMissionPoolArgs object containing the data to update the mission pool.
Optional confirmOptions: ConfirmOptionsOptional transaction confirmation options.
A promise that resolves to the transaction signature after the update is complete.
const args: UpdateMissionPoolArgs = {
name: "Updated Mission Pool",
... (other properties to update the mission pool)
collection: newCollection, // Optional, specify if you want to change the collection
creator: newCreator, // Optional, specify if you want to change the creator
};
const confirmOptions: web3.ConfirmOptions = {
skipPreflight: false, // Optional, set to true to skip preflight checks
};
await nectarMissions.update(args, confirmOptions);
Static fromCreates a new NectarMissions instance from the given address on the blockchain.
The Solana connection instance to use for interacting with the blockchain.
The public key of the NectarMissions account on the blockchain.
Optional commitmentOrConfig: Commitment | GetAccountInfoConfigOptional commitment level or GetAccountInfoConfig object for fetching account data.
A new NectarMissions instance representing the mission pool.
const connection = new web3.Connection("https://api.mainnet-beta.solana.com");
const address = new web3.PublicKey("..."); // Replace with the actual address of the NectarMissions account.
const missionPool = await NectarMissions.fromAddress(connection, address);
Static newCreates a new mission pool in the Honeycomb Protocol and returns the corresponding NectarMissions instance.
The Honeycomb instance to use for the transaction.
The NewMissionPoolArgs object containing the necessary data to create the mission pool.
Optional confirmOptions: ConfirmOptionsOptional transaction confirmation options.
A new NectarMissions instance representing the newly created mission pool.
const honeycomb = new Honeycomb(...); // Replace with the actual Honeycomb instance.
const args: NewMissionPoolArgs = {
args: {
name: "Mission Pool 1",
... (other properties from CreateMissionPoolArgs)
collections: [collection1, collection2],
creators: [creator1, creator2],
},
project: honeycombProject, // Optional, if not provided, it will use the default project
};
const missionPool = await NectarMissions.new(honeycomb, args);
Generated using TypeDoc
The
NectarMissionsclass represents a collection of missions in the Honeycomb Protocol. This class extends theModuleclass and provides methods to interact with missions, such as creating new missions, updating existing missions, fetching missions, etc.