Skip to content

fix: pass required account param in Bitcoin getAccountAddresses - #5630

Merged
svenvoskamp merged 1 commit into
chore/khizr-fixesfrom
chore/khizr-fixes-REOWN-4541
Apr 13, 2026
Merged

fix: pass required account param in Bitcoin getAccountAddresses#5630
svenvoskamp merged 1 commit into
chore/khizr-fixesfrom
chore/khizr-fixes-REOWN-4541

Conversation

@Khizr97

@Khizr97 Khizr97 commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes BitcoinWalletConnectConnector.getAccountAddresses() sending params: undefined instead of the required account field per the BIP122 RPC spec (REOWN-4541).

Technical Report

Problem

The BIP122 getAccountAddresses RPC spec requires an account field in params, but the connector was sending params: undefined, causing wallets that strictly validate the spec to reject the request.

Root Cause Analysis

In BitcoinWalletConnectConnector.ts, the getAccountAddresses method hardcoded params: undefined. Other methods in the same file (sendTransfer, signPsbt) correctly call this.getAccount(true) and pass the result — this method was simply missed.

The RequestMethods type also mapped getAccountAddresses to Request<undefined, string[]>, reinforcing the incorrect implementation.

Approach & Reasoning

Added WCGetAccountAddressesParams type with required account and optional intentions fields, matching the BIP122 spec.

Fixed the method to call this.getAccount(true) before the request, matching the sendTransfer/signPsbt pattern. this.getAccount(true) resolves the connected account address from the WC session namespaces and throws if not found.

Kept response type as string[] — initially changed to WCGetAccountAddressesResponse (object array), but sanity check revealed the WC provider actually returns plain string arrays. The existing test mocked ['mock_address'] and the mapping code treated elements as strings. Changing the response type would have caused runtime errors (addr.address on a string is undefined).

Updated the test to mock ChainController.getAccountData (needed for getAccount()) and expect params: { account: 'address' } instead of params: undefined.

Verification

  • 22/22 WalletConnectProvider tests pass
  • Type check clean on bitcoin adapter
  • Response type kept as string[] to match actual wallet behavior

Test plan

  • Connect a Bitcoin wallet via WalletConnect
  • Call getAccountAddresses() — verify request includes params: { account: "..." }
  • Verify wallet returns addresses without rejecting

🤖 Generated with Claude Code

@vercel

vercel Bot commented Apr 9, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
appkit-demo Ready Ready Preview, Comment Apr 9, 2026 1:02pm
appkit-gallery Ready Ready Preview, Comment Apr 9, 2026 1:02pm
appkit-headless-sample-app Ready Ready Preview, Comment Apr 9, 2026 1:02pm
appkit-laboratory Ready Ready Preview, Comment Apr 9, 2026 1:02pm
9 Skipped Deployments
Project Deployment Actions Updated (UTC)
appkit-basic-example Ignored Ignored Apr 9, 2026 1:02pm
appkit-basic-sign-client-example Ignored Ignored Apr 9, 2026 1:02pm
appkit-basic-up-example Ignored Ignored Apr 9, 2026 1:02pm
appkit-ethers5-bera Ignored Ignored Apr 9, 2026 1:02pm
appkit-nansen-demo Ignored Ignored Apr 9, 2026 1:02pm
appkit-wagmi-cdn-example Ignored Ignored Apr 9, 2026 1:02pm
ethereum-provider-wagmi-example Ignored Ignored Apr 9, 2026 1:02pm
next-wagmi-solana-bitcoin-example Ignored Ignored Apr 9, 2026 1:02pm
vue-wagmi-example Ignored Ignored Apr 9, 2026 1:02pm

Request Review

@linear

linear Bot commented Apr 9, 2026

Copy link
Copy Markdown

@changeset-bot

changeset-bot Bot commented Apr 9, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 9ecb340

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

@github-actions

github-actions Bot commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CTA ✍️ ✅
Posted by the CLA Assistant Lite bot.

The BIP122 getAccountAddresses RPC spec requires an `account` field
in params, but the connector was sending `params: undefined`. Now
resolves the connected account via getAccount() and passes it, matching
the pattern used by sendTransfer and signPsbt. Also fixes the
RequestMethods type mapping to use the correct params/response types.

Closes REOWN-4541

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Khizr97

Khizr97 commented Apr 13, 2026

Copy link
Copy Markdown
Contributor Author

I have read the CTA Document and I hereby sign the CTA

@svenvoskamp
svenvoskamp merged commit a77f5aa into chore/khizr-fixes Apr 13, 2026
17 of 18 checks passed
@svenvoskamp
svenvoskamp deleted the chore/khizr-fixes-REOWN-4541 branch April 13, 2026 16:27
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 13, 2026
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.

2 participants