Creates a new ParticipationReward instance.
The NectarMissionParticipation instance that the reward belongs to.
The underlying EarnedReward object representing the reward data.
Protected _participationProtected _rewardGets the amount of the reward.
The amount of the reward.
const participationReward = new ParticipationReward(participation, rewardData);
const amount = participationReward.amount;
console.log(amount); // Output: 100
Checks if the reward has been collected.
True if the reward has been collected, false otherwise.
const participationReward = new ParticipationReward(participation, rewardData);
const isCollected = participationReward.collected;
console.log(isCollected); // Output: true
Checks if the reward is of type ParticipationCurrencyRewards.
True if the reward is of type ParticipationCurrencyRewards, false otherwise.
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.
The NectarMissionParticipation instance.
const participationReward = new ParticipationReward(participation, rewardData);
const participation = participationReward.participation();
console.log(participation.wallet); // Output: Wallet public key of the participant
Generated using TypeDoc
Represents a Participation Reward.