Skip to content

feat: add resolveAccountAddress method to KeyringHandler for dApp connectivity routing#590

Open
Battambang wants to merge 7 commits intomainfrom
feat/account-address-resolution
Open

feat: add resolveAccountAddress method to KeyringHandler for dApp connectivity routing#590
Battambang wants to merge 7 commits intomainfrom
feat/account-address-resolution

Conversation

@Battambang
Copy link
Contributor

@Battambang Battambang commented Mar 12, 2026

Explanation

This PR contributes to supporting the Bitcoin dApp connectivity.
It's adding the resolve account address Keyring method.

It is part from the initial PR #564 feat: enable account address resolution to support dApps connectivity to split the work into 3 smaller PRs:
#589 refactor: move validation structs and add account field
#590 feat: add resolveAccountAddress method to KeyringHandler for dApp connectivity routing
#591 feat: add confirmation dialog before sendTransfer and before signing a PSBT from the keyring handler

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Medium Risk
Adds a new keyring RPC method that influences how incoming signing requests are routed to accounts, and tightens request validation to require an account.address field; mismatches could cause requests to fail or route incorrectly.

Overview
Adds KeyringRpcMethod.ResolveAccountAddress support in KeyringHandler, implementing resolveAccountAddress(scope, request) to validate the scope/request shape, find a matching account by params.account.address, and return a CAIP-style ${scope}:${address} identifier (or null on any validation/match failure).

Updates Bitcoin keyring request validation by centralizing request structs in handlers/validation.ts (now including account: { address } and a BtcWalletRequestStruct union keyed by BtcMethod), refactors KeyringRequestHandler to use these shared validators, and adjusts unit/integration tests accordingly. Also updates the Snap CHANGELOG and manifest shasum.

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

@Battambang Battambang requested a review from a team as a code owner March 12, 2026 23:11
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

@Battambang
Copy link
Contributor Author

@metamaskbot publish-preview

@github-actions
Copy link
Contributor

Preview builds have been published. See these instructions for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask-previews/bitcoin-wallet-snap": "1.10.0-preview-4a5f56f"
}

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant