Skip to content

Conversation

@enesozturk
Copy link
Contributor

@enesozturk enesozturk commented Nov 10, 2025

Description

Similar to this: #5317

Wagmi is getting the chain object with wrong parameters and finding the CAIP id from the network object. Passing the right Wagmi chain object to chain and removing chainId parameter (Viem doesn't have chainId param, see docs).

Type of change

  • Chore (non-breaking change that addresses non-functional tasks, maintenance, or code quality improvements)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Associated Issues

For Linear issues: Closes APKT-xxx
For GH issues: closes #...

Showcase (Optional)

If there is a UI change include the screenshots with before and after state.
If new feature is being introduced, include the link to demo recording.

Checklist

  • Code in this PR is covered by automated tests (Unit tests, E2E tests)
  • My changes generate no new warnings
  • I have reviewed my own code
  • I have filled out all required sections
  • I have tested my changes on the preview link
  • Approver of this PR confirms that the changes are tested on the preview link

Note

Update sendTransaction to pass the resolved Wagmi chain object rather than chainId.

  • Wagmi Adapter (packages/adapters/wagmi/src/client.ts):
    • sendTransaction: resolve current chain via this.wagmiChains and pass as chain, removing chainId from tx params.

Written by Cursor Bugbot for commit 5fcde32. This will update automatically on new commits. Configure here.

@linear
Copy link

linear bot commented Nov 10, 2025

@changeset-bot
Copy link

changeset-bot bot commented Nov 10, 2025

⚠️ No Changeset found

Latest commit: 5fcde32

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

@vercel
Copy link

vercel bot commented Nov 10, 2025

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

Project Deployment Preview Comments Updated (UTC)
appkit-basic-html Ready Ready Preview Comment Nov 10, 2025 5:37pm
appkit-demo Ready Ready Preview Comment Nov 10, 2025 5:37pm
appkit-gallery Ready Ready Preview Comment Nov 10, 2025 5:37pm
appkit-headless-sample-app Ready Ready Preview Comment Nov 10, 2025 5:37pm
appkit-laboratory Ready Ready Preview Comment Nov 10, 2025 5:37pm
10 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
appkit-basic-example Ignored Ignored Nov 10, 2025 5:37pm
appkit-basic-sign-client-example Ignored Ignored Nov 10, 2025 5:37pm
appkit-basic-up-example Ignored Ignored Nov 10, 2025 5:37pm
appkit-ethers5-bera Ignored Ignored Nov 10, 2025 5:37pm
appkit-nansen-demo Ignored Ignored Nov 10, 2025 5:37pm
appkit-vue-solana Ignored Ignored Nov 10, 2025 5:37pm
appkit-wagmi-cdn-example Ignored Ignored Nov 10, 2025 5:37pm
ethereum-provider-wagmi-example Ignored Ignored Nov 10, 2025 5:37pm
next-wagmi-solana-bitcoin-example Ignored Ignored Nov 10, 2025 5:37pm
vue-wagmi-example Ignored Ignored Nov 10, 2025 5:37pm

@tomiir tomiir enabled auto-merge November 10, 2025 17:35
params: AdapterBlueprint.SendTransactionParams
): Promise<AdapterBlueprint.SendTransactionResult> {
const { chainId, address } = getAccount(this.wagmiConfig)
const wagmiChain = this.wagmiChains?.find(chain => chain.id === chainId)
Copy link

Choose a reason for hiding this comment

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

Bug: Chain Mismatch Causes Transaction Instability

The wagmiChain variable can be undefined if the current chainId doesn't match any chain in this.wagmiChains. This occurs when find returns no match, potentially causing transaction failures or unexpected behavior when passed to prepareTransactionRequest and wagmiSendTransaction. The previous implementation passed chainId directly, which was more reliable.

Fix in Cursor Fix in Web

@github-actions
Copy link
Contributor

Visual Regression Test Results ✅ Passed

✨ No visual changes detected

Chromatic Build: https://www.chromatic.com/build?appId=6493191bf4b10fed8ca7353f&number=367
Storybook Preview: https://6493191bf4b10fed8ca7353f-tysxpngswn.chromatic.com/

@github-actions
Copy link
Contributor

📦 Bundle Size Check

All bundles are within size limits

📊 View detailed bundle sizes

> @reown/appkit-monorepo@1.7.1 size /home/runner/work/appkit/appkit


> size-limit

@reown/appkit - Main Entry
Size limit:   80 kB
Size:         73.89 kB with all dependencies, minified and gzipped
Loading time: 1.5 s    on slow 3G
Running time: 442 ms   on Snapdragon 410
Total time:   1.9 s
@reown/appkit/react
Size limit:   230 kB
Size:         227.32 kB with all dependencies, minified and gzipped
Loading time: 4.5 s     on slow 3G
Running time: 1.3 s     on Snapdragon 410
Total time:   5.7 s
@reown/appkit/vue
Size limit:   80 kB
Size:         73.89 kB with all dependencies, minified and gzipped
Loading time: 1.5 s    on slow 3G
Running time: 422 ms   on Snapdragon 410
Total time:   1.9 s
@reown/appkit-scaffold-ui
Size limit:   220 kB
Size:         208.03 kB with all dependencies, minified and gzipped
Loading time: 4.1 s     on slow 3G
Running time: 613 ms    on Snapdragon 410
Total time:   4.7 s
@reown/appkit-ui
Size limit:   500 kB
Size:         13.15 kB with all dependencies, minified and gzipped
Loading time: 257 ms   on slow 3G
Running time: 80 ms    on Snapdragon 410
Total time:   337 ms

@github-actions
Copy link
Contributor

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 79.65% 38085 / 47810
🔵 Statements 79.65% 38085 / 47810
🔵 Functions 77.76% 4113 / 5289
🔵 Branches 86.47% 9242 / 10687
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/adapters/wagmi/src/client.ts 76.04% 65% 81.39% 76.04% 123-124, 129-130, 141-143, 145, 207-208, 248-251, 361-362, 376, 396-397, 474-475, 487-488, 524-525, 542-557, 571-588, 608-609, 622-631, 642-643, 647-648, 653-685, 702-711, 715-721, 724-735, 744-745, 756-757, 778-780, 794-795, 808-809, 824-825, 868-869, 893-894, 902-903, 908-909, 916-917, 925-926, 931-932, 941-942, 950-951, 956-957, 963-985, 988-1001
Generated in workflow #16286 for commit 5fcde32 by the Vitest Coverage Report Action

@tomiir tomiir disabled auto-merge November 10, 2025 17:51
@tomiir tomiir merged commit 0115324 into main Nov 10, 2025
45 checks passed
@tomiir tomiir deleted the enes/apkt-4201-wagmiswaps-are-not-working-throws-transaction-error-message branch November 10, 2025 17:51
@github-actions github-actions bot locked and limited conversation to collaborators Nov 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants