Skip to content

V3 support#55

Open
mithatakbulut wants to merge 31 commits intomasterfrom
v3-support
Open

V3 support#55
mithatakbulut wants to merge 31 commits intomasterfrom
v3-support

Conversation

@mithatakbulut
Copy link

@mithatakbulut mithatakbulut commented Jan 29, 2026

https://github.com/0xsequence/issue-tracker/issues/6276

Please don't merge it - yet 🚧

Prettier is broken, after review last thing I'll do is running pnpm format. I don't want to make a mess right now

…r updates for @0xsequence packages and addition of new dependencies (jotai, mipd, ox, viem)
- Introduced a new manager module to handle wallet state and configuration using Sequence.
- Added a networks module to define supported blockchain networks and their RPC URLs.
- Updated the default RPC URLs for several networks in the constants.
- Removed the deprecated sessions module and added a new token metadata key in storage constants.
- Deleted the address utility functions from `src/utils/address.ts`.
- Introduced new utility modules for formatting display values, pretty balance formatting, and transaction parsing.
- Added functions for handling wallet recovery state and token record creation.
- Updated network information in `src/utils/network.ts` to include resource status and source for native tokens.
- Enhanced transaction handling with a parser for different token types.
- Added a new `QueuedPayloadsStore` to handle queued recovery payloads based on user account changes.
- Introduced methods for fetching, adding, and clearing payloads, ensuring efficient management of recovery data.
- Updated `AuthStore` integration to trigger payload fetching upon account address changes.
- Enhanced loading state management for better user experience during data retrieval.
… Recovery route for handling both v2 and v3 mnemonics
- Introduced `NetworkModal` for managing network configurations.
- Added `SendCollectibleModal` for sending collectibles with customizable options.
- Created `SendTokenModal` for token transactions, allowing for dismissible behavior.
- Implemented `SignMessageModal` for signing messages with mobile responsiveness.
- Added `SignTransactionModal` for transaction signing with enhanced user interface.
- Introduced hooks for handling mnemonic input, transaction signing, and payload execution.
- Added hooks for managing queued payloads and external provider synchronization.
- Implemented hooks for token recovery and transaction handling, enhancing wallet functionality.
- Created hooks for fetching token metadata and managing modal states for user interactions.
- Added `RecoveryQueue` component to display and manage queued recovery payloads with filtering options.
- Introduced `QueuePayloadItem` for individual payload details, including execution status and action buttons.
- Created `InsufficientBalanceMessage` to inform users of balance issues during recovery actions.
- Implemented `PayloadStatusBadge` to visually represent the status of each payload.
- Added `PayloadDetailsCollapsible` and `ExecutionDetails` for detailed transaction information.
- Enhanced user experience with loading states and dynamic filtering by blockchain network.
- Removed console log from `ImportCollectible` for cleaner code.
- Updated `Image` components in `ImportCollectible` and `ImportToken` to include `borderRadius="circle"` for improved styling.
- Refactored `SendCollectible` and `SendToken` components to include new props for recovery and dismissible state management.
- Added transaction status monitoring and insufficient balance warnings in `SendCollectible` and `SendToken` for better user feedback.
- Improved default value handling for amounts and addresses in both send components.
@mithatakbulut mithatakbulut requested a review from a team as a code owner January 29, 2026 15:54
@mithatakbulut mithatakbulut marked this pull request as draft January 29, 2026 15:54
When users rejected a transaction on MetaMask and clicked "Recover" again,
the loading state would disappear prematurely even though MetaMask was still
showing the popup. This occurred because the useEffect monitoring transaction
status was reacting to the previous cancelled transaction instead of the new
recovery attempt.

The fix clears the recoveryPayloadId state before starting a new recovery
attempt, ensuring that each retry starts with a clean slate and the loading
state correctly tracks the current transaction.

Changes:
- Clear recoveryPayloadId before initiating new recovery in SendToken.tsx
- Clear recoveryPayloadId before initiating new recovery in SendCollectible.tsx
- Add clarifying comments to transaction status monitoring useEffect
… payloads

