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
5 changes: 5 additions & 0 deletions packages/ramps-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Add NeoBankService Pix / autoramp quote client methods and messenger actions, targeting the neobank-proxy `/neobank` prefix on the Ramp API host: `registerPixAddress`, `getAutorampQuote`, `createAutoramp`, `getAutorampQuoteForAutoramp`, `attachAutorampQuote`, and `getCustomerByExternalId`. Pix/quote helpers return parsed proxy JSON; `createAutoramp` maps autoramp-shaped responses via `mapNeoBankAutorampToRemoteSnapshot` (same as `getAutoramp`). Optional `Idempotency-Key` is supported on mutating calls.
- Export `TERMINAL_ORDER_STATUSES` and `isTerminalOrderStatus()` so consuming clients can share the controller's terminal order status set instead of maintaining duplicate copies. ([#9679](https://github.com/MetaMask/core/pull/9679))

### Changed

- Point `NeoBankService.getAutoramp` at `GET /neobank/autoramps/{id}` (neobank-proxy global `/neobank` prefix) instead of `/api/v2/autoramps/{id}`, so Core matches the proxy that ships.

## [20.0.0]

### Changed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
import type { NeoBankService } from './NeoBankService.js';

/**
* Fetches an autoramp account via the Ramp API proxy of
* MoonPay `GET /api/autoramps/{autoramp_id}`.
* Fetches an autoramp account via neobank-proxy
* `GET /neobank/autoramps/{autoramp_id}` (MoonPay
* `GET /api/autoramps/{autoramp_id}`).
*
* @param autorampId - MoonPay / Ramp API autoramp id.
* @returns Remote snapshot for controller apply/refresh.
Expand All @@ -17,7 +18,90 @@ export type NeoBankServiceGetAutorampAction = {
handler: NeoBankService['getAutoramp'];
};

/**
* Registers a Pix address via neobank-proxy `POST /neobank/addresses/pix`.
* Body is forwarded as opaque JSON (MoonPay address schema).
*
* @param body - Pix address registration payload.
* @param options - Optional idempotency key.
* @returns Parsed proxy JSON response.
*/
export type NeoBankServiceRegisterPixAddressAction = {
type: `NeoBankService:registerPixAddress`;
handler: NeoBankService['registerPixAddress'];
};

/**
* Fetches an autoramp quote via neobank-proxy `GET /neobank/autoramps/quote`.
*
* @param query - Quote query params (forwarded as-is).
* @returns Parsed proxy JSON response.
*/
export type NeoBankServiceGetAutorampQuoteAction = {
type: `NeoBankService:getAutorampQuote`;
handler: NeoBankService['getAutorampQuote'];
};

/**
* Creates an autoramp from a signed quote via neobank-proxy
* `POST /neobank/autoramps` (MoonPay `POST /api/autoramps`).
*
* @param body - CreateAutoramp / signed-quote payload (forwarded as-is).
* @param options - Optional idempotency key.
* @returns Remote snapshot for controller apply/refresh.
*/
export type NeoBankServiceCreateAutorampAction = {
type: `NeoBankService:createAutoramp`;
handler: NeoBankService['createAutoramp'];
};

/**
* Fetches a quote for an existing autoramp via neobank-proxy
* `GET /neobank/autoramps/{autoramp_id}/quote`.
*
* @param autorampId - Autoramp id.
* @param query - Quote query params (forwarded as-is).
* @returns Parsed proxy JSON response.
*/
export type NeoBankServiceGetAutorampQuoteForAutorampAction = {
type: `NeoBankService:getAutorampQuoteForAutoramp`;
handler: NeoBankService['getAutorampQuoteForAutoramp'];
};

/**
* Attaches a signed quote to an autoramp via neobank-proxy
* `POST /neobank/autoramps/{autoramp_id}/quotes`.
*
* @param autorampId - Autoramp id.
* @param body - Quote attachment payload (forwarded as-is).
* @param options - Optional idempotency key.
* @returns Parsed proxy JSON response.
*/
export type NeoBankServiceAttachAutorampQuoteAction = {
type: `NeoBankService:attachAutorampQuote`;
handler: NeoBankService['attachAutorampQuote'];
};

/**
* Fetches a customer by partner external id via neobank-proxy
* `GET /neobank/customers/{external_id}/external`.
*
* @param externalId - Partner-assigned external customer id.
* @returns Parsed proxy JSON response.
*/
export type NeoBankServiceGetCustomerByExternalIdAction = {
type: `NeoBankService:getCustomerByExternalId`;
handler: NeoBankService['getCustomerByExternalId'];
};

/**
* Union of all NeoBankService action types.
*/
export type NeoBankServiceMethodActions = NeoBankServiceGetAutorampAction;
export type NeoBankServiceMethodActions =
| NeoBankServiceGetAutorampAction
| NeoBankServiceRegisterPixAddressAction
| NeoBankServiceGetAutorampQuoteAction
| NeoBankServiceCreateAutorampAction
| NeoBankServiceGetAutorampQuoteForAutorampAction
| NeoBankServiceAttachAutorampQuoteAction
| NeoBankServiceGetCustomerByExternalIdAction;
Loading
Loading