Skip to content

[MNY-233] SDK: Add Last Used badge in Connect UI (thirdweb-dev#8631)#601

Merged
Dargon789 merged 11 commits intoDargon789:mainfrom
thirdweb-dev:main
Feb 1, 2026
Merged

[MNY-233] SDK: Add Last Used badge in Connect UI (thirdweb-dev#8631)#601
Dargon789 merged 11 commits intoDargon789:mainfrom
thirdweb-dev:main

Conversation

@Dargon789
Copy link
Owner

@Dargon789 Dargon789 commented Jan 25, 2026

Summary by Sourcery

Introduce Base Account SDK wallet integration, enhance Connect UI with last-used indicators, and extend x402 and EIP-5792 payment and calls support while improving zkSync gas estimation fallbacks and examples.

New Features:

  • Add Base Account SDK wallet connector using @base-org/account with creation, connection, and type exports.
  • Expose redirect-based profile linking API for in-app wallets to support OAuth linking flows.
  • Highlight last used wallet and social sign-in method in the Connect UI via badges and sorting.

Bug Fixes:

  • Fallback to standard EVM gas and fee estimation when zkSync zks_estimateFee RPC is unavailable.
  • Correct EIP-5792 getCallsStatus handling to use raw provider responses and support additional wallet types.
  • Ensure getCallStatus works across in-app, smart, injected, and Coinbase wallets via new raw status helpers.

Enhancements:

  • Extend x402 to support version 2 header-based payment and response formats while remaining compatible with v1.
  • Refine Connect Wallet UI spacing and header layout and add stories for wide and compact modal variants.
  • Improve link-profile flows by auto-connecting existing sessions after OAuth redirect and lengthening cache invalidation timing.
  • Sort wallets by last used preference and adjust widget theming utilities for more flexible styling.

Build:

  • Add @base-org/account dependency and bump thirdweb, nebula, wagmi-adapter, and demo app versions to reflect new capabilities.

Documentation:

  • Update x402 server and facilitator documentation and playground routes to use new PAYMENT-SIGNATURE headers and v2 semantics.
  • Expand wallet creation docs to cover Base Account SDK usage and options.

Tests:

  • Add tests for zkSync gas fee fallback logic and x402 header handling, and update URL token and input selection tests for new flows.

Chores:

  • Regenerate wallet metadata and icons, including Base Account and additional partner wallets, and clean up consumed changeset files.

MananTank and others added 10 commits January 13, 2026 10:45
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Joaquim Verges <joaquim.verges@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@vercel
Copy link

vercel bot commented Jan 25, 2026

@joaquim-verges is attempting to deploy a commit to the Foundry development Team on Vercel.

A member of the Team first needs to authorize it.

@sourcery-ai
Copy link

sourcery-ai bot commented Jan 25, 2026

Reviewer's Guide

Implements "Last Used" surfacing across the Connect UI and social auth flows, adds Base Account SDK wallet integration, upgrades x402 payment protocol handling to support version 2 with header-based signatures, adds EIP-5792 raw call status support and fallbacks for zkSync gas estimation, and wires corresponding docs, examples, tests, and changelog/version bumps.

Class diagram for Base Account SDK wallet and EIP-5792 extensions

classDiagram
  class Wallet {
    <<interface>>
    +string id
    +Account getAccount()
    +Chain getChain()
    +Promise~Account~ connect(options)
    +Promise~Account~ autoConnect(options)
    +Promise void disconnect()
    +Promise void switchChain(chain)
    +subscribe(event, listener)
  }

  class Account {
    <<interface>>
    +string address
    +Promise sendTransaction(options)
    +Promise~string~ signMessage(message)
    +Promise~string~ signTypedData(typedData)
    +Promise sendCalls(options)
    +Promise~GetCallsStatusResponse~ getCallsStatus(options)
    +Promise~GetCallsStatusRawResponse~ getCallsStatusRaw(options)
    +Promise~WalletCapabilitiesResult~ getCapabilities(options)
  }

  class BaseAccountWalletCreationOptions {
    +AppMetadata appMetadata
    +Chain[] chains
  }

  class BaseAccountSDKWalletConnectionOptions {
    +ThirdwebClient client
    +Chain chain
  }

  class BaseAccountWallet {
    <<Wallet "org.base.account">>
    +string id
    +BaseAccountWalletCreationOptions getConfig()
    +Promise~Account~ connect(options)
    +Promise~Account~ autoConnect(options)
    +Promise void disconnect()
    +Promise void switchChain(chain)
    +Account getAccount()
    +Chain getChain()
  }

  class ProviderInterface {
    <<from @base-org/account>>
    +Promise~unknown~ request(request)
    +on(event, listener)
    +off(event, listener)
    +Promise void disconnect()
  }

  class GetCallsStatusRawResponse {
    +string id
    +string chainId
    +boolean atomic
    +int status
    +Receipt[] receipts
    +string version
  }

  class CoinbaseAccount {
    <<EIP-1193 wallet>>
    +Promise~GetCallsStatusRawResponse~ getCallsStatusRaw(options)
  }

  class InjectedAccount {
    <<EIP-1193 wallet>>
    +Promise~GetCallsStatusRawResponse~ getCallsStatusRaw(options)
  }

  class SmartAccount {
    <<Smart wallet>>
    +Promise~GetCallsStatusRawResponse~ getCallsStatusRaw(options)
  }

  class Minimal7702Account {
    <<EIP-7702 account>>
    +Promise~GetCallsStatusRawResponse~ getCallsStatusRaw(options)
  }

  class EnclaveWalletAccount {
    <<In-app enclave>>
    +Promise~GetCallsStatusRawResponse~ getCallsStatusRaw(options)
  }

  class ToEip1193Provider {
    +EIP1193Provider toProvider(options)
  }

  Wallet <|.. BaseAccountWallet
  Account <.. BaseAccountWallet : uses
  ProviderInterface <.. BaseAccountWallet : providerFactory
  GetCallsStatusRawResponse <.. Account
  Account <|.. CoinbaseAccount
  Account <|.. InjectedAccount
  Account <|.. SmartAccount
  Account <|.. Minimal7702Account
  Account <|.. EnclaveWalletAccount
  ToEip1193Provider --> Account : calls getCallsStatusRaw
Loading

Flow diagram for Last Used wallet and social auth persistence

flowchart TD
  subgraph Storage
    S1[localStorage
      LAST_USED_WALLET_ID]
    S2[localStorage
      LAST_AUTH_PROVIDER]
  end

  subgraph ConnectModalOpen
    O1[WalletSelector] --> O2[getLastUsedWalletId]
    O2 --> S1
    O1 --> O3[sortWallets]
    O3 -->|prioritize installed| O4
    O3 -->|then last used id| O5
    O5 --> WalletList

    WalletList -->|render| W1[WalletEntryButton]
    W1 -->|if wallet.id === lastUsedId| W2[badge = Last used]

    O1 --> C1[Connect a wallet button]
    C1 -->|prop lastUsedBadge
      when lastUsedId is non inApp non ecosystem| C2[Show LastUsedBadge]
  end

  subgraph SocialAuthOptions
    SA1[ConnectWalletSocialOptions]
    SA1 --> SA2[getLastUsedWalletId]
    SA1 --> SA3[getLastUsedSocialAuth]
    SA2 --> S1
    SA3 --> S2
    SA1 --> SA4[_authOptions]
    SA4 -->|if wallet.id == lastUsedId
      and lastUsedSocialAuth set| SA5[Sort auth options
      to put last used first]

    SA5 --> SA6[Render social buttons/InputSelectionUI]
    SA6 -->|if wallet.id and method match last used| SA7[Show LastUsedBadge]
  end

  subgraph OnSuccessfulConnect
    C10[ConnectionManager.connect]
    C10 --> C11[Set LAST_ACTIVE_EOA_ID]
    C10 --> C12[Set LAST_USED_WALLET_ID]
    C11 --> S1
    C12 --> S1

    SocialLoginSuccess --> C13[setLastAuthProvider]
    C13 --> S2
  end
Loading

File-Level Changes

Change Details Files
Add Base Account SDK wallet integration and typings, wired through createWallet and exports.
  • Introduce BASE_ACCOUNT wallet id constant and extend WalletId union and typed option helpers to support Base Account creation/connection/autoconnect types.
  • Implement Base Account SDK web provider and wallet wrappers that adapt @base-org/account ProviderInterface into thirdweb Wallet/Account, including EIP-155, EIP-712 signing, EIP-5792 sendCalls/getCallsStatus/getCapabilities, and chain switching.
  • Wire BASE_ACCOUNT into createWallet, exports, and include @base-org/account 2.5.0 dependency plus generated wallet metadata/icons for org.base.account.
packages/thirdweb/src/wallets/constants.ts
packages/thirdweb/src/wallets/wallet-types.ts
packages/thirdweb/src/wallets/create-wallet.ts
packages/thirdweb/src/exports/wallets.ts
packages/thirdweb/package.json
packages/thirdweb/src/wallets/base-account/base-account-web.ts
packages/thirdweb/src/wallets/base-account/base-account-wallet.ts
packages/thirdweb/src/wallets/__generated__/wallet/org.base.account/index.ts
packages/thirdweb/src/wallets/__generated__/wallet/org.base.account/image.ts
packages/thirdweb/scripts/wallets/extra-wallet-icons/base.svg
Surface and persist "Last used" wallet/auth method across Connect UI and social login, including badges and layout tweaks.
  • Persist LAST_USED_WALLET_ID in ConnectionManager whenever an EOA connects or becomes active, and expose browser helpers to read last used wallet and social auth strategy from localStorage.
  • Update wallet sorting and Connect UI to prioritize last used wallet and display a Last Used badge on the generic connect button, wallet list entries, and social auth methods (email/phone/passkey/SIWE/guest) including inputs; adjust layout paddings to reserve vertical space and avoid overlap.
  • Introduce reusable Badge/LastUsedBadge UI component and ensure all call sites (WalletTypeRowButton, InputSelectionUI, WalletConnectReceiverScreen) handle the new lastUsedBadge prop, plus Storybook stories for connect button variants.
packages/thirdweb/src/wallets/manager/index.ts
packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/storage.ts
packages/thirdweb/src/react/web/utils/sortWallets.ts
packages/thirdweb/src/react/web/ui/ConnectWallet/WalletSelector.tsx
packages/thirdweb/src/react/web/ui/ConnectWallet/WalletTypeRowButton.tsx
packages/thirdweb/src/react/web/ui/ConnectWallet/WalletEntryButton.tsx
packages/thirdweb/src/react/web/wallets/shared/ConnectWalletSocialOptions.tsx
packages/thirdweb/src/react/web/wallets/in-app/InputSelectionUI.tsx
packages/thirdweb/src/react/web/wallets/in-app/InputSelectionUI.test.tsx
packages/thirdweb/src/react/web/ui/ConnectWallet/screens/WalletConnectReceiverScreen.tsx
packages/thirdweb/src/react/web/ui/components/badge.tsx
packages/thirdweb/src/stories/ConnectButton/others.stories.tsx
packages/thirdweb/src/stories/ConnectButton/themes.stories.tsx
Add redirect-based in-app profile linking flow and autoConnect handling for OAuth linking redirects.
  • Extend in-app auth login URL and URL token parsing to support an authFlow flag (connect
link) and ensure query params are cleaned from location after parsing.
  • Add linkProfileWithRedirect helper and InAppWebConnector.linkProfileWithRedirect that kick off OAuth redirect with authFlow=link, and have linkProfile short-circuit to redirect when given social strategies with redirect/window mode.
  • Implement handleLinkingFlow in autoConnectCore to auto-connect with stored credentials (ignoring URL auth token), then call linkAccount with the new social token, update auth provider, manage connection state flags, and invoke onConnect callbacks.
  • Add playground example wiring redirect-based GitHub linking and relax useLinkProfile refetch delay for more reliable profile refresh after linking.
  • Upgrade x402 payment protocol support to v2 with header-based signatures while maintaining v1 compatibility across types, encode/decode, facilitator, verify/settle helpers, and fetchWithPayment.
    • Introduce X402Version type, switch default x402Version to 2, split PaymentRequiredResult into v1 and v2 variants, and add helper functions to resolve correct request/response header names and encode PAYMENT-REQUIRED payloads.
    • Adjust facilitator.accepts to always return v1 body format but accept requested x402Version, add formatting helpers in decodePaymentRequest to return v2 header-based 402 responses by default, preserving client version where known and falling back to v2 for decode errors.
    • Update verifyPayment and settlePayment (and Nexus/portal/playground docs) to read from PAYMENT-SIGNATURE or X-PAYMENT headers, emit version-appropriate response headers (PAYMENT-RESPONSE/X-PAYMENT-RESPONSE) and x402Version fields, and update wrapFetchWithPayment and tests to use header helpers and versioned behaviors.
    • Adjust schemas and tests to allow both versions, prefer header-based payment-required metadata, and ensure retry requests use the version-appropriate request header and exposed response header.
    packages/thirdweb/src/x402/types.ts
    packages/thirdweb/src/x402/headers.ts
    packages/thirdweb/src/x402/encode.ts
    packages/thirdweb/src/x402/common.ts
    packages/thirdweb/src/x402/facilitator.ts
    packages/thirdweb/src/x402/verify-payment.ts
    packages/thirdweb/src/x402/settle-payment.ts
    packages/thirdweb/src/x402/fetchWithPayment.ts
    packages/thirdweb/src/x402/schemas.ts
    packages/thirdweb/src/x402/fetchWithPayment.test.ts
    apps/playground-web/src/app/api/paywall/route.ts
    apps/portal/src/app/x402/page.mdx
    apps/portal/src/app/x402/server/page.mdx
    apps/portal/src/app/x402/facilitator/page.mdx
    packages/nexus/src/verify-payment.ts
    packages/nexus/src/settle-payment.ts
    Enhance EIP-5792 support by exposing raw call status, propagating it through accounts/providers, and adapting the EIP-1193 adapter.
    • Extend Account interface with optional getCallsStatusRaw, implement it for in-app minimal, smart, zkSync, and enclave wallets using new inAppWalletGetCallsStatusRaw helper that reconstructs raw receipts for stored bundles.
    • Add getCallsStatusRaw implementations for Coinbase and injected wallets that call wallet_getCallsStatus and map unsupported errors to explicit messages, and change toProvider EIP-1193 adapter to call getCallsStatusRaw and return raw bundle status on wallet_getCallsStatus RPC requests.
    • Refactor wagmi-demo to use useWaitForCallsStatus hook with multiple calls, switch JSON.stringify to internal stringify helper, and adjust demo types to align with new 5792 responses.
    packages/thirdweb/src/wallets/interfaces/wallet.ts
    packages/thirdweb/src/wallets/in-app/core/eip5792/in-app-wallet-calls.ts
    packages/thirdweb/src/wallets/in-app/core/eip7702/minimal-account.ts
    packages/thirdweb/src/wallets/smart/index.ts
    packages/thirdweb/src/wallets/in-app/core/wallet/enclave-wallet.ts
    packages/thirdweb/src/wallets/coinbase/coinbase-web.ts
    packages/thirdweb/src/wallets/injected/index.ts
    packages/thirdweb/src/adapters/eip1193/to-eip1193.ts
    apps/wagmi-demo/src/App.tsx
    Improve zkSync gas estimation by handling chains that no longer expose zks_estimateFee.
    • Wrap zks_estimateFee usage in a try/catch and, on failure, fall back to standard EVM estimation via estimateGas and getDefaultGasOverrides, doubling gas and fee values similarly to the zkSync path and using a default gasPerPubdata.
    • Add a test that defines a zkSync-compatible chain without zks_ support and asserts the fallback path returns non-zero gas values and the expected default gasPerPubdata.
    packages/thirdweb/src/transaction/actions/zksync/send-eip712-transaction.ts
    packages/thirdweb/src/transaction/actions/zksync/send-eip712-transaction.test.ts
    Docs, examples, and versioning updates to reflect new features and dependencies.
    • Bump thirdweb core, nebula, wagmi-demo, and wagmi-adapter versions and add changelog entries capturing Base Account SDK integration, x402 v2, linking redirect support, zkSync fallback, and Connect UI UX updates including Last Used badge.
    • Add connect button Storybook stories for wide/compact modals and tweak dark theme story naming and theme overrides to better exercise new UI spacing/badge behavior.
    packages/thirdweb/CHANGELOG.md
    packages/thirdweb/package.json
    packages/nebula/CHANGELOG.md
    packages/nebula/package.json
    apps/wagmi-demo/CHANGELOG.md
    apps/wagmi-demo/package.json
    packages/wagmi-adapter/CHANGELOG.md
    packages/wagmi-adapter/package.json
    packages/thirdweb/src/stories/ConnectButton/others.stories.tsx
    packages/thirdweb/src/stories/ConnectButton/themes.stories.tsx

    Tips and commands

    Interacting with Sourcery

    • Trigger a new review: Comment @sourcery-ai review on the pull request.
    • Continue discussions: Reply directly to Sourcery's review comments.
    • Generate a GitHub issue from a review comment: Ask Sourcery to create an
      issue from a review comment by replying to it. You can also reply to a
      review comment with @sourcery-ai issue to create an issue from it.
    • Generate a pull request title: Write @sourcery-ai anywhere in the pull
      request title to generate a title at any time. You can also comment
      @sourcery-ai title on the pull request to (re-)generate the title at any time.
    • Generate a pull request summary: Write @sourcery-ai summary anywhere in
      the pull request body to generate a PR summary at any time exactly where you
      want it. You can also comment @sourcery-ai summary on the pull request to
      (re-)generate the summary at any time.
    • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
      request to (re-)generate the reviewer's guide at any time.
    • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
      pull request to resolve all Sourcery comments. Useful if you've already
      addressed all the comments and don't want to see them anymore.
    • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
      request to dismiss all existing Sourcery reviews. Especially useful if you
      want to start fresh with a new review - don't forget to comment
      @sourcery-ai review to trigger a new review!

    Customizing Your Experience

    Access your dashboard to:

    • Enable or disable review features such as the Sourcery-generated pull request
      summary, the reviewer's guide, and others.
    • Change the review language.
    • Add, remove or edit custom review instructions.
    • Adjust other review settings.

    Getting Help

    @vercel

    This comment was marked as resolved.

    Copy link

    @sourcery-ai sourcery-ai bot left a comment

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Hey - I've found 2 issues, and left some high level feedback:

    • The new "last used" wallet tracking mixes AsyncStorage (manager writes LAST_USED_WALLET_ID) with direct window.localStorage access in the Connect UI helpers; if a custom storage adapter is used, the UI badges/sorting will silently diverge from the actual connection state—consider routing reads through the same AsyncStorage abstraction or clearly constraining this feature to localStorage-backed setups.
    • The Base Account SDK provider is effectively a global singleton with configuration taken only on first use; it may be worth documenting or enforcing this more strongly (e.g. by throwing rather than just warning on conflicting create options) to help consumers avoid subtle misconfigurations when they accidentally create multiple Base Account wallets with different settings.
    Prompt for AI Agents
    Please address the comments from this code review:
    
    ## Overall Comments
    - The new "last used" wallet tracking mixes AsyncStorage (manager writes LAST_USED_WALLET_ID) with direct window.localStorage access in the Connect UI helpers; if a custom storage adapter is used, the UI badges/sorting will silently diverge from the actual connection state—consider routing reads through the same AsyncStorage abstraction or clearly constraining this feature to localStorage-backed setups.
    - The Base Account SDK provider is effectively a global singleton with configuration taken only on first use; it may be worth documenting or enforcing this more strongly (e.g. by throwing rather than just warning on conflicting create options) to help consumers avoid subtle misconfigurations when they accidentally create multiple Base Account wallets with different settings.
    
    ## Individual Comments
    
    ### Comment 1
    <location> `packages/thirdweb/src/x402/common.ts:84-93` </location>
    <code_context>
       args: PaymentArgs,
     ): Promise<GetPaymentRequirementsResult | PaymentRequiredResult> {
    -  const { facilitator, routeConfig = {}, paymentData } = args;
    +  const { facilitator, routeConfig = {}, paymentData, resourceUrl } = args;
       const { errorMessages } = routeConfig;
    
    +  // facilitator.accepts() returns v1 format from API - extract payment requirements
       const paymentRequirementsResult = await facilitator.accepts(args);
    +  const paymentRequirements = paymentRequirementsResult.responseBody.accepts;
    
    -  // Check for payment header, if none, return the payment requirements
    +  // Check for payment header, if none, return the payment requirements in v2 format (default)
       if (!paymentData) {
    -    return paymentRequirementsResult;
    +    return formatPaymentRequiredResponseV2(
    +      paymentRequirements,
    +      "Payment required",
    </code_context>
    
    <issue_to_address>
    **suggestion (bug_risk):** Respect requested x402 version when deciding v1 vs v2 response format
    
    `decodePaymentRequest` now receives `x402Version`, but still always returns a v2-style `PaymentRequiredResult` when `paymentData` is missing and on decode errors. This prevents v1 callers from getting a v1-formatted response. Use `args.x402Version` (with the existing default) to choose `formatPaymentRequiredResponseV1` vs `formatPaymentRequiredResponseV2` in the `!paymentData` and decode-error paths so the response format matches the requested protocol version.
    
    Suggested implementation:
    
    ```typescript
    export async function decodePaymentRequest(
      args: PaymentArgs,
    ): Promise<GetPaymentRequirementsResult | PaymentRequiredResult> {
      const {
        facilitator,
        routeConfig = {},
        paymentData,
        resourceUrl,
        x402Version,
      } = args;
      const { errorMessages } = routeConfig;
    
      // facilitator.accepts() returns v1 format from API - extract payment requirements
      const paymentRequirementsResult = await facilitator.accepts(args);
      const paymentRequirements = paymentRequirementsResult.responseBody.accepts;
    
      // Check for payment header, if none, return the payment requirements in the requested x402 format
      if (!paymentData) {
        const useV1Format = x402Version === "1"; // respects requested x402 version
    
        return useV1Format
          ? formatPaymentRequiredResponseV1(
              paymentRequirements,
              "Payment required",
              resourceUrl,
            )
          : formatPaymentRequiredResponseV2(
              paymentRequirements,
              "Payment required",
              resourceUrl,
            );
      }
    
    ```
    
    1. Update the decode-error path in `decodePaymentRequest` (inside the `catch` around `decodePayment(paymentData)`) to also branch on `x402Version` in the same way as the `!paymentData` path, returning `formatPaymentRequiredResponseV1(...)` for v1 callers and `formatPaymentRequiredResponseV2(...)` otherwise.
    2. If the codebase already defines canonical x402 version constants or uses a different string for v1 (e.g. `"v1"` or `"0.1"`), replace the hard-coded `"1"` check with that existing convention, or use a helper such as `isV1x402Version(x402Version)` if one exists.
    3. If there is an existing default x402 version (e.g. on `PaymentArgs` or a shared config), ensure that `x402Version` is always set before reaching this function, or derive the default here to keep behavior consistent across the codebase.
    </issue_to_address>
    
    ### Comment 2
    <location> `packages/thirdweb/src/wallets/in-app/web/lib/get-url-token.ts:28-31` </location>
    <code_context>
       const walletId = params.get("walletId") as WalletId | undefined;
       const authProvider = params.get("authProvider") as AuthOption | undefined;
       const authCookie = params.get("authCookie") as string | undefined;
    +  const authFlow = params.get("authFlow") as "connect" | "link" | undefined;
    
       if ((authCookie || authResultString) && walletId) {
    </code_context>
    
    <issue_to_address>
    **issue (bug_risk):** Align `authFlow` runtime values with the declared return type of `getUrlToken`
    
    `params.get("authFlow")` can return `null`, but it’s cast to `"connect" | "link" | undefined` and the function type is `authFlow?: "connect" | "link";` (no `null`), while tests now expect `authFlow: null`. This type/runtime mismatch can confuse consumers. Consider normalizing non-matching values to `undefined` before returning (e.g. `const raw = params.get("authFlow"); const authFlow = raw === "connect" || raw === "link" ? raw : undefined;`) and update tests/types accordingly, or explicitly allow `null` in the type if that’s intentional.
    </issue_to_address>

    Sourcery is free for open source - if you like our reviews please consider sharing them ✨
    Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

    @gemini-code-assist
    Copy link

    Summary of Changes

    Hello @Dargon789, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

    This pull request significantly upgrades the SDK's wallet connectivity and payment processing capabilities. It integrates a new wallet connector for the Base Account SDK and refines the user interface of the Connect Wallet component with a 'Last Used' badge. Additionally, the x402 payment protocol has been advanced to version 2, introducing more flexible payment data handling and ensuring better compatibility with various blockchain environments, including improved fallback for zkSync transactions.

    Highlights

    • Base Account SDK Integration: Introduced a new wallet connector for the Base Account SDK, enabling seamless integration with Base smart wallets.
    • Connect UI Enhancements: Added a 'Last Used' badge in the Connect UI to visually highlight the user's most recently used sign-in method, improving user experience.
    • x402 Payment Protocol v2 Support: Upgraded the x402 payment protocol to support version 2, which includes new header-based payment mechanisms and improved handling of payment data.
    • EIP-5792 Support Expansion: Enhanced EIP-5792 support across various wallet types (Coinbase, Injected, Smart Accounts, In-App Wallet) by adding getCallsStatusRaw for more robust batched transaction status retrieval.
    • zkSync Fee Estimation Fallback: Implemented a fallback mechanism for zkSync fee estimation, allowing the system to use standard EVM methods when the zks_estimateFee RPC endpoint is unavailable on newer zkSync chains.
    • Redirect-based Profile Linking: Added support for linking user profiles via redirect-based OAuth flows, streamlining the process of connecting social accounts.
    Using Gemini Code Assist

    The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

    Invoking Gemini

    You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

    Feature Command Description
    Code Review /gemini review Performs a code review for the current pull request in its current state.
    Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
    Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
    Help /gemini help Displays a list of available commands.

    Customization

    To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

    Limitations & Feedback

    Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

    You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

    Footnotes

    1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

    Copy link

    @gemini-code-assist gemini-code-assist bot left a comment

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Code Review

    This pull request introduces several new features and improvements across the thirdweb SDK and related applications. Key changes include the integration of the Base Account SDK, adding support for linking accounts with redirect mode, and enhancing the x402 payment protocol to support a v2 header-based format. UI improvements have been made to various widgets, such as the BuyWidget, TransactionWidget, SwapWidget, and BridgeWidget, including new props to disable token selection/amount editing, more reliable chain lists, token selection UX enhancements, and the addition of a 'Last Used' badge in the Connect UI to highlight recently used wallets and social authentication methods. The update also adds support for the Etherlink Shadownet testnet chain. Internally, there are updates to EIP-5792 handling for getCallsStatus and getCallsStatusRaw across different wallet types, and a fallback mechanism for zkSync gas fee estimation when zks_estimateFee is unavailable. Documentation and example code have been updated to reflect these changes, particularly for the x402 header and Base Account SDK integration.

    @Dargon789 Dargon789 enabled auto-merge (squash) January 25, 2026 02:49
    @vercel
    Copy link

    vercel bot commented Jan 30, 2026

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

    Project Deployment Actions Updated (UTC)
    demo-dapp-otaa Ready Ready Preview, Comment Jan 30, 2026 3:37pm

    auto-merge was automatically disabled January 30, 2026 20:09

    Head branch was pushed to by a user without write access

    @Dargon789 Dargon789 linked an issue Jan 31, 2026 that may be closed by this pull request
    @Dargon789 Dargon789 enabled auto-merge January 31, 2026 07:22
    @vercel

    This comment was marked as resolved.

    @Dargon789 Dargon789 removed a link to an issue Feb 1, 2026
    @Dargon789 Dargon789 linked an issue Feb 1, 2026 that may be closed by this pull request
    @Dargon789 Dargon789 merged commit 6739fbc into Dargon789:main Feb 1, 2026
    9 of 10 checks passed
    @github-project-automation github-project-automation bot moved this from Todo to Done in web3-Defi-Gamefi Feb 1, 2026
    @github-project-automation github-project-automation bot moved this from In Review to Done in Hardhat Feb 1, 2026
    @Dargon789 Dargon789 linked an issue Feb 1, 2026 that may be closed by this pull request
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment