fix: pass required account param in Bitcoin getAccountAddresses - #5630
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
9 Skipped Deployments
|
|
Contributor
|
All contributors have signed the CTA ✍️ ✅ |
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
force-pushed
the
chore/khizr-fixes-REOWN-4541
branch
from
April 9, 2026 12:58
613cbe1 to
9ecb340
Compare
svenvoskamp
approved these changes
Apr 13, 2026
Contributor
Author
|
I have read the CTA Document and I hereby sign the CTA |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Test plan
🤖 Generated with Claude Code