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

### Changed

- **BREAKING:** Remove proactive bulk-fetch pattern from `ComplianceController` and `ComplianceService` ([#8365](https://github.com/MetaMask/core/pull/8365))
- `ComplianceControllerState` no longer includes `blockedWallets` or `blockedWalletsLastFetched`. Consumers storing persisted state must drop these fields on migration.
- The `init()` and `updateBlockedWallets()` controller methods have been removed. Consumers should remove any calls to these methods.
- The `blockedWalletsRefreshInterval` constructor option has been removed.
- The `updateBlockedWallets()` service method and its `GET /v1/blocked-wallets` endpoint integration have been removed.
- `ComplianceControllerInitAction`, `ComplianceControllerUpdateBlockedWalletsAction`, and `ComplianceServiceUpdateBlockedWalletsAction` types have been removed from the public API.
- The `BlockedWalletsInfo` type has been removed from the public API.
- `checkWalletCompliance` and `checkWalletsCompliance` now fall back to the per-address `walletComplianceStatusMap` cache when the API is unavailable, re-throwing only if no cached result exists for a requested address.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Is this change or the next change breaking? It seems like only the removals would be breaking.

For clarity it might be helpful to split out the removals into their own entries. There is a separate "Removed" category you can use to highlight removals.

- `selectIsWalletBlocked` now reads solely from `walletComplianceStatusMap` rather than also checking a cached full blocklist.
- Bump `@metamask/controller-utils` from `^11.19.0` to `^11.20.0` ([#8344](https://github.com/MetaMask/core/pull/8344))

## [1.0.2]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,11 @@

import type { ComplianceController } from './ComplianceController';

/**
* Initializes the controller by fetching the blocked wallets list if it
* is missing or stale. Call once after construction to ensure the blocklist
* is ready for `selectIsWalletBlocked` lookups.
*/
export type ComplianceControllerInitAction = {
type: `ComplianceController:init`;
handler: ComplianceController['init'];
};

/**
* Checks compliance status for a single wallet address via the API and
* persists the result to state.
* persists the result to state. If the API call fails and a previously
* cached result exists for the address, the cached result is returned as a
* fallback. If no cached result exists, the error is re-thrown.
*
* @param address - The wallet address to check.
* @returns The compliance status of the wallet.
Expand All @@ -29,7 +21,10 @@ export type ComplianceControllerCheckWalletComplianceAction = {

/**
* Checks compliance status for multiple wallet addresses via the API and
* persists the results to state.
* persists the results to state. If the API call fails and every requested
* address has a previously cached result, those cached results are returned
* as a fallback. If any address lacks a cached result, the error is
* re-thrown.
*
* @param addresses - The wallet addresses to check.
* @returns The compliance statuses of the wallets.
Expand All @@ -39,17 +34,6 @@ export type ComplianceControllerCheckWalletsComplianceAction = {
handler: ComplianceController['checkWalletsCompliance'];
};

/**
* Fetches the full list of blocked wallets from the API and persists the
* data to state. This also updates the `blockedWalletsLastFetched` timestamp.
*
* @returns The blocked wallets information.
*/
export type ComplianceControllerUpdateBlockedWalletsAction = {
type: `ComplianceController:updateBlockedWallets`;
handler: ComplianceController['updateBlockedWallets'];
};

/**
* Clears all compliance data from state.
*/
Expand All @@ -62,8 +46,6 @@ export type ComplianceControllerClearComplianceStateAction = {
* Union of all ComplianceController action types.
*/
export type ComplianceControllerMethodActions =
| ComplianceControllerInitAction
| ComplianceControllerCheckWalletComplianceAction
| ComplianceControllerCheckWalletsComplianceAction
| ComplianceControllerUpdateBlockedWalletsAction
| ComplianceControllerClearComplianceStateAction;
Loading
Loading