Skip to content

Multi-Signer support#87

Draft
h-adamik wants to merge 147 commits into
mainfrom
multi-signer-support
Draft

Multi-Signer support#87
h-adamik wants to merge 147 commits into
mainfrom
multi-signer-support

Conversation

@h-adamik
Copy link
Copy Markdown
Member

WIP

G9NCUE added 30 commits April 10, 2025 17:29
Implement centralized chain data management using React Query to reduce
API calls and improve performance across the application.

Key changes:
- Add useChains hook with 24h cache duration
- Implement chain data prefetching at app startup
- Replace direct API calls with cached data in all components:
  • SodotConnect
  • MultiChainConnect
  • ChainSelector
  • WelcomeModal
  • SodotTestPage

Technical details:
- Use React Query for state management and caching
- Set 24h staleTime and gcTime for optimal caching
- Add proper TypeScript types for chain data
- Implement error handling and retry logic

Performance impact:
- Reduce multiple chain API calls to a single call per 24h
- Improve component mount times by using cached data
- Enable offline functionality for chain data
- Reduce server load by minimizing redundant requests

Testing:
- Verify through Network tab in DevTools
- Confirm cache persistence across page refreshes
- Check data consistency across components
- Track current signer to trigger re-renders on change
- Convert chain count to reactive useMemo hook
- Add currentSigner to effect dependencies
- Reset search query when switching signers
- Ensure button shows correct count for active signer
- Move useMemo hook before conditional returns
- Ensures hooks are always called in the same order
- Fixes 'change in the order of Hooks' error
- Remove WalletProvider filtering logs
- Remove Portfolio display addresses log
- Remove SignerFactory SSR mode log
- Remove SignerFactory selected signer log
- Remove SignerFactory Starknet pubkey processing logs
- Clean up console output for production readiness
- Add currentSigner as React state to trigger re-renders
- Listen for storage events for cross-tab signer changes
- Update signer change event handler to update state
- Explicitly filter addresses by current signer in chain count
- Ensure chain count always reflects current signer's connections
- Remove selectedChains from chain count calculation
- Always show actual connected chains count, never cached selections
- Reset selectedChains when signer changes to prevent stale data
- Fixes issue where 0 connected chains showed previous signer's count
- Increase MAX_PAGES from 10 to 50 for getAllValidators
- Solana has 900+ validators requiring more pages
- Still maintains safety against infinite loops
- Add clearer warning message when limit is reached
- Log full request being sent to Adamik API
- Log complete response from Adamik API
- Include transaction data, encoded values, and status
- Help debug Solana staking transaction issues
- API returns suspicious pre-generated signature in params field
- This shouldn't exist at encoding stage (before user signs)
- PublicKey in params doesn't match user's actual key
- Adamik decoder correctly detects this as a mismatch
- Add warning when API returns pre-generated signatures
- Focus logging on Solana staking transactions only
- Previously, all non-SODOT signers were incorrectly treated as IoFinnet
- Now properly handles SODOT, IOFINNET, TURNKEY, and BLOCKDAEMON signers
- Each signer gets its correct API endpoint and payload structure
- IoFinnet approval modal only shows for IoFinnet signer
- Throws clear error for unsupported signer types
- Matches implementation pattern in TransferTransactionForm and StakingTransactionForm

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
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.

2 participants