setIsExpanded(!isExpanded)} className="card--value card-header--wrapper">
@@ -158,12 +161,8 @@ const OutputView: React.FC
= ({ outputId, output, showCopyAmoun
{(output.type === OutputType.Basic ||
output.type === OutputType.Account ||
output.type === OutputType.Anchor ||
- output.type === OutputType.Nft) && (
-
- Stored mana:
- {(output as BasicOutput).mana?.toString()}
-
- )}
+ output.type === OutputType.Nft) &&
+ manaDetails?.totalMana && }
{output.type === OutputType.Delegation && (
Delegated amount:
diff --git a/client/src/app/lib/interfaces/index.ts b/client/src/app/lib/interfaces/index.ts
index 204986b69..9d55bc6d7 100644
--- a/client/src/app/lib/interfaces/index.ts
+++ b/client/src/app/lib/interfaces/index.ts
@@ -1 +1,2 @@
export * from "./routes.interfaces";
+export * from "./key-value.interfaces";
diff --git a/client/src/app/lib/interfaces/key-value.interfaces.ts b/client/src/app/lib/interfaces/key-value.interfaces.ts
new file mode 100644
index 000000000..ecff91434
--- /dev/null
+++ b/client/src/app/lib/interfaces/key-value.interfaces.ts
@@ -0,0 +1,8 @@
+export interface IKeyValue {
+ label: string;
+ value: string | number | null | undefined;
+}
+
+export interface IKeyValueEntries extends IKeyValue {
+ entries?: IKeyValue[];
+}
diff --git a/client/src/app/routes/nova/OutputPage.tsx b/client/src/app/routes/nova/OutputPage.tsx
index 1abdfaf8d..17006ce17 100644
--- a/client/src/app/routes/nova/OutputPage.tsx
+++ b/client/src/app/routes/nova/OutputPage.tsx
@@ -81,7 +81,13 @@ const OutputPage: React.FC> = ({
-
+
diff --git a/client/src/helpers/nova/manaUtils.ts b/client/src/helpers/nova/manaUtils.ts
index 255c013ea..06f29cd44 100644
--- a/client/src/helpers/nova/manaUtils.ts
+++ b/client/src/helpers/nova/manaUtils.ts
@@ -1,4 +1,5 @@
import { BasicOutput, ManaRewardsResponse, Output, ProtocolParameters, Utils } from "@iota/sdk-wasm-nova/web";
+import { IKeyValueEntries } from "~/app/lib/interfaces";
export interface OutputManaDetails {
storedMana: string;
@@ -33,3 +34,31 @@ export function buildManaDetailsForOutput(
totalMana: totalMana.toString(),
};
}
+
+export function getManaKeyValueEntries(manaDetails: OutputManaDetails | null): IKeyValueEntries {
+ const showDecayMana = manaDetails?.storedMana && manaDetails?.storedManaDecayed;
+ const decay = showDecayMana ? Number(manaDetails?.storedMana ?? 0) - Number(manaDetails?.storedManaDecayed ?? 0) : undefined;
+
+ return {
+ label: "Mana:",
+ value: manaDetails?.totalMana,
+ entries: [
+ {
+ label: "Stored:",
+ value: manaDetails?.storedMana,
+ },
+ {
+ label: "Decay:",
+ value: decay,
+ },
+ {
+ label: "Potential:",
+ value: manaDetails?.potentialMana,
+ },
+ {
+ label: "Delegation Rewards:",
+ value: manaDetails?.delegationRewards,
+ },
+ ],
+ };
+}