Repository navigation
feat(kyc): adopt per-vendor KYC sessions - #38814
georgeweiler wants to merge 5 commits into
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
PR template — items to address before "Ready for review"Warnings — informational, address before merging:
See docs/readme/ready-for-review.md for the full Definition of Ready for Review. |
Smart E2E Test SelectionSelected E2E tags: ALL AI Confidence: 100 E2E reasoningExpand to readI kept the hard-rule seed (ALL). The PR bumps @metamask/kyc-controller (0.16 to 0.17) and @metamask/ramps-controller (29 to 30, a major version). It adds persisted-state migration 162, registered in migrations/index.ts, which restructures KycController state into a |
Adopts @metamask/kyc-controller with one session per vendor and the
matching @metamask/ramps-controller.
- Migration 161 moves the flat KycController state into sessions[vendor],
keeping providerFlowStatus and marking migrated Iron terms as submitted
- KYC selectors take a vendor; VBA passes iron
- Vendor terms acceptance is stored on the KYC controller
(acceptVendorDisclaimers) instead of VBA's wallet-keyed storage, and the
email step submits it with recordVendorDisclaimers({ vendor })
- Remove vbaVendorTermsStorage
CI will fail until the new core versions are released; the lockfile is not
updated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Update unit tests and Engine fixtures for the per-vendor KycController state, and the terms flow that now stores acceptance on the controller. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…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>
The component-view Engine mock now keeps per-vendor session entries and stores accepted vendor terms like the real controller, and the KycPending view test seeds sessions.iron. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Drop vbaKycSession (startSession no longer throws on a geoCountry mismatch), read the residence country from the Iron session entry, renumber the KYC migration to 162 and require kyc-controller ^0.17.0 and ramps-controller ^30.0.0. Co-authored-by: george.weiler <george.weiler@consensys.net>
a559e5b to
66a629e
Compare
Description
Adopts per-vendor KYC sessions from MetaMask/core#11399.
KycControllerused to hold one session for everything. It now holdssessions, keyed by vendor, so a second feature (e.g. Kalshi in Predict) can hold its own session next to VBA's Iron one.KycControllerstate intosessions[vendor]. It keepsproviderFlowStatus, which is the only record that a user already submitted SumSub and is waiting. Migrated Iron terms are marked submitted, because they were only ever written after Iron recorded them.email,vendorandgeoCountryare dropped.iron.acceptVendorDisclaimers) instead of VBA's wallet-keyed storage. The email step submits it withrecordVendorDisclaimers({ vendor }).vbaVendorTermsStorageis deleted. A user who accepted Iron's terms but never started a session sees the terms once more.Changelog
CHANGELOG entry: null
Related issues
Refs: MetaMask/core#11399
Manual testing steps
Run against locally built core packages copied over
node_modules/@metamask/{kyc,ramps}-controller, since the new versions aren't published.Verified locally on the iOS simulator: Engine loads, migration 161 runs, VBA hydrate reads the new state, and accepted terms land on
sessions.ironand carry the flow to the email step.Screenshots/Recordings
N/A — no UI change.
Before
N/A
After
N/A
Pre-merge author checklist
Pre-merge reviewer checklist
🤖 Generated with Claude Code
Description
Adopts per-vendor KYC sessions from MetaMask/core#11399.
KycControllerused to hold one session for everything. It now holdssessions, keyed by vendor, so a second feature (e.g. Kalshi in Predict) can hold its own session next to VBA's Iron one.KycControllerstate intosessions[vendor]. It keepsproviderFlowStatus, which is the only record that a user already submitted SumSub and is waiting. Migrated Iron terms are marked submitted, because they were only ever written after Iron recorded them.email,vendorandgeoCountryare dropped.iron.acceptVendorDisclaimers) instead of VBA's wallet-keyed storage. The email step submits it withrecordVendorDisclaimers({ vendor }).vbaVendorTermsStorageis deleted. A user who accepted Iron's terms but never started a session sees the terms once more.vbaKycSession(from main) is deleted.startSessionno longer throws on a country mismatch, so the reset-and-retry helper has nothing to catch. The SumSub launch and the terms catalog read the residence country fromsessions.iron.@metamask/kyc-controller^0.17.0 and@metamask/ramps-controller^30.0.0, so CI stays red until core releases them. Bumping ramps to 30 also brings the BaseDataService migrations forRampsService,NeoBankServiceandTransakService(core#11214, core#11216, core#10882). Their service messengers here will need an update when that release lands.Changelog
CHANGELOG entry: null
Related issues
Refs: MetaMask/core#11399
Manual testing steps
Run against locally built core packages copied over
node_modules/@metamask/{kyc,ramps}-controller, since the new versions aren't published.Verified locally on the iOS simulator before the rebase onto main (the migration was numbered 161 then): Engine loads, the migration runs, VBA hydrate reads the new state, and accepted terms land on
sessions.ironand carry the flow to the email step.Screenshots/Recordings
N/A — no UI change.
Before
N/A
After
N/A
Pre-merge author checklist
Pre-merge reviewer checklist
🤖 Generated with Claude Code