Represents a Participation Reward of type ParticipationCurrencyRewards.

Hierarchy

Constructors

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

  • Get the currency associated with the reward.

    Returns HplCurrency

    The currency object.

    Throws

    An error if the reward is not of type "Currency".

  • 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