Represents a Nectar Mission.

Hierarchy

  • NectarMission

Constructors

Properties

Accessors

Methods

Constructors

  • Creates a new NectarMission instance.

    Parameters

    • _pool: NectarMissions

      The NectarMissions instance that the mission belongs to.

    • address: PublicKey

      The public key address of the mission.

    • _mission: Mission

      The underlying Mission object representing the mission data.

    Returns NectarMission

    Throws

    Throws an error if the mission does not belong to the pool.

Properties

address: PublicKey

Accessors

  • get duration(): Date
  • Gets the duration of the mission.

    Returns Date

    The duration of the mission as a Date.

  • get name(): string
  • Gets the name of the mission.

    Returns string

    The name of the mission.

  • get requirements(): {
        cost: {
            amount: bignum;
            currency: (() => HplCurrency);
        };
        minXp: bignum;
    }
  • Gets the mission requirements.

    Returns {
        cost: {
            amount: bignum;
            currency: (() => HplCurrency);
        };
        minXp: bignum;
    }

    The mission requirements.

    • cost: {
          amount: bignum;
          currency: (() => HplCurrency);
      }
      • amount: bignum
      • currency: (() => HplCurrency)
          • (): HplCurrency
          • Returns HplCurrency

    • minXp: bignum
  • get rewards(): MissionReward[]
  • Gets the rewards associated with the mission.

    Returns MissionReward[]

    An array of MissionReward or MissionCurrencyRewards objects representing the rewards.

Methods

  • Participates in the mission by staking NFTs.

    Parameters

    • nfts: (Metadata & NFT & {
          args: ParticipateArgs;
      })[]

      An array of staked NFTs along with their participation arguments.

    • Optional confirmOptions: ConfirmOptions

      Optional transaction confirmation options.

    Returns Promise<ConfirmedContext[]>

    A promise that resolves to an array of transaction signatures upon successful participation.

    Async

    Example

    // Participate in a mission by staking NFTs
    const nftsToStake = [
    { nft: stakedNft1, args: participateArgs1 },
    { nft: stakedNft2, args: participateArgs2 },
    // Add more NFTs to stake as needed
    ];
    const participationResult = await nectarMission.participate(nftsToStake);
    console.log(participationResult); // Output: Array of transaction signatures
  • Returns the NectarMissions instance that the mission belongs to.

    Returns NectarMissions

    The NectarMissions instance.

  • Recalls the participation from the mission for the provided participations.

    Parameters

    • participations: NectarMissionParticipation[]

      An array of NectarMissionParticipation instances representing the participations to recall.

    • Optional confirmOptions: ConfirmOptions

      Optional transaction confirmation options.

    Returns Promise<string>

    A promise that resolves to the transaction signature upon successful recall.

    Async

    Example

    // Recall participation from the mission for specific participations
    const participationsToRecall = [participation1, participation2];
    const recallResult = await nectarMission.recall(participationsToRecall);
    console.log(recallResult); // Output: Transaction signature

Generated using TypeDoc