-
-
-
-
- TODO:
-
-
- TODO:
-
-
+
+
+
+
+
+
+
+
+ {/*
+
+ TODO:
TODO:
+ */}
TODO:
@@ -59,15 +81,17 @@ export const RewardsContainer = () => {
);
};
-export const RewardPot = ({ accounts }: { accounts: Account[] | null }) => {
+export const RewardPot = ({
+ accounts,
+ rewardAssetId,
+}: {
+ accounts: Account[] | null;
+ rewardAssetId: string; // VEGA
+}) => {
const rewardAccounts = accounts
? accounts.filter((a) => REWARD_ACCOUNT_TYPES.includes(a.type))
: [];
- const vestedRewardAccounts = accounts
- ? accounts.filter((a) => a.type === AccountType.ACCOUNT_TYPE_VESTED_REWARDS)
- : [];
-
const totalRewards = BigNumber.sum.apply(
null,
rewardAccounts.length
@@ -75,28 +99,110 @@ export const RewardPot = ({ accounts }: { accounts: Account[] | null }) => {
: [0]
);
- const totalVestedRewards = BigNumber.sum.apply(
+ const rewardAssetAccounts = accounts
+ ? accounts.filter((a) => {
+ return a.asset.id === rewardAssetId;
+ })
+ : [];
+
+ const vestedRewardAssetAccounts = rewardAssetAccounts.filter(
+ (a) => a.type === AccountType.ACCOUNT_TYPE_VESTED_REWARDS
+ );
+
+ const vestingRewardAssetAccounts = rewardAssetAccounts.filter(
+ (a) => a.type === AccountType.ACCOUNT_TYPE_VESTED_REWARDS
+ );
+
+ const totalVestedRewardsByRewardAsset = BigNumber.sum.apply(
null,
- vestedRewardAccounts.length
- ? vestedRewardAccounts.map((a) =>
- getQuantumValue(a.balance, a.asset.quantum)
- )
+ vestedRewardAssetAccounts.length
+ ? vestedRewardAssetAccounts.map((a) => a.balance)
: [0]
);
+ const totalVestingRewardsByRewardAsset = BigNumber.sum.apply(
+ null,
+ vestingRewardAssetAccounts.length
+ ? vestingRewardAssetAccounts.map((a) => a.balance)
+ : [0]
+ );
+
+ const totalRewardAsset = totalVestedRewardsByRewardAsset.plus(
+ totalVestingRewardsByRewardAsset
+ );
+
return (
-
- {totalRewards.toString()} {t('qUSD')}
-
-
- {totalVestedRewards.toString()} {t('qUSD')}
-
-
{t('Redeem')}
+
+
+ {totalRewardAsset.toString()} {t('VEGA')}
+
+ }
+ />
+
+ {totalRewards.toString()} {t('qUSD')}
+
+ }
+ />
+
+
+
+
+ {t('Locked VEGA')}
+ FOO
+
+
+ {t('Vesting VEGA')}
+
+ {totalVestingRewardsByRewardAsset.toString()}
+
+
+
+ {t('Available to withdraw this epoch')}
+
+ {totalVestedRewardsByRewardAsset.toString()}
+
+
+
+
+ {t('Redeem')}
+
+
);
};
-const ActivityStreak = () => {
- return
ActivityStreak
;
+const Vesting = ({ baseRate }: { baseRate: string }) => {
+ const baseRateFormatted = formatPercentage(Number(baseRate));
+ return (
+
+
+
+
+ {t('Base rate')}
+ {baseRateFormatted}%
+
+
+ {t('Vesting multiplier')}
+ 0%
+
+
+ {t('Available to withdraw next epoch')}
+ 0%
+
+
+
+ );
+};
+
+const Multipliers = () => {
+ return (
+
+
{t('No active reward bonuses')}
+
+ );
};
diff --git a/libs/network-parameters/src/use-network-params.ts b/libs/network-parameters/src/use-network-params.ts
index 7639e3e19..68d1aff54 100644
--- a/libs/network-parameters/src/use-network-params.ts
+++ b/libs/network-parameters/src/use-network-params.ts
@@ -8,6 +8,7 @@ import {
export const NetworkParams = {
blockchains_ethereumConfig: 'blockchains_ethereumConfig',
reward_asset: 'reward_asset',
+ rewards_activityStreak_benefitTiers: 'rewards_activityStreak_benefitTiers',
rewards_marketCreationQuantumMultiple:
'rewards_marketCreationQuantumMultiple',
reward_staking_delegation_payoutDelay:
@@ -178,7 +179,6 @@ export const NetworkParams = {
transfer_fee_factor: 'transfer_fee_factor',
transfer_minTransferQuantumMultiple: 'transfer_minTransferQuantumMultiple',
network_validators_incumbentBonus: 'network_validators_incumbentBonus',
- rewards_activityStreak_benefitTiers: 'rewards_activityStreak_benefitTiers',
} as const;
type Params = typeof NetworkParams;