WIP: neobank use generalized kyc-controller vendors - #35143
Conversation
…ler-vendors Co-authored-by: Cursor <cursoragent@cursor.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Signed-off-by: Sébastien Van Eyck <sebastien.vaneyck@consensys.net>
|
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. |
…troller-vendors' into demo/vba-kyc-generalized-kyc-controller-vendors Co-authored-by: Cursor <cursoragent@cursor.com>
|
Warning MetaMask internal reviewing guidelines:
|
There was a problem hiding this comment.
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.
Reviewed by Cursor Bugbot for commit 86506a1. Configure here.
|
|
||
| it('passes production env when isProduction() returns true', () => { | ||
| mockIsProduction.mockReturnValue(true); | ||
| const requestMock = getInitRequestMock(); |
There was a problem hiding this comment.
KYC init test expects localhost URL
Medium Severity
The new kycServiceInit test expects baseUrl to be http://localhost:3000, and the init JSDoc now says that host is hardcoded, but the constructor still passes getKycApiBaseUrl(). In Jest, METAMASK_ENVIRONMENT is test and KYC_API_URL is empty, so that helper returns https://kyc-api.dev-api.cx.metamask.io. The assertion will fail, and the docs no longer match production wiring.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 86506a1. Configure here.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Performance Test Selection: |


Description
Adopt the generalized KYC vendor APIs from
@metamask/kyc-controllerso the VBA Iron path is a vendor-scoped customer create, not an Iron-only method.KycController.createIronCustomer({ email })withcreateVendorCustomer({ vendor: 'iron', email })inironKycFlow.KycService:createVendorCustomeron the KYC messenger instead of the Iron-specific actions (createIronCustomer,fetchIronDisclaimers,checkIronKycRequired).KycServicebaseUrlfromKYC_API_URLwith aMETAMASK_ENVIRONMENTfallback (dev / uat / production) so Engine can construct the service in tests and local runs when Babel inlines an emptyKYC_API_URL.termsAcceptedVendor,sumsubTncAccepted,idosTncAccepted) andRampsController.autorampsin test background state.@metamask/kyc-controllerand@metamask/ramps-controllerpreviews fromc34a16a37to2317a52(MetaMask/core#9908, MetaMask/core#9931).Changelog
CHANGELOG entry: null
Related issues
Refs: MetaMask/core#9908
Refs: MetaMask/core#9931
Manual testing steps
Screenshots/Recordings
N/A — vendor API rename and Engine wiring; no intended product UI change.
Before
N/A
After
N/A
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Note
Medium Risk
Touches KYC customer creation, UKYC JWKS hosts, and wallet reset behavior for persisted verification state—important for neobank onboarding but scoped to vendor API migration and Engine wiring rather than new user-facing flows.
Overview
This PR wires the Brazil VBA Iron path to the generalized
@metamask/kyc-controllervendor APIs instead of Iron-only controller/service methods.Iron KYC flow now calls
KycController.createVendorCustomer({ vendor: 'iron', email })(tests andironKycFlowupdated). The KYC controller messenger delegates the new service actions—vendor customer create, vendor/session disclaimers, idOS enclave/relay JWKS, andsetAuthorizations—replacing the old Iron-specific and Fractal encryption JWKS actions.KycService initialization resolves
baseUrlviaKYC_API_URLwhen inlined from builds, with aMETAMASK_ENVIRONMENTfallback to dev/uat/production KYC API hosts so Engine can construct the service when the env var is empty in Jest/local. Fractal encryption config inAppConstantsis split intoIDOS_ENCLAVE_URLandIDOS_RELAY_URL(updated production hosts) and passed intoKycServiceasidosEnclaveBaseUrl/idosRelayBaseUrl.Wallet lifecycle:
Engine.resetStateclearsKycControllerstate so KYC email, terms, and verification do not leak across wallets. NeoBankService gains delegatedAuthenticationController:getSessionProfile(aligned with ramps preview resolving customer id from Profile Sync). Test background state adds new persisted KYC fields andRampsController.autoramps.Dependency previews bump
@metamask/kyc-controllertoc61613ed2and pin@metamask/ramps-controllerto a matching preview.Reviewed by Cursor Bugbot for commit 86506a1. Bugbot is set up for automated code reviews on this repo. Configure here.