Repository navigation
feat(kyc-controller): per-vendor KYC sessions - #11399
Open
georgeweiler wants to merge 7 commits into
Open
georgeweiler wants to merge 7 commits into
georgeweiler wants to merge 7 commits into
Conversation
georgeweiler
temporarily deployed
to
default-branch
November 9, 2026 20:42 — with
GitHub Actions
Inactive
georgeweiler
added a commit
to MetaMask/metamask-mobile
that referenced
this pull request
Nov 9, 2026
…gation MetaMask/core#11399 removes KycService:createMoonpaySession, so the KYC controller messenger must no longer delegate it. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This was referenced Nov 9, 2026
georgeweiler
added a commit
that referenced
this pull request
Nov 9, 2026
- Link changelog entries to this PR (#11399) - startSession: terms accepted before a session exists apply to the country they were accepted for. If the session is created for another country, the unsubmitted acceptance is dropped so the user accepts that country's documents, and the entry records the session's country - Writes no longer create a vendor entry that clearState/reset removed; only startSession and acceptVendorDisclaimers start an entry, so an in-flight status fetch or consent write cannot bring a wiped session back Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Replace the single-session KycController state with `sessions`, keyed by
vendor, so a second vendor (e.g. Kalshi) can hold its own session next to
Iron. Every session method takes `{ vendor }`; there is no active vendor.
- Add getSessionDecision (none/new/pending/approved/rejected/retry), moved
from RampsController's resolveVbaKycStatus
- Add acceptVendorDisclaimers so vendor terms accepted before a session
exists are stored on the controller, then submitted by
recordVendorDisclaimers({ vendor })
- Drop the stored email/vendor/geoCountry and their 'different X' guards;
email is only required when creating a session
- One SumSub flow on screen at a time; per-vendor polling loops
- Make vendor required on KycService.fetchVendorDisclaimers and
createUkycSession
- Remove dead KycPhase / KycProduct types
- RampsController passes vendor 'iron' and reads getSessionDecision
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ions Also require a session id in the controller's session lookup, stop recordVendorDisclaimers recreating an entry cleared mid-request, and update ARCHITECTURE.md's state and selectors sections. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sessions are created with createUkycSession, which requires a vendor. The moonpay vendor id stays as the second session slot used by the per-vendor isolation tests. Co-authored-by: george.weiler <george.weiler@consensys.net>
- Link changelog entries to this PR (#11399) - startSession: terms accepted before a session exists apply to the country they were accepted for. If the session is created for another country, the unsubmitted acceptance is dropped so the user accepts that country's documents, and the entry records the session's country - Writes no longer create a vendor entry that clearState/reset removed; only startSession and acceptVendorDisclaimers start an entry, so an in-flight status fetch or consent write cannot bring a wiped session back Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
startSession no longer clears unsubmitted terms or overwrites the stored residence country before it knows a session will be resumed or created, so a failed call leaves persisted state as it was. Co-authored-by: george.weiler <george.weiler@consensys.net>
cursor
Bot
force-pushed
the
cursor/kyc-per-vendor-sessions-62bb
branch
from
November 10, 2026 17:44
64b39cf to
5e86703
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort 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.
Reviewed by Cursor Bugbot for commit 5e86703. Configure here.
recordVendorDisclaimers marks the stored acceptance submitted only when it is still the set of ids that was sent, so terms accepted during the request stay unsubmitted. Co-authored-by: george.weiler <george.weiler@consensys.net>
Contributor
|
Can we add a video to the client PR to verify the existing VBA flow since this is a high risk PR? |
cursor Bot
pushed a commit
to MetaMask/metamask-mobile
that referenced
this pull request
Nov 10, 2026
…gation MetaMask/core#11399 removes KycService:createMoonpaySession, so the KYC controller messenger must no longer delegate it. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Contributor
|
Also, I believe it would be good to add the component view tests for this multi session KYC. wdyt? |
This branch was previously deployed
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
KycControllerstill stores one session, andKycServicestill exposes a MoonPay-specific session creator with MoonPay defaults. Money (Iron) and a second vendor cannot onboard at the same time, and a status ofapprovedis easy to read from the wrong field.This rebases the per-vendor session work from #11277 and #11275 onto current
mainand finishes the MoonPay session API removal in the same breaking change. It does not close those pull requests.sessions, keyed by vendor. Session methods take{ vendor }.getSessionDecisionapproves a vendor only when that vendor'sfinalStatusisapproved.rejectedandretrycome fromfinalStatus.pendingcovers a pending final status, a pendingkycStatus, or a submitted provider flow.RampsControllercalls the per-vendor actions with{ vendor: 'iron' }and readskycStatusfromgetSessionDecision.VbaKycStatusandVbaOnboardingSnapshotare unchanged. The ramps changelog points at the unreleased@metamask/kyc-controller, not the released0.16.0, which does not include this API.KycService.createMoonpaySession,CreateMoonpaySessionParams, andKycService:createMoonpaySessionare removed. Sessions are created withcreateUkycSession, which requiresvendor.vendorUserId: 'mockedId'stays until kyc-api accepts a real vendor user id.KycVendorstill includes'moonpay'. There is no MoonPay session API. The id remains so the per-vendor tests have a second slot: a second session must not clobber the first,clearStatemust clear every vendor, and only one SumSub flow can be on screen. Ramps MoonPay customer records are the neobank integration, not this KYC vendor.kyc-controllerandramps-controllership together. Ramps needs a new major because its required actions change. Versions are recorded as BREAKING in the Unreleased changelogs and bumped at release time.References
Checklist
Client adoption is in draft mobile PRs (see References). They can't pass CI until this is released.
Note
High Risk
Large breaking changes to KYC state shape, public APIs, and persistence; clients must migrate call sites and stored state or risk incorrect onboarding and disclaimer handling.
Reviewed by Cursor Bugbot for commit ab1ae19. Bugbot is set up for automated code reviews on this repo. Configure here.