The NectarMissions class represents a collection of missions in the Honeycomb Protocol. This class extends the Module class and provides methods to interact with missions, such as creating new missions, updating existing missions, fetching missions, etc.

Hierarchy

  • Module
    • NectarMissions

Constructors

  • Creates a new NectarMissions instance.

    Parameters

    • address: PublicKey

      The public key of the NectarMissions account on the blockchain.

    • _pool: MissionPool

      The associated MissionPool instance representing the mission pool.

    Returns NectarMissions

Properties

_honeycomb: Honeycomb
address: PublicKey
programId: PublicKey

The program ID associated with the NectarMissions module.

Accessors

  • get collections(): Uint8Array
  • Returns an array of public keys representing the collections associated with the mission pool.

    Returns Uint8Array

    An array of public keys representing the collections associated with the mission pool.

    Example

    const collections = nectarMissions.collections;
    console.log(collections); // Output: [collection1, collection2]
  • get creators(): Uint8Array
  • Returns an array of public keys representing the creators associated with the mission pool.

    Returns Uint8Array

    An array of public keys representing the creators associated with the mission pool.

    Example

    const creators = nectarMissions.creators;
    console.log(creators); // Output: [creator1, creator2]
  • get name(): string
  • Returns the name of the mission pool.

    Returns string

    The name of the mission pool.

    Example

    const poolName = nectarMissions.name;
    console.log(poolName); // Output: "Mission Pool 1"

Methods

  • Returns the NectarMissionsCreate instance to handle creating new missions.

    Returns NectarMissionsCreate

    The NectarMissionsCreate instance.

    Example

    const creator = nectarMissions.create();
    // Use the creator to create new missions on the blockchain.
  • Returns the NectarMissionsFetch instance to handle fetching mission data.

    Returns NectarMissionsFetch

    The NectarMissionsFetch instance.

    Example

    const fetcher = nectarMissions.fetch();
    // Use the fetcher to retrieve mission data from the blockchain.
  • Get the Honeycomb client instance associated with the module.

    Returns Honeycomb

    The Honeycomb client instance.

  • Installs the NectarMissions instance into the provided Honeycomb instance. This method is used internally to link the mission pool to the Honeycomb instance.

    Parameters

    • honeycomb: Honeycomb

      The Honeycomb instance to install the mission pool into.

    Returns Honeycomb

    The Honeycomb instance with the mission pool installed.

    Example

    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.

    Parameters

    • name: string

      The name of the mission or the public key of the mission account.

    • Optional reFetch: boolean

      Set to true to force fetching the mission from the blockchain, even if cached.

    • Optional commitmentOrConfig: Commitment | GetAccountInfoConfig

      Optional commitment level or GetAccountInfoConfig object for fetching account data.

    Returns Promise<NectarMission>

    A promise that resolves to the NectarMission instance representing the requested mission.

    Async

    Example

    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
  • Parameters

    • address: PublicKey
    • Optional reFetch: boolean
    • Optional commitmentOrConfig: Commitment | GetAccountInfoConfig

    Returns Promise<NectarMission>

  • Retrieves all missions associated with the mission pool.

    Parameters

    • Optional reFetch: boolean

      Set to true to force fetching missions from the blockchain, even if cached.

    Returns Promise<NectarMission[]>

    An array of NectarMission instances representing the missions associated with the mission pool.

    Async

    Example

    const missions = await nectarMissions.missions();
    console.log(missions); // Output: [NectarMission1, NectarMission2, ...]
  • Retrieves mission participations for a given wallet address associated with the mission pool.

    Parameters

    • Optional wallet: PublicKey

      The 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: boolean

      Set to true to force fetching participations from the blockchain, even if cached.

    Returns Promise<NectarMissionParticipation[]>

    An array of NectarMissionParticipation instances representing the mission participations associated with the wallet.

    Async

    Example

    // 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.

    Returns HoneycombProject

    The HoneycombProject associated with the mission pool.

    Example

    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.

    Parameters

    • participations: NectarMissionParticipation[]

      An array of NectarMissionParticipation instances for which to initiate the recall.

    • Optional confirmOptions: ConfirmOptions

      Optional transaction confirmation options.

    Returns Promise<string>

    A promise that resolves to the transaction signature after the recall operation is complete.

    Async

    Example

    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.

    Parameters

    Returns NectarMissions

    The NectarMissions instance with the mission or participation added to the cache.

    Example

    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);
  • Parameters

    Returns NectarMissions

  • Updates an existing mission pool with new data.

    Parameters

    • args: UpdateMissionPoolArgs & {
          collection?: PublicKey;
          creator?: PublicKey;
      }

      The UpdateMissionPoolArgs object containing the data to update the mission pool.

    • Optional confirmOptions: ConfirmOptions

      Optional transaction confirmation options.

    Returns Promise<ConfirmedContext>

    A promise that resolves to the transaction signature after the update is complete.

    Async

    Example

    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);
  • Creates a new NectarMissions instance from the given address on the blockchain.

    Parameters

    • connection: Connection

      The Solana connection instance to use for interacting with the blockchain.

    • address: PublicKey

      The public key of the NectarMissions account on the blockchain.

    • Optional commitmentOrConfig: Commitment | GetAccountInfoConfig

      Optional commitment level or GetAccountInfoConfig object for fetching account data.

    Returns Promise<NectarMissions>

    A new NectarMissions instance representing the mission pool.

    Async

    Example

    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);
  • Creates a new mission pool in the Honeycomb Protocol and returns the corresponding NectarMissions instance.

    Parameters

    • honeycomb: Honeycomb

      The Honeycomb instance to use for the transaction.

    • args: NewMissionPoolArgs

      The NewMissionPoolArgs object containing the necessary data to create the mission pool.

    • Optional confirmOptions: ConfirmOptions

      Optional transaction confirmation options.

    Returns Promise<NectarMissions>

    A new NectarMissions instance representing the newly created mission pool.

    Async

    Example

    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