diff --git a/apps/explorer/src/app/components/txs/details/transfer/blocks/transfer-rewards.tsx b/apps/explorer/src/app/components/txs/details/transfer/blocks/transfer-rewards.tsx
index 39116a94c..56eaafa12 100644
--- a/apps/explorer/src/app/components/txs/details/transfer/blocks/transfer-rewards.tsx
+++ b/apps/explorer/src/app/components/txs/details/transfer/blocks/transfer-rewards.tsx
@@ -41,46 +41,57 @@ export function TransferRewards({ recurring }: TransferRewardsProps) {
return null;
}
+ // Destructure to make things a bit more readable
+ const {
+ assetForMetric,
+ entityScope,
+ individualScope,
+ teamScope,
+ distributionStrategy,
+ lockPeriod,
+ markets,
+ stakingRequirement,
+ windowLength,
+ notionalTimeWeightedAveragePositionRequirement,
+ rankTable,
+ nTopPerformers,
+ } = recurring.dispatchStrategy;
+
return (
-
{t('Reward metrics')}
+
{getRewardTitle(entityScope)}
- {recurring.dispatchStrategy.assetForMetric ? (
+ {assetForMetric ? (
-
{t('Asset')}:{' '}
-
+
) : null}
-
{t('Metric')}: {metricLabels[metric]}
- {recurring.dispatchStrategy.entityScope &&
- entityScopeIcons[recurring.dispatchStrategy.entityScope] ? (
+ {entityScope && entityScopeIcons[entityScope] ? (
-
{t('Scope')}:{' '}
-
+
+ {individualScope ? individualScopeLabels[individualScope] : null}
) : null}
- {recurring.dispatchStrategy.individualScope}
- {recurring.dispatchStrategy.teamScope}
+ {teamScope}
+ {distributionStrategy}
- {recurring.dispatchStrategy.lockPeriod &&
- recurring.dispatchStrategy.lockPeriod !== '0' ? (
+ {lockPeriod && lockPeriod !== '0' ? (
-
- {t('Lock')}:{' '}
- {recurring.dispatchStrategy.lockPeriod}
+ {t('Lock')}: {lockPeriod}
) : null}
- {recurring.dispatchStrategy.markets &&
- recurring.dispatchStrategy.markets.length > 0 ? (
+ {markets && markets.length > 0 ? (
-
{t('Markets in scope')}:
- {recurring.dispatchStrategy.markets.map((m) => (
+ {markets.map((m) => (
-
@@ -89,27 +100,38 @@ export function TransferRewards({ recurring }: TransferRewardsProps) {
) : null}
- {recurring.dispatchStrategy.stakingRequirement &&
- recurring.dispatchStrategy.stakingRequirement !== '0' ? (
+ {stakingRequirement && stakingRequirement !== '0' ? (
-
- {t('Staking requirement')}:{' '}
- {recurring.dispatchStrategy.stakingRequirement}
+ {t('Staking requirement')}: {stakingRequirement}
) : null}
- {recurring.dispatchStrategy.windowLength &&
- recurring.dispatchStrategy.windowLength !== '0' ? (
+ {windowLength && windowLength !== '0' ? (
-
{t('Window length')}:{' '}
{recurring.dispatchStrategy.windowLength}
) : null}
- {recurring.dispatchStrategy.rankTable &&
- recurring.dispatchStrategy.rankTable.length > 0 ? (
+ {notionalTimeWeightedAveragePositionRequirement &&
+ notionalTimeWeightedAveragePositionRequirement !== '' ? (
-
- {t('Ranks')}:{' '}
- {recurring.dispatchStrategy.rankTable.toString()}
+
+ {t('notionalTimeWeightedAveragePositionRequirement')}
+
+ : {notionalTimeWeightedAveragePositionRequirement}
+
+ ) : null}
+
+ {nTopPerformers && (
+ -
+ {t('Top performers')}: {nTopPerformers}
+
+ )}
+
+ {rankTable && rankTable.length > 0 ? (
+ -
+ {t('Ranks')}: {rankTable.toString()}
) : null}
@@ -117,6 +139,15 @@ export function TransferRewards({ recurring }: TransferRewardsProps) {
);
}
+export function getRewardTitle(
+ scope?: components['schemas']['vegaEntityScope']
+) {
+ if (scope === 'ENTITY_SCOPE_TEAMS') {
+ return t('Game');
+ }
+ return t('Reward metrics');
+}
+
interface TransferRecurringStrategyProps {
strategy: Strategy;
}
@@ -147,3 +178,14 @@ export function TransferRecurringStrategy({
>
);
}
+
+const individualScopeLabels: Record<
+ components['schemas']['vegaIndividualScope'],
+ string
+> = {
+ // Unspecified and All are not rendered
+ INDIVIDUAL_SCOPE_UNSPECIFIED: '',
+ INDIVIDUAL_SCOPE_ALL: '',
+ INDIVIDUAL_SCOPE_IN_TEAM: '(in team)',
+ INDIVIDUAL_SCOPE_NOT_IN_TEAM: '(not in team)',
+};