Previously, recovery payload items would show "Insufficient balance" if the required tokens or collectibles hadn't been manually imported by the user, even when the user actually owned them. This caused confusion and required users to manually import tokens before they could see accurate balance information.

This commit implements automatic balance fetching for tokens and collectibles referenced in recovery payloads:

- Added `fetchTokenBalanceIfMissing()` method to TokenStore that automatically fetches and caches token balances (both native and ERC20) when they're not already in the global state
- Added `fetchCollectibleInfoIfMissing()` method to CollectibleStore that automatically fetches and caches collectible ownership information (ERC721 and ERC1155) when missing
- Modified `useBalanceCheck` hook to proactively fetch missing balances when payload items are loaded, eliminating the need for manual token imports before viewing recovery payloads
- Improved balance lookup logic to include chainId matching, preventing incorrect balance checks across different chains

This ensures accurate balance information is displayed for all recovery payloads without requiring users to manually import tokens first.
…transaction handling with address validation.
@matt416
Copy link

matt416 commented Jan 30, 2026

@matt416
Copy link

matt416 commented Jan 30, 2026

  • What does the Enter wallet address manually do for the user? If I change this will the mnemonic will no longer be correct for the wallet and I won't be able to log in?
image

@matt416
Copy link

matt416 commented Jan 30, 2026

  • What does creating a password enable for the user?
Screenshot 2026-01-30 at 8 17 54 AM

@matt416
Copy link

matt416 commented Jan 30, 2026

The sendRecoveryPayload function was hardcoded to always use MetaMask regardless of which external wallet was actually connected. This caused transactions to fail or be routed incorrectly when users connected other wallets like Rabbit Wallet.

Changes:
- Replace hardcoded MetaMask provider lookup with selectedExternalProvider from WalletStore
- Add proper TypeScript type assertions for eth_requestAccounts and eth_sendTransaction responses
- Ensure transactions are executed through the wallet the user actually connected
@mithatakbulut
Copy link
Author

  • What does the Enter wallet address manually do for the user? If I change this will the mnemonic will no longer be correct for the wallet and I won't be able to log in?
image

Yeah it doesn't make sense. I'll make it just rely on entered mnemonics. Thanks!

@mithatakbulut
Copy link
Author

  • What does creating a password enable for the user?
Screenshot 2026-01-30 at 8 17 54 AM

If you enter a password, you’ll have to re-enter it every time you refresh the page. Think about it: over the course of a month, your computer could end up in someone else’s hands, etc.

This is a practice carried over from v2 recovery, but it’s still valid and useful for v3. If you don’t enter a password, you can just refresh the page and continue with your actions.

Removed the ability to manually enter wallet addresses during recovery. The recovery process now exclusively uses automatically discovered wallet addresses from the mnemonic phrase. This simplifies the recovery flow and reduces potential user errors from manually entering incorrect addresses.

Changes:
- Removed showManualAddress state from FormState interface
- Removed handleManualWalletChange callback function
- Removed manual address input UI component
- Removed "Enter wallet address manually" button
- Recovery now relies solely on automatic wallet discovery
This was referenced Jan 30, 2026
@mithatakbulut mithatakbulut self-assigned this Feb 2, 2026
@mithatakbulut mithatakbulut marked this pull request as ready for review February 2, 2026 14:08
@matt416
Copy link

matt416 commented Feb 2, 2026

@mithatakbulut I ran into two issues with password

  • My password wouldn't work when I refreshed
image
  • The password only protected the browser that it was set in, when I visited with a different browser and used my mnemonic no password was required

- Introduced `initApp` function to handle application setup, including state clearing on first load.
- Added session storage management for navigation state to facilitate redirection to recovery page.
- Removed `PasswordUnlock` component from various routes to streamline the recovery process.
- Implemented `clearAllState` utility to clear local storage and IndexedDB data.
- Updated routing logic to ensure proper navigation based on application state.
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