Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/ramps-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Add `RampsController.hydrateNeobankStore` and persisted `state.neobank` with a `NeobankOnboardingStage` enum so Mobile can route Money Account onboarding after cold start or missed KYC events. The method refreshes `KycController` status, looks up wallet registration / autoramp readiness, and derives a single stage without navigating or auto-submitting wallet/autoramp creation. Hosts must also delegate `KycController:getState`, `KycController:getCustomerIdentity`, and `KycController:refreshKycStatus` (now listed in `RAMPS_CONTROLLER_REQUIRED_CONTROLLER_ACTIONS`). Also exports `deriveNeobankOnboardingStage`, `getDefaultNeobankState`, and related helpers. ([#10116](https://github.com/MetaMask/core/pull/10116))

- Add `NeoBankService` for MetaMask Ramp API neo-bank-proxy endpoints under the `/neobank` prefix on the Ramp API host, including messenger actions for `getAutoramp`, `registerPixAddress`, `getAutorampQuote`, `createAutoramp`, `getAutorampQuoteForAutoramp`, `attachAutorampQuote`, `getCustomerByExternalId`, `getMoonpayCustomerId`, `getWalletRegistrationStatus`, and `registerSelfHostedWallet`. Mutating POSTs do not retry (to avoid duplicate Pix/autoramp creates without a stable `Idempotency-Key`); GETs still retry 429/5xx/network errors. Optional `Idempotency-Key` is forwarded when callers supply one. Also exports `mapNeoBankAutorampToRemoteSnapshot`, `AutorampRemoteSnapshot`, and wallet-registration HTTP types (`WalletRegistrationError`, `RegistrationStatus`, `RegistrationOutcome`). ([#10031](https://github.com/MetaMask/core/pull/10031))

- Add `RampsController` autoramp last-seen cursor and Money Account wallet registration: persisted `autoramps` state, `createAutoramp` / `refreshAutoramp(s)` / `applyAutorampStatusFromPush`, `registerMoneyAccountWallet`, and `RampsController:autorampStatusChanged`. MoonPay remains the source of truth; hosts should call `refreshAutoramps` on resume to catch webhooks missed while the app was closed. Hosts must delegate `RAMPS_CONTROLLER_REQUIRED_CONTROLLER_ACTIONS` (`AuthenticationController:getSessionProfile`, `KeyringController:signPersonalMessage`, `RemoteFeatureFlagController:getState`) plus the NeoBank actions listed in `RAMPS_CONTROLLER_REQUIRED_SERVICE_ACTIONS`. ([#10032](https://github.com/MetaMask/core/pull/10032))
Expand Down
1 change: 1 addition & 0 deletions packages/ramps-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"dependencies": {
"@metamask/base-controller": "^9.1.0",
"@metamask/controller-utils": "^12.3.0",
"@metamask/kyc-controller": "workspace:^",
"@metamask/messenger": "^2.0.0",
"@metamask/profile-sync-controller": "^29.0.0",
"@metamask/remote-feature-flag-controller": "^6.1.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,25 @@ export type RampsControllerMarkAutorampAsNotifiedAction = {
handler: RampsController['markAutorampAsNotified'];
};

/**
* Refreshes authoritative Money Account / NeoBank onboarding signals and
* writes a single Mobile-routable stage to `state.neobank`.
*
* Safe to call twice. Does **not** navigate and does **not** auto-submit
* wallet registration or autoramp creation (see TRAM-3924). Clients must not
* persist UKYC `sessionId` or re-register; this method is lookup-then-derive
* only.
*
* @param params - Hydration parameters.
* @param params.walletAddress - Money Account wallet address used for
* registration / autoramp checks after KYC is complete.
* @returns The derived {@link NeobankOnboardingStage}.
*/
export type RampsControllerHydrateNeobankStoreAction = {
type: `RampsController:hydrateNeobankStore`;
handler: RampsController['hydrateNeobankStore'];
};

/**
* Applies a remote autoramp snapshot from a websocket / webhook push.
*
Expand Down Expand Up @@ -837,6 +856,7 @@ export type RampsControllerMethodActions =
| RampsControllerRegisterMoneyAccountWalletAction
| RampsControllerRemoveAutorampAction
| RampsControllerMarkAutorampAsNotifiedAction
| RampsControllerHydrateNeobankStoreAction
| RampsControllerApplyAutorampStatusFromPushAction
| RampsControllerRefreshAutorampAction
| RampsControllerRefreshAutorampsAction
Expand Down
Loading
Loading