From 33d783e917b8a49d3e6e5b59fa99fe06e1074917 Mon Sep 17 00:00:00 2001 From: Amitabh Aggarwal Date: Tue, 7 Jul 2026 12:42:16 -0500 Subject: [PATCH 1/2] fix(geolocation-controller): point to API Platform geolocation-api instead of legacy Ramps on-ramp endpoint GeolocationApiService still called the Ramps-owned on-ramp.{env}api.cx.metamask.io/geolocation endpoint, which is slated for deprecation now that geolocation is a platform-owned service. Repoint at geolocation.{env}api.cx.metamask.io/v1/geolocation instead. Same response contract (plain-text ISO 3166-2 code), so no consumer-facing changes needed. UAT temporarily resolves to the production URL since API Platform has not yet provisioned a dedicated UAT deployment for this service. --- packages/geolocation-controller/CHANGELOG.md | 2 ++ .../geolocation-api-service.test.ts | 8 ++++---- .../geolocation-api-service.ts | 11 ++++++++--- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/packages/geolocation-controller/CHANGELOG.md b/packages/geolocation-controller/CHANGELOG.md index b1a5506224..88aba544a2 100644 --- a/packages/geolocation-controller/CHANGELOG.md +++ b/packages/geolocation-controller/CHANGELOG.md @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Point `GeolocationApiService` at API Platform's `geolocation-api` service instead of the legacy Ramps-owned `on-ramp` geolocation endpoint, which is slated for deprecation ([#TBD](https://github.com/MetaMask/core/pull/TBD)) + - UAT temporarily resolves to the production URL since API Platform has not yet provisioned a dedicated UAT deployment for this service - Bump `@metamask/controller-utils` from `^12.0.0` to `^12.3.0` ([#8774](https://github.com/MetaMask/core/pull/8774), [#9058](https://github.com/MetaMask/core/pull/9058), [#9083](https://github.com/MetaMask/core/pull/9083), [#9218](https://github.com/MetaMask/core/pull/9218)) - Bump `@metamask/messenger` from `^1.2.0` to `^2.0.0` ([#9392](https://github.com/MetaMask/core/pull/9392)) diff --git a/packages/geolocation-controller/src/geolocation-api-service/geolocation-api-service.test.ts b/packages/geolocation-controller/src/geolocation-api-service/geolocation-api-service.test.ts index 0513531aac..0aac0d8c06 100644 --- a/packages/geolocation-controller/src/geolocation-api-service/geolocation-api-service.test.ts +++ b/packages/geolocation-controller/src/geolocation-api-service/geolocation-api-service.test.ts @@ -44,11 +44,11 @@ describe('GeolocationApiService', () => { await rootMessenger.call('GeolocationApiService:fetchGeolocation'); expect(mockFetch).toHaveBeenCalledWith( - 'https://on-ramp.api.cx.metamask.io/geolocation', + 'https://geolocation.api.cx.metamask.io/v1/geolocation', ); }); - it('fetches from the UAT URL when env is UAT', async () => { + it('fetches from the production URL when env is UAT, since API Platform has not provisioned a dedicated UAT deployment', async () => { const mockFetch = createMockFetch('FR'); const { rootMessenger } = getService({ options: { fetch: mockFetch, env: Env.UAT }, @@ -57,7 +57,7 @@ describe('GeolocationApiService', () => { await rootMessenger.call('GeolocationApiService:fetchGeolocation'); expect(mockFetch).toHaveBeenCalledWith( - 'https://on-ramp.uat-api.cx.metamask.io/geolocation', + 'https://geolocation.api.cx.metamask.io/v1/geolocation', ); }); @@ -70,7 +70,7 @@ describe('GeolocationApiService', () => { await rootMessenger.call('GeolocationApiService:fetchGeolocation'); expect(mockFetch).toHaveBeenCalledWith( - 'https://on-ramp.dev-api.cx.metamask.io/geolocation', + 'https://geolocation.dev-api.cx.metamask.io/v1/geolocation', ); }); }); diff --git a/packages/geolocation-controller/src/geolocation-api-service/geolocation-api-service.ts b/packages/geolocation-controller/src/geolocation-api-service/geolocation-api-service.ts index f75819f2de..23c1798d4c 100644 --- a/packages/geolocation-controller/src/geolocation-api-service/geolocation-api-service.ts +++ b/packages/geolocation-controller/src/geolocation-api-service/geolocation-api-service.ts @@ -11,7 +11,7 @@ import type { GeolocationApiServiceMethodActions } from './geolocation-api-servi const DEFAULT_TTL_MS = 5 * 60 * 1000; -const ENDPOINT_PATH = '/geolocation'; +const ENDPOINT_PATH = '/v1/geolocation'; // === GENERAL === @@ -68,12 +68,17 @@ export type GeolocationApiServiceMessenger = Messenger< /** * Returns the base URL for the geolocation API for the given environment. * + * Served by API Platform's `geolocation-api` service, not the legacy + * Ramps-owned `on-ramp` endpoint this previously pointed to. API Platform has + * not yet provisioned a dedicated UAT deployment for this service, so UAT + * temporarily resolves to the production URL until one exists. + * * @param env - The environment to get the URL for. * @returns The full URL for the geolocation endpoint. */ function getGeolocationUrl(env: Env): string { - const envPrefix = env === Env.PRD ? '' : `${env}-`; - return `https://on-ramp.${envPrefix}api.cx.metamask.io${ENDPOINT_PATH}`; + const envPrefix = env === Env.DEV ? 'dev-' : ''; + return `https://geolocation.${envPrefix}api.cx.metamask.io${ENDPOINT_PATH}`; } /** From 73d94726275987e1960a330dac3f624e02392af5 Mon Sep 17 00:00:00 2001 From: Amitabh Aggarwal Date: Tue, 7 Jul 2026 12:43:48 -0500 Subject: [PATCH 2/2] chore: link changelog entry to PR #9415 --- packages/geolocation-controller/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/geolocation-controller/CHANGELOG.md b/packages/geolocation-controller/CHANGELOG.md index 88aba544a2..b447916eef 100644 --- a/packages/geolocation-controller/CHANGELOG.md +++ b/packages/geolocation-controller/CHANGELOG.md @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- Point `GeolocationApiService` at API Platform's `geolocation-api` service instead of the legacy Ramps-owned `on-ramp` geolocation endpoint, which is slated for deprecation ([#TBD](https://github.com/MetaMask/core/pull/TBD)) +- Point `GeolocationApiService` at API Platform's `geolocation-api` service instead of the legacy Ramps-owned `on-ramp` geolocation endpoint, which is slated for deprecation ([#9415](https://github.com/MetaMask/core/pull/9415)) - UAT temporarily resolves to the production URL since API Platform has not yet provisioned a dedicated UAT deployment for this service - Bump `@metamask/controller-utils` from `^12.0.0` to `^12.3.0` ([#8774](https://github.com/MetaMask/core/pull/8774), [#9058](https://github.com/MetaMask/core/pull/9058), [#9083](https://github.com/MetaMask/core/pull/9083), [#9218](https://github.com/MetaMask/core/pull/9218)) - Bump `@metamask/messenger` from `^1.2.0` to `^2.0.0` ([#9392](https://github.com/MetaMask/core/pull/9392))