Skip to content

refactor(ramps): move Money Account wallet signing from kyc-controller to ramps-controller - #9858

Merged
amitabh94 merged 1 commit into
neobank-demofrom
refactor/move-wallet-signing-to-ramps
Aug 13, 2026
Merged

refactor(ramps): move Money Account wallet signing from kyc-controller to ramps-controller#9858
amitabh94 merged 1 commit into
neobank-demofrom
refactor/move-wallet-signing-to-ramps

Conversation

@amitabh94

Copy link
Copy Markdown
Contributor

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.

  • Moved wallet-registration-service.ts, wallet-registration-machine.ts, ownership-message.ts (and tests) from packages/kyc-controller/src to packages/ramps-controller/src.
  • Moved registerMoneyAccountWallet from KycController to RampsController (resolves customer id via resolveAutorampCustomerId, signs via KeyringController:signPersonalMessage, submits via NeoBankService).
  • Moved the three wallet HTTP methods from KycService to NeoBankService (getMoonpayCustomerId, getWalletRegistrationStatus, registerSelfHostedWallet), built lazily so an invalid environment only throws at request time. Removed the neobankBaseUrl KycService option.
  • Removed the @metamask/kyc-controller dependency (package.json + both tsconfigs) from ramps-controller, and the unused @metamask/keyring-controller dependency from kyc-controller. RampsController now declares local structural types for the two type-only messenger actions it needs, so the packages are decoupled in the build graph.
  • Regenerated messenger action types for both packages, updated both index.ts export surfaces, moved/ported wallet-registration tests into ramps, and updated both CHANGELOGs.

Why

  1. Architectural ownership — wallet ownership signing is a Money Movement / neobank-proxy concern, not KYC identity.
  2. Unblocks monorepo build / preview publish — the ramps→kyc package dependency caused TS6059 / TS6307 with project references and blocked @metamaskbot publish-preview on core PR Neobank demo #9853.

Test plan

  • yarn build (full monorepo, with project references) — exit 0; kyc-controller and ramps-controller build cleanly
  • yarn workspace @metamask/kyc-controller test — passing, 100% coverage
  • yarn workspace @metamask/ramps-controller test:verbose — 842/842 tests, 18/18 suites (coverage thresholds for pre-existing untested areas like autoramp-syncing/controller-integration.ts are pre-existing on neobank-demo, not introduced here)
  • yarn workspace @metamask/kyc-controller messenger-action-types:check — up to date
  • yarn workspace @metamask/ramps-controller messenger-action-types:check — up to date
  • yarn eslint packages/kyc-controller/src — clean
  • Confirm CI build / typecheck / tests are green on this PR before merge

Made with Cursor

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>
@amitabh94
amitabh94 requested review from a team as code owners August 13, 2026 06:59

@cursor cursor Bot left a comment

Copy link
Copy Markdown

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 1 potential issue.

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 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();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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)
Fix in Cursor Fix in Web

Triggered by project rule: Guidance for Bugbot

Reviewed by Cursor Bugbot for commit a140c31. Configure here.

@amitabh94
amitabh94 merged commit 0a3674b into neobank-demo Aug 13, 2026
32 of 47 checks passed
@amitabh94
amitabh94 deleted the refactor/move-wallet-signing-to-ramps branch August 13, 2026 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant