feat(compliance-controller): add configured Compliance API support#8820
Open
geositta wants to merge 14 commits into
Open
feat(compliance-controller): add configured Compliance API support#8820geositta wants to merge 14 commits into
geositta wants to merge 14 commits into
Conversation
e15e182 to
dc5b149
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1c7c513. Configure here.
abretonc7s
requested changes
May 15, 2026
Contributor
abretonc7s
left a comment
There was a problem hiding this comment.
Is there a matching mobile PR? It should be split the compliance controller only on this PR. And separately sync mobile
abretonc7s
approved these changes
May 15, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Explanation
This updates
@metamask/compliance-controllerso clients can pass an explicit Compliance API URL intoComplianceService, allowing Extension and Mobile to source the endpoint from build configuration instead of hardcoding environment switches in application code. If noapiUrlis provided, the service keepsenvas a fallback and defaults to production.This also moves the blocked-wallet lookup behavior into the shared controller package. Cached EVM wallet compliance statuses now exact-match first, then fall back to case-insensitive matching for valid
0xEVM addresses only; non-EVM addresses remain exact-match only. The package now also exportsselectAreAnyWalletsBlockedso clients can share the same selector behavior.References
Related to Extension and Mobile compliance controller integration work. Client adoption can follow after this package change is released and consumed.
Checklist
Note
Medium Risk
Changes request routing for the compliance API by allowing a configurable base URL and tweaks cached compliance lookups to fall back on case-insensitive matching for EVM addresses, which could affect network calls and blocked-status results if misconfigured.
Overview
Adds
ComplianceServiceOptions.apiUrlto allow callers to provide an explicit Compliance API base URL (defaultingenvto production when unset), including validation (no query/fragment) and correct URL joining that preserves path components.Fixes cached blocked-wallet lookups to be casing-tolerant for valid
0xEVM addresses via sharedgetWalletComplianceStatus, and introduces/exportselectAreAnyWalletsBlockedalongside the updatedselectIsWalletBlocked.Updates README/changelog and expands unit coverage for the new URL behavior and EVM-case-insensitive cache fallback in both controller actions and selectors.
Reviewed by Cursor Bugbot for commit ce4d3bf. Bugbot is set up for automated code reviews on this repo. Configure here.