Skip to content

Commit

Permalink
feat: add XDAI balance instead of address
Browse files Browse the repository at this point in the history
  • Loading branch information
mohandast52 committed Sep 25, 2024
1 parent 9f2929d commit 41d056f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
10 changes: 2 additions & 8 deletions frontend/components/YourWalletPage/YourAgent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,6 @@ export const YourAgentWallet = () => {
];
}, [agentSafeBalance?.OLAS, accruedServiceStakingRewards, reward]);

const agentXdaiBalance = useMemo(
() => (agentSafeBalance?.ETH ?? 0) + (agentEoaBalance?.ETH ?? 0),
[agentSafeBalance?.ETH, agentEoaBalance?.ETH],
);

return (
<Card>
<Container>
Expand Down Expand Up @@ -154,7 +149,7 @@ export const YourAgentWallet = () => {
{
left: <XdaiTitle />,
leftClassName: 'text-light text-sm',
right: `${balanceFormat(agentXdaiBalance, 2)} XDAI`,
right: `${balanceFormat(agentSafeBalance?.ETH, 2)} XDAI`,
},
]}
parentStyle={infoBreakdownParentStyle}
Expand All @@ -172,8 +167,7 @@ export const YourAgentWallet = () => {
/>
),
leftClassName: 'text-light text-sm',
right: <AddressLink address={agentEoaAddress} />,
rightClassName: 'font-normal',
right: `${balanceFormat(agentEoaBalance?.ETH, 2)} XDAI`,
},
]}
parentStyle={infoBreakdownParentStyle}
Expand Down
12 changes: 4 additions & 8 deletions frontend/components/YourWalletPage/YourWallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,7 @@ const OlasBalance = () => {
};

const XdaiBalance = () => {
const { safeBalance, eoaBalance } = useBalance();
const totalXdaiBalance = useMemo(
() => (safeBalance?.ETH ?? 0) + (eoaBalance?.ETH ?? 0),
[safeBalance?.ETH, eoaBalance?.ETH],
);
const { safeBalance } = useBalance();

return (
<Flex vertical gap={8}>
Expand All @@ -97,7 +93,7 @@ const XdaiBalance = () => {
{
left: <Text strong>XDAI</Text>,
leftClassName: 'text-light',
right: `${balanceFormat(totalXdaiBalance, 2)} XDAI`,
right: `${balanceFormat(safeBalance?.ETH, 2)} XDAI`,
},
]}
parentStyle={infoBreakdownParentStyle}
Expand All @@ -108,6 +104,7 @@ const XdaiBalance = () => {

const Signer = () => {
const { masterEoaAddress } = useWallet();
const { eoaBalance } = useBalance();

return (
<Flex vertical gap={8}>
Expand All @@ -121,8 +118,7 @@ const Signer = () => {
/>
),
leftClassName: 'text-light',
right: <AddressLink address={masterEoaAddress} />,
rightClassName: 'font-normal',
right: `${balanceFormat(eoaBalance?.ETH, 2)} XDAI`,
},
]}
parentStyle={infoBreakdownParentStyle}
Expand Down

0 comments on commit 41d056f

Please sign in to comment.