• Creates a new mission operation.

    Parameters

    • honeycomb: Honeycomb

      An instance of the Honeycomb class.

    • args: CreateCreateMissionCtxArgs

      The arguments for creating the mission operation.

    Returns Promise<{
        mission: PublicKey;
        operation: Operation;
    }>

    An object containing the operation and the address of the new mission.

    Example

    const honeycomb = new Honeycomb(...); // Initialize Honeycomb instance
    const missionPool = await NectarMissions.fromAddress(honeycomb.connection, missionPoolAddress);
    const args: CreateMissionArgsSolita = {
    name: "Mission 1",
    minXp: 100,
    cost: {
    amount: 1000,
    address: "..."
    },
    duration: 3600, // 1 hour (in seconds)
    rewards: [...],
    ...
    };
    const createMissionArgs: CreateCreateMissionCtxArgs = {
    args,
    missionPool,
    programId: myCustomProgramId // (Optional) Provide a custom program ID if needed
    };
    const { operation, mission } = createCreateMissionOperation(honeycomb, createMissionArgs);
    // Execute the transaction to create the mission
    await operation.send(confirmOptions);

Generated using TypeDoc