Multi-Signer support#87
Draft
h-adamik wants to merge 147 commits into
Draft
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WIP