Skip to content

Conversation

@joaquim-verges
Copy link
Member

@joaquim-verges joaquim-verges commented Sep 15, 2025


PR-Codex overview

This PR simplifies the wallet connection logic by removing conditional checks for wallet installations and directly attempting to connect. It also introduces a new page for the xyz.abs wallet with detailed metadata and connection instructions.

Detailed summary

  • Removed conditional checks for wallet installation in page.mdx and page.tsx.
  • Simplified wallet connection logic to always attempt connection directly.
  • Added a new page for xyz.abs wallet with metadata generation and connection instructions.
  • Introduced tabs for TypeScript and React connection examples in the new page.

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

Summary by CodeRabbit

  • New Features

    • Added a new documentation page for the “xyz.abs” external wallet with setup, connection examples (TypeScript and React), component usage, and reference links.
  • Documentation

    • Simplified wallet connection instructions across external wallet docs to use a single connect flow.
    • Updated “Connecting Wallets” guide to remove conditional provider checks and modal-specific steps, clarifying behavior when the wallet is or isn’t installed.

@vercel
Copy link

vercel bot commented Sep 15, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
docs-v2 Ready Ready Preview Comment Sep 15, 2025 10:43pm
4 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
nebula Skipped Skipped Sep 15, 2025 10:43pm
thirdweb_playground Skipped Skipped Sep 15, 2025 10:43pm
thirdweb-www Skipped Skipped Sep 15, 2025 10:43pm
wallet-ui Skipped Skipped Sep 15, 2025 10:43pm

@vercel vercel bot temporarily deployed to Preview – wallet-ui September 15, 2025 22:31 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground September 15, 2025 22:31 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb-www September 15, 2025 22:31 Inactive
@vercel vercel bot temporarily deployed to Preview – nebula September 15, 2025 22:31 Inactive
@changeset-bot
Copy link

changeset-bot bot commented Sep 15, 2025

⚠️ No Changeset found

Latest commit: 9ffca29

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 15, 2025

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The PR body includes a useful PR-Codex overview that summarizes the changes, but the repository description template remains unfilled (the commented template is present) and required sections like "Notes for the reviewer", an issue tag, and explicit "How to test" steps are missing or incomplete, so the description does not fully meet the repo's template requirements. Please populate the repository template: add the issue tag if applicable, fill "Notes for the reviewer" with any important context (e.g., Graphite merge-queue guidance), and provide concrete "How to test" instructions such as commands to run, unit tests or playground steps, and any manual verification steps for the new xyz.abs page and the simplified connect behavior.
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 (1 passed)
Check name Status Explanation
Title Check ✅ Passed The title "[SDK] Simplify wallet connection code and add Abstract wallet support" is concise, uses the repository's scope convention, and accurately reflects the two main changes in the changeset (simplifying connection logic and adding Abstract/xyz.abs wallet support), so a reviewer scanning history will understand the primary intent.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch _SDK_Simplify_wallet_connection_code_and_add_Abstract_wallet_support

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • TEAM-0000: Entity not found: Issue - Could not find referenced Issue.

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

@github-actions github-actions bot added the Portal Involves changes to the Portal (docs) codebase. label Sep 15, 2025
@joaquim-verges joaquim-verges marked this pull request as ready for review September 15, 2025 22:31
@joaquim-verges joaquim-verges requested review from a team as code owners September 15, 2025 22:31
Copy link
Member Author

joaquim-verges commented Sep 15, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge-queue - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@codecov
Copy link

codecov bot commented Sep 15, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.51%. Comparing base (210f631) to head (9ffca29).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8061   +/-   ##
=======================================
  Coverage   56.51%   56.51%           
=======================================
  Files         904      904           
  Lines       58865    58865           
  Branches     4170     4170           
=======================================
  Hits        33269    33269           
  Misses      25491    25491           
  Partials      105      105           
Flag Coverage Δ
packages 56.51% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Contributor

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 63.96 KB (0%) 1.3 s (0%) 426 ms (+135.01% 🔺) 1.8 s
thirdweb (cjs) 361.44 KB (0%) 7.3 s (0%) 1.7 s (+9.26% 🔺) 8.9 s
thirdweb (minimal + tree-shaking) 5.73 KB (0%) 115 ms (0%) 145 ms (+1562.07% 🔺) 260 ms
thirdweb/chains (tree-shaking) 526 B (0%) 11 ms (0%) 78 ms (+1532.49% 🔺) 88 ms
thirdweb/react (minimal + tree-shaking) 19.15 KB (0%) 383 ms (0%) 91 ms (+805.64% 🔺) 473 ms

Copy link
Contributor

@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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/portal/src/app/wallets/external-wallets/[walletId]/page.tsx (1)

23-27: Fix Next.js params typing and return concrete objects from generateStaticParams.

params should not be a Promise, and generateStaticParams must return an array of objects (not Promises). The current types risk build-time failures.

-type PageProps = {
-  params: Promise<{
-    walletId: WalletId;
-  }>;
-};
+type PageProps = {
+  params: {
+    walletId: WalletId;
+  };
+};

-export async function generateStaticParams(): Promise<PageProps["params"][]> {
+export async function generateStaticParams(): Promise<PageProps["params"][]> {
   const walletList = await getAllWalletsList();
 
-  return walletList.map((w) => {
-    return Promise.resolve({
-      walletId: w.id,
-    });
-  });
+  return walletList.map((w) => ({
+    walletId: w.id,
+  }));
 }

Also applies to: 173-181

🧹 Nitpick comments (9)
apps/portal/src/app/wallets/external-wallets/[walletId]/page.tsx (2)

183-193: Clean unused injectedProvider imports in generated snippets and align comments with the unified connect flow.

These snippets import injectedProvider but never use it after the simplification. Also tweak comments to reflect the unconditional connect (extension → injected, otherwise WalletConnect).

 function injectedSupportedTS(id: string) {
   return `\
 import { createThirdwebClient } from "thirdweb";
-import { createWallet, injectedProvider } from "thirdweb/wallets";
+import { createWallet } from "thirdweb/wallets";
 ...
 `;
 }

 function injectedAndWCSupportedCodeTS(id: string) {
   return `\
 import { createThirdwebClient } from "thirdweb";
-import { createWallet, injectedProvider } from "thirdweb/wallets";
+import { createWallet } from "thirdweb/wallets";
 ...
-// if user has wallet installed, connects to it, otherwise opens a WalletConnect modal
+// Connect. If the extension isn't installed, a WalletConnect flow opens.
 await wallet.connect({ client });
 `;
 }

 function injectedAndWCSupportedCodeReact(id: string) {
   return `\
 import { createThirdwebClient } from "thirdweb";
 import { useConnect } from "thirdweb/react";
-import { createWallet, injectedProvider } from "thirdweb/wallets";
+import { createWallet } from "thirdweb/wallets";
 ...
 function injectedSupportedCodeReact(id: string) {
   return `\
 import { createThirdwebClient } from "thirdweb";
 import { useConnect } from "thirdweb/react";
-import { createWallet, injectedProvider } from "thirdweb/wallets";
+import { createWallet } from "thirdweb/wallets";
 ...
-        // if the wallet extension is installed, connect to it, otherwise opens a WalletConnect modal
+        // Connect. If the extension isn't installed, a WalletConnect flow opens.
         connect(async () => {
           const wallet = createWallet("${id}");
           await wallet.connect({ client });
           return wallet;
         });

Also applies to: 207-218, 220-246, 276-302


137-149: Use TSX highlighting for React examples.

The “React (Custom UI)” tab shows React code; switch to tsx for accurate highlighting.

-            lang="ts"
+            lang="tsx"
apps/portal/src/app/wallets/external-wallets/xyz.abs/page.tsx (7)

1-1: Drop unnecessary ESLint disable.

You’re using next/image; the no-img-element rule is not applicable here.

-/* eslint-disable @next/next/no-img-element */

18-29: Add explicit return types for exported functions.

Matches repo TS guidelines and improves DX.

+import type { Metadata } from "next";
 ...
-export async function generateMetadata() {
+export async function generateMetadata(): Promise<Metadata> {
   const walletMetadata = await getWalletInfo(walletId);
   return createMetadata({
     description: `Connect ${walletMetadata.name} with thirdweb TypeScript SDK`,
     image: { icon: "wallets", title: walletMetadata.name },
     title: walletMetadata.name,
   });
 }
 
-export default async function Page() {
+export default async function Page(): Promise<JSX.Element> {
   const [walletMetadata, walletImage] = await Promise.all([
     getWalletInfo(walletId),
     getWalletInfo(walletId, true),
   ]);

Also applies to: 31-36


79-86: Fix duplicate/incorrect heading anchor.

“Installation” uses anchorId="connect-wallet", colliding with the actual Connect section.

-      <Heading anchorId="connect-wallet" level={2}>
+      <Heading anchorId="installation" level={2}>
         Installation
       </Heading>

Also applies to: 88-90


101-103: Use TSX highlighting for React example.

-          <CodeBlock code={injectedSupportedCodeReact()} lang="ts" />
+          <CodeBlock code={injectedSupportedCodeReact()} lang="tsx" />

148-175: Update outdated comment; connect flow is unconditional now.

Comment mentions “if the wallet extension is installed,” but the code calls connect unconditionally.

-        // if the wallet extension is installed, connect to it
+        // Connect. The appropriate provider/modal will be used automatically.

177-200: Import ConnectEmbed in the component snippet.

The snippet uses ConnectEmbed without importing it.

-import { ConnectButton } from "thirdweb/react";
+import { ConnectButton, ConnectEmbed } from "thirdweb/react";

134-146: Avoid helper name shadowing and make intent clearer.

Local createWallet() helper returns abstractWallet() string and can be confused with createWallet from the SDK (also imported inside snippets). Rename and update references.

-const wallet = ${createWallet()};
+const wallet = ${absWalletSnippet()};
...
-const wallet = ${createWallet()};
+const wallet = ${absWalletSnippet()};
...
-  ${createWallet()},
+  ${absWalletSnippet()},
...
-function createWallet() {
+function absWalletSnippet() {
   return `abstractWallet()`;
 }

Also applies to: 148-175, 177-200, 202-205

📜 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 210f631 and 9ffca29.

📒 Files selected for processing (3)
  • apps/portal/src/app/typescript/v5/connecting-wallets/page.mdx (1 hunks)
  • apps/portal/src/app/wallets/external-wallets/[walletId]/page.tsx (6 hunks)
  • apps/portal/src/app/wallets/external-wallets/xyz.abs/page.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx}: Write idiomatic TypeScript with explicit function declarations and return types
Limit each file to one stateless, single-responsibility function for clarity
Re-use shared types from @/types or local types.ts barrels
Prefer type aliases over interface except for nominal shapes
Avoid any and unknown unless unavoidable; narrow generics when possible
Choose composition over inheritance; leverage utility types (Partial, Pick, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose

**/*.{ts,tsx}: Use explicit function declarations and explicit return types in TypeScript
Limit each file to one stateless, single‑responsibility function
Re‑use shared types from @/types where applicable
Prefer type aliases over interface except for nominal shapes
Avoid any and unknown unless unavoidable; narrow generics when possible
Prefer composition over inheritance; use utility types (Partial, Pick, etc.)
Lazy‑import optional features and avoid top‑level side‑effects to reduce bundle size

Files:

  • apps/portal/src/app/wallets/external-wallets/[walletId]/page.tsx
  • apps/portal/src/app/wallets/external-wallets/xyz.abs/page.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Load heavy dependencies inside async paths to keep initial bundle lean (lazy loading)

Files:

  • apps/portal/src/app/wallets/external-wallets/[walletId]/page.tsx
  • apps/portal/src/app/wallets/external-wallets/xyz.abs/page.tsx
🧠 Learnings (2)
📚 Learning: 2025-07-18T19:20:32.530Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : Interactive UI that relies on hooks (`useState`, `useEffect`, React Query, wallet hooks).

Applied to files:

  • apps/portal/src/app/wallets/external-wallets/[walletId]/page.tsx
  • apps/portal/src/app/wallets/external-wallets/xyz.abs/page.tsx
📚 Learning: 2025-07-18T19:19:55.613Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to packages/thirdweb/src/wallets/** : Support for in-app wallets (social/email login)

Applied to files:

  • apps/portal/src/app/wallets/external-wallets/[walletId]/page.tsx
🧬 Code graph analysis (1)
apps/portal/src/app/wallets/external-wallets/xyz.abs/page.tsx (1)
apps/portal/src/app/wallets/external-wallets/[walletId]/page.tsx (2)
  • generateMetadata (29-41)
  • Page (43-171)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Size
  • GitHub Check: Lint Packages
  • GitHub Check: E2E Tests (pnpm, webpack)
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (2)
apps/portal/src/app/typescript/v5/connecting-wallets/page.mdx (1)

44-46: Remove unused import and clarify WalletConnect fallback

Drop injectedProvider from the import — it's unused. .connect({ client }) prefers an injected provider if present; if none is available and you provide a WalletConnect client/options it will open a WalletConnect session/modal. Connect UI enables WalletConnect-by-default; AutoConnect does not auto-reconnect WalletConnect sessions.

-import { createWallet, injectedProvider } from "thirdweb/wallets";
+import { createWallet } from "thirdweb/wallets";
apps/portal/src/app/wallets/external-wallets/xyz.abs/page.tsx (1)

123-130: Verify referenced docs route exists or update the link.

No static page found at /references/typescript/v5/AbsWalletCreationOptions; repo uses dynamic handler apps/portal/src/app/references/typescript/[version]/[[...slug]]/page.tsx — confirm "AbsWalletCreationOptions" is present in the reference data/link map (or update the DocLink).
Location: apps/portal/src/app/wallets/external-wallets/xyz.abs/page.tsx:127

@joaquim-verges joaquim-verges merged commit 6495b94 into main Sep 15, 2025
27 checks passed
@joaquim-verges joaquim-verges deleted the _SDK_Simplify_wallet_connection_code_and_add_Abstract_wallet_support branch September 15, 2025 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Portal Involves changes to the Portal (docs) codebase.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants