Display User Balance Using starknet-react After Wallet Connect
#56 aperta il 23 apr 2025
Metriche repository
- Star
- (5 stelle)
- Metriche merge PR
- (Metriche PR in attesa)
Descrizione
📌 Description:
After the user has connected their wallet (via Invisible SDK or Cartridge Controller), display their token balance next to their wallet address in the UI using starknet-react.
This balance display must adhere to the existing style guide and be reactive to wallet connection status.
🧠 Context:
Now that wallet connection flows are being implemented, the user interface should give immediate feedback on the wallet’s status, including address and token balance. This improves transparency and UX across the app.
🧭 Proposed Actions:
- Use
starknet-reactto detect connected wallet (useStarknetAccount) - Fetch the native token balance using
useBalanceor a custom hook - Display:
- Formatted token balance (e.g.,
10.25 ETH)
- Formatted token balance (e.g.,
- Place this display next to or under the address in the existing UI
- Style the component based on the app’s current design system (font, color, spacing)
- Ensure the layout works well across all screen sizes
✅ Acceptance Criteria:
- Wallet balance is fetched and displayed using
starknet-react - Display updates/reacts automatically when wallet is connected
- Adheres to visual and functional style guidelines
- UI is responsive and readable on both desktop and mobile
- No unnecessary re-renders or flickers in data fetching
🕒 Timeframe:
No strict deadline, but this task is essential for polishing the wallet UX and should follow after the connection flows are implemented.