diff --git a/packages/ramps-controller/CHANGELOG.md b/packages/ramps-controller/CHANGELOG.md index 22172cc11d1..edef4ffde06 100644 --- a/packages/ramps-controller/CHANGELOG.md +++ b/packages/ramps-controller/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- Update payment method delay type to match API response structure ([#7845](https://github.com/MetaMask/core/pull/7845)) - Add automatic quote polling with `startQuotePolling()`, `stopQuotePolling()`, and `setSelectedQuote()` methods, with auto-selection when a single quote is returned ([#7824](https://github.com/MetaMask/core/pull/7824)) ## [6.0.0] @@ -50,14 +51,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Add sync trigger methods to RampsController ([#7662](https://github.com/MetaMask/core/pull/7662)) - - Export `RampAction` type for `'buy' | 'sell'` ramp actions ([#7663](https://github.com/MetaMask/core/pull/7663)) - Add payment methods support with `getPaymentMethods()` method, `paymentMethods` and `selectedPaymentMethod` state ([#7665](https://github.com/MetaMask/core/pull/7665)) ### Changed - Evict expired cache entries based on TTL in addition to size-based eviction ([#7674](https://github.com/MetaMask/core/pull/7674)) - - Update `getTokens()` to use v2 API endpoint and support optional provider parameter ([#7664](https://github.com/MetaMask/core/pull/7664)) ## [4.0.0] @@ -65,19 +64,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Add `preferredProvider` state and `setPreferredProvider()` method to RampsController ([#7617](https://github.com/MetaMask/core/pull/7617)) - - Export `UserRegion` type ([#7646](https://github.com/MetaMask/core/pull/7646)) - - Add `defaultAmount` and `quickAmounts` fields to the `Country` type ([#7645](https://github.com/MetaMask/core/pull/7645)) - - Add `providers` state and `getProviders()` method to RampsController. Providers are automatically fetched on init and when the region changes ([#7652](https://github.com/MetaMask/core/pull/7652)) ### Changed - **BREAKING:** Change `userRegion` from `string | null` to `UserRegion | null`. Access region code via `userRegion.regionCode`. ([#7646](https://github.com/MetaMask/core/pull/7646)) - - Update `getCountries()` endpoint to use v2 API (`v2/regions/countries`) ([#7645](https://github.com/MetaMask/core/pull/7645)) - - Add `getApiPath()` helper function for versioned API paths with v2 default ([#7645](https://github.com/MetaMask/core/pull/7645)) ### Removed @@ -93,7 +87,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - **BREAKING:** Rename `geolocation` to `userRegion` and `updateGeolocation()` to `updateUserRegion()` in RampsController ([#7563](https://github.com/MetaMask/core/pull/7563)) - - Bump `@metamask/controller-utils` from `^11.17.0` to `^11.18.0` ([#7583](https://github.com/MetaMask/core/pull/7583)) ## [2.1.0] @@ -101,11 +94,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Add eligibility state ([#7539](https://github.com/MetaMask/core/pull/7539)) - - Add `createRequestSelector` utility function for creating memoized selectors for RampsController request states ([#7554](https://github.com/MetaMask/core/pull/7554)) - - Add request caching infrastructure with TTL, deduplication, and abort support ([#7536](https://github.com/MetaMask/core/pull/7536)) - - Add `init()` and `setUserRegion()` methods to RampsController ([#7563](https://github.com/MetaMask/core/pull/7563)) ### Changed diff --git a/packages/ramps-controller/src/RampsService.test.ts b/packages/ramps-controller/src/RampsService.test.ts index 0576aceb498..fd41321099e 100644 --- a/packages/ramps-controller/src/RampsService.test.ts +++ b/packages/ramps-controller/src/RampsService.test.ts @@ -1495,7 +1495,7 @@ describe('RampsService', () => { icon: 'card', disclaimer: "Credit card purchases may incur your bank's cash advance fees.", - delay: '5 to 10 minutes.', + delay: [5, 10], pendingOrderDescription: 'Card purchases may take a few minutes to complete.', }, @@ -1505,7 +1505,7 @@ describe('RampsService', () => { name: 'Venmo', score: 95, icon: 'bank', - delay: 'Up to 10 minutes.', + delay: [0, 10], pendingOrderDescription: 'Instant transfers may take a few minutes to complete.', }, diff --git a/packages/ramps-controller/src/RampsService.ts b/packages/ramps-controller/src/RampsService.ts index 8267d593ad2..b257708d528 100644 --- a/packages/ramps-controller/src/RampsService.ts +++ b/packages/ramps-controller/src/RampsService.ts @@ -120,9 +120,9 @@ export type PaymentMethod = { */ disclaimer?: string; /** - * Human-readable delay description (e.g., "5 to 10 minutes."). + * Delay in minutes (e.g., [5, 10]). */ - delay?: string; + delay?: number[]; /** * Localized pending order description (optional). */