fix: network switching error when trying to pay a req#661
fix: network switching error when trying to pay a req#661Hugo0 merged 1 commit intopeanut-walletfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThe pull request updates the wallet hook in Changes
Sequence Diagram(s)sequenceDiagram
participant C as Component
participant W as useWallet Hook
participant U as useAccount Hook
C->>W: Request wallet info
W->>U: Call useAccount
U-->>W: Return { wagmiChain, ... }
alt Selected wallet is Peanut
W->>W: Set chain = PEANUT_WALLET_CHAIN
else
W->>W: Set chain = wagmiChain
end
W-->>C: Return wallet object with chain property
Possibly related PRs
Suggested reviewers
Poem
Tip 🌐 Web search-backed reviews and chat
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/hooks/wallet/useWallet.ts (1)
234-234: LGTM: Fixed network switching by implementing proper chain selection.The conditional chain selection correctly handles both Peanut and external wallets, resolving the network switching error during payment requests.
This change improves wallet interoperability by:
- Using a fixed chain for Peanut wallets
- Respecting the connected chain for external wallets
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/hooks/wallet/useWallet.ts(2 hunks)
🔇 Additional comments (1)
src/hooks/wallet/useWallet.ts (1)
47-47: LGTM: Correctly added wagmiChain from useAccount hook.The addition of
wagmiChainis necessary for proper network handling and follows the established naming pattern.
Hugo0
left a comment
There was a problem hiding this comment.
Good catch, oversight bug. I think useWallet would benefit from a docstring
Summary by CodeRabbit