Skip to content

Commit 42944c6

Browse files
committed
feat: add nrlcToRlc utility function and update success message in FaucetRoute
1 parent e3f3641 commit 42944c6

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/routes/$chainSlug/_layout/faucet.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { FaucetBreadcrumbs } from '@/modules/faucet/FaucetBreadcrumbs';
2121
import useUserStore from '@/stores/useUser.store';
2222
import { getBlockExplorerUrl } from '@/utils/chain.utils';
2323
import wagmiNetworks from '@/utils/wagmiNetworks';
24+
import { nrlcToRlc } from '@/utils/nrlcToRlc';
2425

2526
export const Route = createFileRoute('/$chainSlug/_layout/faucet')({
2627
component: FaucetRoute,
@@ -93,7 +94,7 @@ function FaucetRoute() {
9394
onSuccess: (data) => {
9495
const explorerUrl = getBlockExplorerUrl(wagmiNetworks.arbitrumSepolia.id);
9596
setSuccessMessage(
96-
`${data.amount} RLC sent to your wallet. View transaction: ${explorerUrl}/tx/${data.transactionHash}`
97+
`${nrlcToRlc(data.amount)} RLC sent to your wallet. View transaction: ${explorerUrl}/tx/${data.transactionHash}`
9798
);
9899
},
99100
onError: () => setSuccessMessage(''),

src/utils/nrlcToRlc.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export function nrlcToRlc(nrlcValue: number | null | undefined) {
2+
if (nrlcValue == null) {
3+
return '';
4+
}
5+
return nrlcValue / 10 ** 9;
6+
}

0 commit comments

Comments
 (0)