Skip to content

Conversation

0xFirekeeper
Copy link
Member

@0xFirekeeper 0xFirekeeper commented Oct 16, 2025

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 in manifest.json and adding new properties to the ReownOptions class in ThirdwebManagerBase.cs to enhance wallet connection functionality, including support for featured wallets and single wallet IDs.

Detailed summary

  • Updated com.reown packages from version 1.5.0 to 1.5.1 in Packages/manifest.json.
  • Added FeaturedWalletIds and SingleWalletId properties to ReownOptions in ThirdwebManagerBase.cs.
  • Implemented validation to prevent using SingleWalletId with other wallet ID options.
  • Updated wallet connection logic to include new properties in ConnectWallet method.
  • Modified ReownWallet class to handle new wallet options.
  • Introduced OAuthProvider enum in PlaygroundManager.cs for social login options.
  • Updated Wallet_Social method to parse the new Social property and use it for wallet options.
  • Added a new Wallet_External_Direct method for direct wallet connection using SingleWalletId.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Summary by CodeRabbit

  • New Features

    • Social wallet sign-in via OAuth providers.
    • Configurable featured wallet list for richer wallet discovery.
    • Single-wallet connection mode for streamlined onboarding and direct connections.
  • Chores

    • Bumped Reown-related package versions to the latest patch release.

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.
Copy link

coderabbitai bot commented Oct 16, 2025

Walkthrough

This 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

Cohort / File(s) Summary
Playground / OAuth
Assets/Thirdweb/Examples/Scripts/PlaygroundManager.cs
Adds OAuthProvider enum and public OAuthProvider Social field (default Google). Converts selected provider to an AuthProvider for InApp wallet flows. Adds/adjusts social wallet creation path.
Reown Options & Usage
Assets/Thirdweb/Runtime/Unity/ThirdwebManagerBase.cs
Adds FeaturedWalletIds (string[]) and SingleWalletId (string) to ReownOptions, extends constructor signature, assigns new fields, and enforces validation that SingleWalletId cannot be combined with other ID filters. Propagates new options to wallet creation calls.
Reown Wallet Flow
Assets/Thirdweb/Runtime/Unity/Wallets/Reown/ReownWallet.cs
Extends ReownWallet.Create(...) signature to accept featuredWalletIds and singleWalletId. Adjusts AppKitConfig population: when singleWalletId is set, clears included/excluded/featured lists and attempts direct ConnectAsync(singleWalletId) instead of opening modal. Updates WaitForInteractiveConnectionAsync to accept optional singleWalletId.
Package Updates
Packages/manifest.json, Packages/packages-lock.json
Bumps multiple com.reown.* package versions from 1.5.0 to 1.5.1 and updates lockfile entries; no new packages added or removed.

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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "Add featured and single wallet options to Reown integration" accurately and specifically captures the primary purpose of the changeset. The main modifications across multiple files—ThirdwebManagerBase.cs, ReownWallet.cs, and PlaygroundManager.cs—are centered on introducing FeaturedWalletIds and SingleWalletId properties to ReownOptions, along with corresponding validation and integration logic. The title is concise, avoids generic terminology, and a developer reviewing this pull request would immediately understand that the core change involves adding new wallet selection configuration options to the Reown integration. While the PR also includes secondary changes like OAuthProvider enum additions and package dependency updates, these are supporting modifications that don't diminish the title's primary focus on the main functionality change.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch firekeeper/reown-flags

📜 Recent 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 4f30b81 and 03e5b67.

📒 Files selected for processing (1)
  • Assets/Thirdweb/Examples/Scripts/PlaygroundManager.cs (4 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/Examples/Scripts/PlaygroundManager.cs (1)

149-154: Ensure OAuthProvider values map cleanly to AuthProvider

Enum.TryParse will silently fall back to Google whenever the enums diverge (e.g., X vs Twitter, Github vs GitHub), so picking those options in the inspector would call the wrong social login. Please confirm the updated dependency actually exposes matching AuthProvider members, or add an explicit mapping/log so we don't hide unexpected fallbacks.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a 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 if OAuthProvider ever gains a value that AuthProvider doesn’t recognize. Using Enum.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.

📥 Commits

Reviewing files that changed from the base of the PR and between 156a566 and 4f30b81.

📒 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 direct ConnectAsync 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.
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.

1 participant