Represents a Mission Reward of type MissionCurrencyRewards.

Hierarchy

Constructors

Properties

Accessors

Methods

Constructors

Properties

_mission: NectarMission
_reward: Reward

Accessors

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

    Returns bignum

    The maximum amount.

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

    Returns bignum

    The minimum amount.

  • get uiAmount(): string
  • Gets the user interface (UI) amount representation of the reward.

    Returns string

    The UI amount string.

    Example

    // Example 1:
    const reward = new MissionReward(mission, rewardData);
    console.log(reward.uiAmount); // Output: "5" (if rewardData.min and rewardData.max are both 5000000000)

    // Example 2:
    const reward = new MissionReward(mission, rewardData);
    console.log(reward.uiAmount); // Output: "1-10" (if rewardData.min is 1000000000 and rewardData.max is 10000000000)

Methods

  • Gets the currency associated with the reward.

    Returns HplCurrency

    The currency instance.

    Throws

    If the reward is not a currency.

    Example

    const currencyReward = new MissionCurrencyRewards(mission, rewardData);
    const currency = currencyReward.currency();
    console.log(currency.symbol); // Output: "USD" (assuming rewardData.rewardType.address points to a valid currency token)

Generated using TypeDoc