Skip to content

WIP: neobank migrate kyc-controller orchestration to ramps-controller - #35142

Draft
jiexi wants to merge 1 commit into
demo/vba-kyc-generalized-kyc-controller-vendorsfrom
demo/vba-kyc-orchestration-moved-into-ramps-controller
Draft

WIP: neobank migrate kyc-controller orchestration to ramps-controller#35142
jiexi wants to merge 1 commit into
demo/vba-kyc-generalized-kyc-controller-vendorsfrom
demo/vba-kyc-orchestration-moved-into-ramps-controller

Conversation

@jiexi

@jiexi jiexi commented Aug 21, 2026

Copy link
Copy Markdown
Member

Description

Move Money Account wallet registration and autoramp creation out of KYC init and VBA screens into RampsController.provisionMoneyAccount / setMoneyAccountProvisioningIntent (MetaMask/core#9933).

  • Get Pix Key records the provision intent after Iron KYC starts; Mock KYC success calls provisionMoneyAccount for the pull path. KYC init no longer subscribes to statusChanged.
  • Sandbox deposit toasts resolve the customer id through RampsController.resolveAutorampCustomerId instead of reading KYC state and calling NeoBank from the UI.
  • Deletes the view-layer helpers (registerMoneyAccountOnKycCompletion, registerSelectedMoneyAccountWallet, moneyAccountProvisioning).
  • Bumps @metamask/ramps-controller and @metamask/kyc-controller to preview 0b5bfc2. Iron identity (initialize / customer / SumSub) stays on KycController.

Changelog

CHANGELOG entry: null

Related issues

Refs: MetaMask/core#9933

Manual testing steps

Feature: VBA Money Account provisioning via RampsController

  Scenario: user agrees to Get Pix Key terms
    Given the Brazil neobank flag is on and the user is signed in
    When the user taps Agree and continue
    Then Iron KYC initialize runs and the app navigates to verify identity
    And RampsController holds a provision intent for the selected wallet

  Scenario: user completes SumSub
    Given KYC status becomes completed
    Then RampsController registers the selected wallet and creates the autoramp
    And a second completion path does not prompt to sign again if registration already ran

  Scenario: user opens Mock KYC success after status is already completed
    Given KYC was already completed before that screen mounted
    When the user taps Create account
    Then provisionMoneyAccount still registers the wallet and creates the autoramp

  Scenario: KYC is not completed
    Given KYC status is pending or rejected
    When the user runs the success pipeline
    Then the error is shown and no autoramp is created

  Scenario: sandbox deposit completes
    Given the neobank demo websocket receives a Completed event
    Then the deposit success toast still fires

  Scenario: neobank flag is off
    Given the Brazil neobank flag is off
    Then the Bank account row stays coming-soon

Screenshots/Recordings

N/A — internal orchestration move; no intended product UI change besides collapsing the demo success pipeline onto provisionMoneyAccount.

Before

N/A

After

N/A

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

@metamask-ci metamask-ci Bot added the team-kyc universal kyc label Aug 21, 2026
@jiexi
jiexi marked this pull request as ready for review August 21, 2026 21:06
@jiexi
jiexi requested review from a team as code owners August 21, 2026 21:06
@jiexi
jiexi marked this pull request as draft August 21, 2026 21:06
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeAccounts, SmokeConfirmations, SmokeNetworkAbstractions, SmokeNetworkExpansion, SmokeSwap, SmokeStake, SmokeWalletPlatform, SmokeMoney, SmokePerps, SmokeMultiChainAPI, SmokePredictions, SmokeSeedlessOnboarding, SmokeBrowser, SmokeSnaps, SmokeMMConnect
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: high
  • AI Confidence: 100%
click to see 🤖 AI reasoning details

E2E Test Selection:
Hard rule (controller-version-update): @MetaMask controller package version updated in package.json: @metamask/kyc-controller, @metamask/ramps-controller. Running all tests.

Performance Test Selection:
No performance-sensitive paths are changed. The refactoring moves orchestration logic from UI-layer event subscribers into the RampsController, but this doesn't affect any measured performance scenarios (launch, login, onboarding, swaps, asset loading, etc.). The Money performance tag (@PerformanceMoney) covers Money Home balance and activity content loading, not the KYC/provisioning flow. No performance test tags are warranted.

View GitHub Actions results

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatednpm/​@​metamask-previews/​ramps-controller@​20.0.0-preview-2317a52 ⏵ 20.0.0-preview-0b5bfc284 +110079 +198100
Updatednpm/​@​metamask-previews/​kyc-controller@​0.0.0-preview-2317a52 ⏵ 0.0.0-preview-0b5bfc281 +11008097 +1100

View full report

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

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 2 potential issues.

Fix All in Cursor

❌ 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 e3b5fcd. Configure here.

updateStep('autoramp', {
status: 'success',
detail: `id = ${truncateId(account.id)} · status = ${account.status}`,
detail: `id = ${truncateId(provisioned.autoramp.id)} · status = ${provisioned.autoramp.status}`,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Failures misattributed to signing

Medium Severity

provisionMoneyAccount runs only under the signing timed step, then customer and autoramp are marked success afterward. KYC-pending or customer-mapping failures therefore appear on Sign wallet ownership, while Map identity to MoonPay customer and Create the autoramp stay queued, so the demo pipeline no longer surfaces which stage actually failed.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit e3b5fcd. Configure here.

callOrder.push('register');
return {
type: 'registered',
registration: {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Weak element presence matchers

Low Severity

Rewritten assertions use toBeTruthy() on elements from getByText (for example the registration detail and pipeline stopped copy). Unit testing guidelines require toBeOnTheScreen() for element presence instead of weak matchers.

Fix in Cursor Fix in Web

Triggered by project rule: Unit Testing Guidelines

Reviewed by Cursor Bugbot for commit e3b5fcd. Configure here.

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

Labels

size-XL team-kyc universal kyc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant