-
Notifications
You must be signed in to change notification settings - Fork 85
Add featured and single wallet options to Reown integration #244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: v6
Are you sure you want to change the base?
Conversation
Introduces support for 'featuredWalletIds' and 'singleWalletId' in ReownOptions, allowing more granular control over wallet selection in the Reown wallet integration. Updates the PlaygroundManager example to showcase these new options and adds an OAuthProvider enum for improved social login handling. Also updates Reown package dependencies to version 1.5.1.
WalkthroughThis PR adds OAuth provider selection and social wallet support, extends Reown configuration with FeaturedWalletIds and SingleWalletId (including validation), updates Reown connection flow to support direct single-wallet connections, and bumps multiple Reown package versions from 1.5.0 to 1.5.1. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Playground as PlaygroundManager
participant ReownWallet
participant AppKit
rect rgb(245,245,245)
Note over User,AppKit: Single-wallet flow (SingleWalletId present)
User->>Playground: Select Reown wallet
Playground->>ReownWallet: Create(..., singleWalletId="id")
ReownWallet->>ReownWallet: Clear AppKit included/excluded/featured
ReownWallet->>AppKit: ConnectAsync(singleWalletId)
AppKit->>User: Direct connect (no modal)
end
rect rgb(240,250,240)
Note over User,AppKit: Featured-wallets flow (FeaturedWalletIds present)
User->>Playground: Select Reown wallet
Playground->>ReownWallet: Create(..., featuredWalletIds=[...])
ReownWallet->>ReownWallet: Populate AppKit featured list
ReownWallet->>AppKit: OpenModal()
AppKit->>User: Show modal with featured wallets
end
rect rgb(250,240,245)
Note over User,Playground: OAuth social flow
User->>Playground: Choose Social provider
Playground->>Playground: Map OAuthProvider -> AuthProvider
Playground->>InAppWallet: Create/InAppWalletOptions(authProvider)
InAppWallet->>User: OAuth authentication flow
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (1)
🧰 Additional context used🧬 Code graph analysis (1)Assets/Thirdweb/Examples/Scripts/PlaygroundManager.cs (2)
🔇 Additional comments (1)
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
Assets/Thirdweb/Examples/Scripts/PlaygroundManager.cs (1)
149-151
: Guard against enum drift at runtime.
Enum.Parse
will throw ifOAuthProvider
ever gains a value thatAuthProvider
doesn’t recognize. UsingEnum.TryParse
with a safe fallback (e.g.,AuthProvider.Default
) would keep the playground from hard-crashing during demos while still supporting future additions.- var parsedOAuthProvider = (AuthProvider)System.Enum.Parse(typeof(AuthProvider), this.Social.ToString()); + if (!System.Enum.TryParse<AuthProvider>(this.Social.ToString(), out var parsedOAuthProvider)) + { + parsedOAuthProvider = AuthProvider.Default; + }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (5)
Assets/Thirdweb/Examples/Scripts/PlaygroundManager.cs
(4 hunks)Assets/Thirdweb/Runtime/Unity/ThirdwebManagerBase.cs
(2 hunks)Assets/Thirdweb/Runtime/Unity/Wallets/Reown/ReownWallet.cs
(5 hunks)Packages/manifest.json
(1 hunks)Packages/packages-lock.json
(2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
Assets/Thirdweb/Examples/Scripts/PlaygroundManager.cs (2)
Assets/Thirdweb/Runtime/Unity/ThirdwebManagerBase.cs (4)
WalletOptions
(233-248)InAppWalletOptions
(22-43)ReownOptions
(184-209)SmartWalletOptions
(134-151)Assets/Thirdweb/Runtime/Unity/Wallets/Reown/ReownWallet.cs (2)
ReownWallet
(14-355)ReownWallet
(24-24)
🔇 Additional comments (1)
Assets/Thirdweb/Runtime/Unity/Wallets/Reown/ReownWallet.cs (1)
301-308
: Graceful direct-connect fallback looks solid.Nice touch using
singleWalletId
to try a directConnectAsync
before falling back to the modal—captures the single-wallet UX without breaking existing multi-wallet behavior.
Replaces Enum.Parse with Enum.TryParse for social auth provider selection. Defaults to Google provider if parsing fails, preventing potential runtime errors.
Introduces support for 'featuredWalletIds' and 'singleWalletId' in ReownOptions, allowing more granular control over wallet selection in the Reown wallet integration. Updates the PlaygroundManager example to showcase these new options and adds an OAuthProvider enum for improved social login handling. Also updates Reown package dependencies to version 1.5.1.
PR-Codex overview
This PR focuses on updating the version of several
com.reown
packages inmanifest.json
and adding new properties to theReownOptions
class inThirdwebManagerBase.cs
to enhance wallet connection functionality, including support for featured wallets and single wallet IDs.Detailed summary
com.reown
packages from version1.5.0
to1.5.1
inPackages/manifest.json
.FeaturedWalletIds
andSingleWalletId
properties toReownOptions
inThirdwebManagerBase.cs
.SingleWalletId
with other wallet ID options.ConnectWallet
method.ReownWallet
class to handle new wallet options.OAuthProvider
enum inPlaygroundManager.cs
for social login options.Wallet_Social
method to parse the newSocial
property and use it for wallet options.Wallet_External_Direct
method for direct wallet connection usingSingleWalletId
.Summary by CodeRabbit
New Features
Chores