diff --git a/package.json b/package.json index 860e7210c10..7bacdf2121e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@metamask/core-monorepo", - "version": "1148.0.0", + "version": "1149.0.0", "private": true, "description": "Monorepo for packages shared between MetaMask clients", "repository": { diff --git a/packages/ramps-controller/CHANGELOG.md b/packages/ramps-controller/CHANGELOG.md index ffb93fec73f..d76121f7636 100644 --- a/packages/ramps-controller/CHANGELOG.md +++ b/packages/ramps-controller/CHANGELOG.md @@ -7,16 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [17.2.0] + ### Added -- Add the pure `getHeadlessProviderAllowlist(remoteFeatureFlagState, surface?)` helper plus the `HEADLESS_ALLOWLIST_SURFACES` constant and `HeadlessAllowlistSurface` type, resolving the provider-id allowlist carried by the `moneyHeadlessAllProviders` flag's object payload (`surfaces[surface]` overrides the top-level `providerIds`; absent, empty, or malformed levels fall through to no restriction) ([#9524](https://github.com/MetaMask/core/pull/9524)) -- Add the `HEADLESS_ALL_PROVIDERS_FEATURE_VERSION` constant (currently `'1'`) and the `getHeadlessAllProvidersMinimumVersion(remoteFeatureFlagState)` helper, exposing the version-gating fields of the `moneyHeadlessAllProviders` payload; an enabled object payload must now carry `featureVersion: '1'` or it resolves to disabled, and `minimumVersion` is surfaced for clients to validate against their app version (the boolean `true` form is unchanged) ([#9524](https://github.com/MetaMask/core/pull/9524)) -- Add an optional `surface` option to `RampsController.getQuotes` (canonical values `money` | `perps` | `predictions`) selecting the per-surface allowlist from the flag payload on the widened all-providers path; it does not affect fetching or caching ([#9524](https://github.com/MetaMask/core/pull/9524)) +- Add the pure `getHeadlessProviderAllowlist(remoteFeatureFlagState)` helper resolving the provider-id allowlist carried by the `moneyHeadlessAllProviders` flag's object payload; empty or malformed `providerIds` resolve to `undefined` (no restriction), unknown keys and non-string entries are ignored ([#9524](https://github.com/MetaMask/core/pull/9524)) +- Add the `HEADLESS_ALL_PROVIDERS_FEATURE_VERSION` constant (currently `'1'`) and the `getHeadlessAllProvidersMinimumVersion(remoteFeatureFlagState)` helper; an enabled object payload must carry `featureVersion: '1'` or it resolves to disabled, and `minimumVersion` is exposed for clients to validate against the app version ([#9524](https://github.com/MetaMask/core/pull/9524)) ### Changed -- Widen the `moneyHeadlessAllProviders` flag value contract to accept an object payload `{ enabled: true, providerIds?: string[], surfaces?: Record }` alongside the boolean form ([#9524](https://github.com/MetaMask/core/pull/9524)) - - `isHeadlessAllProvidersEnabled` now returns `true` for an object payload whose `enabled` is the literal `true`; every other previously-false value (strings, numbers, arrays, disabled or malformed payloads) still resolves to `false`, and the boolean forms behave exactly as before, so boolean-only configurations see no behavior change +- Widen the `moneyHeadlessAllProviders` flag value contract to accept an object payload `{ enabled: true, featureVersion: "1", providerIds?: string[] }` alongside the boolean form ([#9524](https://github.com/MetaMask/core/pull/9524)) + - `isHeadlessAllProvidersEnabled` now returns `true` for an object payload whose `enabled` is the literal `true` and `featureVersion` is `"1"`; every other previously-false value still resolves to `false`, so boolean-only configurations see no behavior change - When the payload lists provider ids, the widened quote pick drops candidates whose provider is not listed (ids match in prefixed `/providers/x` or bare form, case-insensitively); if nothing survives, `getQuotes` returns an empty `success[]` with `sorted` / `error` / `customActions` preserved - Clients on earlier versions coerce the object payload to `false` (native-only), so serving it cannot enable widening for a client that cannot parse it @@ -467,7 +468,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add `OnRampService` for interacting with the OnRamp API - Add geolocation detection via IP address lookup -[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/ramps-controller@17.1.0...HEAD +[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/ramps-controller@17.2.0...HEAD +[17.2.0]: https://github.com/MetaMask/core/compare/@metamask/ramps-controller@17.1.0...@metamask/ramps-controller@17.2.0 [17.1.0]: https://github.com/MetaMask/core/compare/@metamask/ramps-controller@17.0.0...@metamask/ramps-controller@17.1.0 [17.0.0]: https://github.com/MetaMask/core/compare/@metamask/ramps-controller@16.0.0...@metamask/ramps-controller@17.0.0 [16.0.0]: https://github.com/MetaMask/core/compare/@metamask/ramps-controller@15.1.0...@metamask/ramps-controller@16.0.0 diff --git a/packages/ramps-controller/package.json b/packages/ramps-controller/package.json index b393f7c0cbe..71746ab05d4 100644 --- a/packages/ramps-controller/package.json +++ b/packages/ramps-controller/package.json @@ -1,6 +1,6 @@ { "name": "@metamask/ramps-controller", - "version": "17.1.0", + "version": "17.2.0", "description": "A controller for managing cryptocurrency on/off ramps functionality", "keywords": [ "Ethereum", diff --git a/packages/ramps-controller/src/featureFlags.ts b/packages/ramps-controller/src/featureFlags.ts index c4b94ea5369..c5fe446b1d8 100644 --- a/packages/ramps-controller/src/featureFlags.ts +++ b/packages/ramps-controller/src/featureFlags.ts @@ -8,10 +8,9 @@ import type { Json } from '@metamask/utils'; * - The literal boolean `true` widens the headless fiat quote path to every * provider class (native, in-app WebView aggregator, and external-browser / * custom-action) with no provider restriction. - * - An object payload `{ enabled: true, providerIds?: string[], surfaces?: - * Record }` widens the same way, and additionally - * restricts the widened quote pick to the listed provider ids (see - * {@link getHeadlessProviderAllowlist}). + * - An object payload `{ enabled: true, featureVersion: "1", providerIds?: string[] }` + * widens the same way, and additionally restricts the widened quote pick to + * the listed provider ids (see {@link getHeadlessProviderAllowlist}). * * `false`, a missing flag, or any other value keeps the native-only default. * Clients that only understand the boolean form coerce the object payload to diff --git a/packages/transaction-pay-controller/package.json b/packages/transaction-pay-controller/package.json index 0e70654400c..037daa5bd8e 100644 --- a/packages/transaction-pay-controller/package.json +++ b/packages/transaction-pay-controller/package.json @@ -68,7 +68,7 @@ "@metamask/messenger": "^2.0.0", "@metamask/metamask-eth-abis": "^3.1.1", "@metamask/network-controller": "^34.0.0", - "@metamask/ramps-controller": "^17.1.0", + "@metamask/ramps-controller": "^17.2.0", "@metamask/remote-feature-flag-controller": "^4.2.2", "@metamask/sentinel-api-service": "^1.0.0", "@metamask/transaction-controller": "^69.2.1", diff --git a/yarn.lock b/yarn.lock index 1476489ef06..414dbc97704 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8544,7 +8544,7 @@ __metadata: languageName: node linkType: hard -"@metamask/ramps-controller@npm:^17.1.0, @metamask/ramps-controller@workspace:packages/ramps-controller": +"@metamask/ramps-controller@npm:^17.2.0, @metamask/ramps-controller@workspace:packages/ramps-controller": version: 0.0.0-use.local resolution: "@metamask/ramps-controller@workspace:packages/ramps-controller" dependencies: @@ -9257,7 +9257,7 @@ __metadata: "@metamask/messenger": "npm:^2.0.0" "@metamask/metamask-eth-abis": "npm:^3.1.1" "@metamask/network-controller": "npm:^34.0.0" - "@metamask/ramps-controller": "npm:^17.1.0" + "@metamask/ramps-controller": "npm:^17.2.0" "@metamask/remote-feature-flag-controller": "npm:^4.2.2" "@metamask/sentinel-api-service": "npm:^1.0.0" "@metamask/transaction-controller": "npm:^69.2.1"