Skip to content

Conversation

@joaquim-verges
Copy link
Member

@joaquim-verges joaquim-verges commented Nov 7, 2025


PR-Codex overview

This PR focuses on enhancing the thirdweb package by introducing a new React hook and improving transaction handling with respect to the from address.

Detailed summary

  • Added the useInvalidateBalances React hook to invalidate wallet balances for a specific chainId.
  • Modified transaction serialization in server-wallet.ts to respect the from address during simulation.
  • Exported the new useInvalidateBalances hook in both react.ts and react.native.ts.

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

Summary by CodeRabbit

  • New Features
    • Exposed useInvalidateBalances React hook for manually refreshing wallet balance caches with optional chain filtering
    • Server wallet transaction simulation now respects the specified sender address

@vercel
Copy link

vercel bot commented Nov 7, 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 Nov 7, 2025 0:31am
nebula Ready Ready Preview Comment Nov 7, 2025 0:31am
thirdweb_playground Ready Ready Preview Comment Nov 7, 2025 0:31am
thirdweb-www Ready Ready Preview Comment Nov 7, 2025 0:31am
wallet-ui Ready Ready Preview Comment Nov 7, 2025 0:31am

@changeset-bot
Copy link

changeset-bot bot commented Nov 7, 2025

🦋 Changeset detected

Latest commit: dbc8b5b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
thirdweb Patch
@thirdweb-dev/nebula Patch
@thirdweb-dev/wagmi-adapter Patch
wagmi-inapp Patch

Not sure what this means? Click here to learn what changesets are.

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

@github-actions github-actions bot added packages SDK Involves changes to the thirdweb SDK labels Nov 7, 2025
Copy link
Member Author


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.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 7, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Added a new React hook useInvalidateBalances for cache invalidation and exposed it in React and React Native exports. Updated the Engine server wallet to pass the from address during transaction simulation. Added corresponding changeset files for patch releases.

Changes

Cohort / File(s) Change Summary
Changeset Files
.changeset/clever-horses-turn.md, .changeset/curvy-pillows-return.md
Added patch release notes indicating server wallet from-address fix and useInvalidateBalances hook exposure
React Hook Implementation
packages/thirdweb/src/react/core/hooks/others/useInvalidateBalances.ts
New hook providing function to invalidate wallet balance cache; accepts optional chainId parameter to target specific chain or all balances
React Exports
packages/thirdweb/src/exports/react.ts, packages/thirdweb/src/exports/react.native.ts
Exported new useInvalidateBalances hook in React and React Native barrel files
Engine Server Wallet
packages/thirdweb/src/engine/server-wallet.ts
Modified transaction simulation to pass from address field to toSerializableTransaction call

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • New hook implementation is straightforward, utilizing standard React Query patterns
  • Export additions are minimal configuration changes
  • Server wallet modification only adds a single parameter to an existing function call
✨ 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 _Engine_Add_from_address_to_serializable_transaction

📜 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 881c7a9 and dbc8b5b.

📒 Files selected for processing (6)
  • .changeset/clever-horses-turn.md (1 hunks)
  • .changeset/curvy-pillows-return.md (1 hunks)
  • packages/thirdweb/src/engine/server-wallet.ts (1 hunks)
  • packages/thirdweb/src/exports/react.native.ts (1 hunks)
  • packages/thirdweb/src/exports/react.ts (1 hunks)
  • packages/thirdweb/src/react/core/hooks/others/useInvalidateBalances.ts (1 hunks)

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

@joaquim-verges joaquim-verges force-pushed the _Engine_Add_from_address_to_serializable_transaction branch from 4f21d68 to dbc8b5b Compare November 7, 2025 00:18
@joaquim-verges joaquim-verges marked this pull request as ready for review November 7, 2025 00:20
@joaquim-verges joaquim-verges requested review from a team as code owners November 7, 2025 00:20
@joaquim-verges joaquim-verges changed the title [Engine] Add from address to serializable transaction [SDK] Expose useInvalidateBalances() Nov 7, 2025
@joaquim-verges joaquim-verges merged commit 7f08161 into main Nov 7, 2025
17 of 22 checks passed
@joaquim-verges joaquim-verges deleted the _Engine_Add_from_address_to_serializable_transaction branch November 7, 2025 00:21
@joaquim-verges joaquim-verges mentioned this pull request Nov 7, 2025
@codecov
Copy link

codecov bot commented Nov 7, 2025

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 54.63%. Comparing base (881c7a9) to head (dbc8b5b).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
packages/thirdweb/src/engine/server-wallet.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8373      +/-   ##
==========================================
- Coverage   54.63%   54.63%   -0.01%     
==========================================
  Files         919      919              
  Lines       60693    60694       +1     
  Branches     4110     4114       +4     
==========================================
  Hits        33162    33162              
- Misses      27429    27430       +1     
  Partials      102      102              
Flag Coverage Δ
packages 54.63% <0.00%> (-0.01%) ⬇️
Files with missing lines Coverage Δ
packages/thirdweb/src/engine/server-wallet.ts 3.37% <0.00%> (-0.02%) ⬇️
🚀 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

github-actions bot commented Nov 7, 2025

size-limit report 📦

Path Size
@thirdweb-dev/nexus (esm) 104.88 KB (0%)
@thirdweb-dev/nexus (cjs) 316.6 KB (0%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

packages SDK Involves changes to the thirdweb SDK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants