Represents a Participation Reward.

Hierarchy

Constructors

Properties

Accessors

Methods

Constructors

  • Creates a new ParticipationReward instance.

    Parameters

    • _participation: NectarMissionParticipation

      The NectarMissionParticipation instance that the reward belongs to.

    • _reward: EarnedReward

      The underlying EarnedReward object representing the reward data.

    Returns ParticipationReward

Properties

_reward: EarnedReward

Accessors

  • get amount(): bignum
  • Gets the amount of the reward.

    Returns bignum

    The amount of the reward.

    Example

    const participationReward = new ParticipationReward(participation, rewardData);
    const amount = participationReward.amount;
    console.log(amount); // Output: 100
  • get collected(): boolean
  • Checks if the reward has been collected.

    Returns boolean

    True if the reward has been collected, false otherwise.

    Example

    const participationReward = new ParticipationReward(participation, rewardData);
    const isCollected = participationReward.collected;
    console.log(isCollected); // Output: true

Methods

  • Checks if the reward is of type ParticipationCurrencyRewards.

    Returns this is ParticipationCurrencyRewards

    True if the reward is of type ParticipationCurrencyRewards, false otherwise.

    Example

    const participationReward = new ParticipationReward(participation, rewardData);
    if (participationReward.isCurrency()) {
    const currencyReward = participationReward as ParticipationCurrencyRewards;
    const currency = currencyReward.currency();
    console.log(currency.symbol); // Output: "USD" (assuming rewardData.rewardType is of type "Currency")
    }
  • Gets the NectarMissionParticipation instance associated with the reward.

    Returns NectarMissionParticipation

    The NectarMissionParticipation instance.

    Example

    const participationReward = new ParticipationReward(participation, rewardData);
    const participation = participationReward.participation();
    console.log(participation.wallet); // Output: Wallet public key of the participant

Generated using TypeDoc