refactor(ramps): move Money Account wallet signing from kyc-controller to ramps-controller - #9858
Conversation
Wallet ownership signing is a Money Movement / neobank-proxy concern, not KYC. Moving it into ramps-controller also removes the ramps→kyc package dependency that broke the monorepo project-reference build and blocked publish-preview for core PR #9853. Co-authored-by: Cursor <cursoragent@cursor.com>
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 a140c31. Configure here.
|
|
||
| // List requires customer_id in the neobank path, so resolve Iron's id | ||
| // before the first lookup. | ||
| const customerId = await this.resolveAutorampCustomerId(); |
There was a problem hiding this comment.
Wrong external id for wallet fallback
Medium Severity
registerMoneyAccountWallet resolves the Iron customer via resolveAutorampCustomerId, whose fallback looks up by profileId. The previous KYC path (and the NeoBankService.getMoonpayCustomerId / #getCanonicalExternalId helpers added in this PR) prefer canonicalProfileId as MoonPay’s partner external_id. After multi-SRP pairing those ids can differ, so the fallback can miss the mapped customer and fail registration; failures also surface autoramp-specific error text.
Additional Locations (2)
Triggered by project rule: Guidance for Bugbot
Reviewed by Cursor Bugbot for commit a140c31. Configure here.


Summary
Money Account self-hosted wallet registration (proving wallet ownership to MoonPay Iron via the neobank-proxy) lived in
@metamask/kyc-controller. This PR moves it to@metamask/ramps-controller, which is the correct Money Movement owner, and removes the ramps→kyc package dependency that broke the monorepo TypeScript project-reference build.wallet-registration-service.ts,wallet-registration-machine.ts,ownership-message.ts(and tests) frompackages/kyc-controller/srctopackages/ramps-controller/src.registerMoneyAccountWalletfromKycControllertoRampsController(resolves customer id viaresolveAutorampCustomerId, signs viaKeyringController:signPersonalMessage, submits viaNeoBankService).KycServicetoNeoBankService(getMoonpayCustomerId,getWalletRegistrationStatus,registerSelfHostedWallet), built lazily so an invalid environment only throws at request time. Removed theneobankBaseUrlKycService option.@metamask/kyc-controllerdependency (package.json + both tsconfigs) fromramps-controller, and the unused@metamask/keyring-controllerdependency fromkyc-controller.RampsControllernow declares local structural types for the two type-only messenger actions it needs, so the packages are decoupled in the build graph.index.tsexport surfaces, moved/ported wallet-registration tests into ramps, and updated both CHANGELOGs.Why
@metamaskbot publish-previewon core PR Neobank demo #9853.Test plan
yarn build(full monorepo, with project references) — exit 0; kyc-controller and ramps-controller build cleanlyyarn workspace @metamask/kyc-controller test— passing, 100% coverageyarn workspace @metamask/ramps-controller test:verbose— 842/842 tests, 18/18 suites (coverage thresholds for pre-existing untested areas likeautoramp-syncing/controller-integration.tsare pre-existing onneobank-demo, not introduced here)yarn workspace @metamask/kyc-controller messenger-action-types:check— up to dateyarn workspace @metamask/ramps-controller messenger-action-types:check— up to dateyarn eslint packages/kyc-controller/src— cleanMade with Cursor