Skip to content

Conversation

@wheval
Copy link

@wheval wheval commented Jul 12, 2025

🚀 Pull Request

📝 Description

  • This PR closes Display User Balance Using starknet-react After Wallet Connect #56
  • Created useTokenBalance hook for fetching ETH balance using ERC20 ABI with 30-second polling
  • Enhanced AddressBar component to display balance in compact button and expanded modal views
  • Added comprehensive dark mode support with dark: classes for all AddressBar elements
  • Fixed chain ID format from numeric to hex values for Cartridge Controller compatibility
  • Separated chain configs: BigInt IDs for starknet-react, hex IDs for Cartridge Controller
  • Fixed BigInt arithmetic error by changing multiplication to bit shifting operation
  • Added network-aware account detection using provider.getClassHashAt() instead of account method
  • Created utils/networkUtils.ts with network helper functions for info, names, and explorer URLs
  • Added network status indicators with green dot for mainnet and blue dot for testnet
  • Implemented dynamic deployment status messages based on current network and account status
  • Simplified network configuration to single constant NETWORK: "sepolia" | "mainnet"
  • Added defaultChainId prop to StarknetConfig to respect NETWORK constant setting
  • Fixed StarknetProvider SSR error with lazy ControllerConnector initialization using window check
  • Fixed TotalTransactionChart SSR error by replacing direct window.innerWidth with React state
  • Fixed PaymentModal TypeScript error by adding proper null checks for user variable
  • Updated useEffect dependencies from chain to chain?.id to prevent size change errors

🔄 Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • UI/UX improvement
  • Performance optimization
  • Code refactor
  • Documentation update
  • Test coverage
  • CI/CD improvement
  • Other (please describe):

🧪 How Has This Been Tested?

  • Unit tests
  • Integration tests
  • Manual testing
  • Accessibility testing
  • Cross-browser testing

📸 Screenshots

Screenshot (155)

📋 Checklist

  • My code follows the project's coding style
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing tests pass locally with my changes
  • Any dependent changes have been merged and published

📚 Additional Context

🔗 Related Issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Display User Balance Using starknet-react After Wallet Connect

1 participant