PhishingController Actions
11 actions registered.
| Name | Deprecated |
|---|---|
bulkScanTokens | |
bulkScanUrls | |
bypass | |
checkAddressPoisoning | |
getApprovals | |
getState | |
isBlockedRequest | |
maybeUpdateState | |
scanAddress | |
scanUrl | |
testOrigin |
PhishingController:bulkScanTokens
Package: @metamask/phishing-controller
Scan multiple tokens for malicious activity in bulk.
Parameters:
| Name | Description |
|---|---|
request | The bulk scan request containing chainId and tokens. |
request.chainId | The chain identifier. Accepts a hex chain ID for EVM chains (e.g. '0x1' for Ethereum) or a chain name for non-EVM chains (e.g. 'solana'). |
request.tokens | Array of token addresses to scan. |
Returns: A mapping of token addresses to their scan results. For EVM chains, addresses are lowercased; for non-EVM chains, original casing is preserved. Tokens that fail to scan are omitted.
Handler signature:
(request: BulkTokenScanRequest) => Promise<BulkTokenScanResponse>
PhishingController:bulkScanUrls
Package: @metamask/phishing-controller
Scan multiple URLs for phishing in bulk. It will only scan the hostnames of the URLs. It also only supports web URLs.
Parameters:
| Name | Description |
|---|---|
urls | The URLs to scan. |
flow | Product flow used to attribute a network scan in the x-request-source header. If omitted, the header uses an unknown flow. Cached results do not make a network scan or emit a header. |
Returns: A mapping of URLs to their phishing detection scan results and errors.
Handler signature:
(urls: string[], flow?: RequestSourceFlow) => Promise<BulkPhishingDetectionScanResponse>
PhishingController:bypass
Package: @metamask/phishing-controller
Temporarily marks a given origin as approved.
Parameters:
| Name | Description |
|---|---|
origin | The origin to mark as approved. |
Handler signature:
(origin: string) => void
PhishingController:checkAddressPoisoning
Package: @metamask/phishing-controller
Finds known recipient addresses that look like an address poisoning match.
Parameters:
| Name | Description |
|---|---|
candidate | The recipient address being checked. |
Returns: Similar known recipient matches sorted by score.
Handler signature:
(candidate: string) => SimilarAddressMatch[]
PhishingController:getApprovals
Package: @metamask/phishing-controller
Handler signature:
PhishingController['getApprovals']
PhishingController:getState
Package: @metamask/phishing-controller
Handler signature:
() => PhishingControllerState
PhishingController:isBlockedRequest
Package: @metamask/phishing-controller
Checks if a request URL's domain is blocked against the request blocklist.
This method is used to determine if a specific request URL is associated with a malicious command and control (C2) domain. The URL's hostname is hashed and checked against a configured blocklist of known malicious domains.
Parameters:
| Name | Description |
|---|---|
origin | The full request URL to be checked. |
Returns: An object indicating whether the URL's domain is blocked and relevant metadata.
Handler signature:
(origin: string) => PhishingDetectorResult
PhishingController:maybeUpdateState
Package: @metamask/phishing-controller
Conditionally update the phishing configuration.
If the stalelist configuration is out of date, this function will call updateStalelist
to update the configuration. This will automatically grab the hotlist,
so it isn't necessary to continue on to download the hotlist and the c2 domain blocklist.
Handler signature:
() => Promise<void>
PhishingController:scanAddress
Package: @metamask/phishing-controller
Scan an address for security alerts.
Parameters:
| Name | Description |
|---|---|
chainId | The chain ID in hex format (e.g., '0x1' for Ethereum). |
address | The address to scan. |
Returns: The address scan result.
Handler signature:
(chainId: string, address: string) => Promise<AddressScanResult>
PhishingController:scanUrl
Package: @metamask/phishing-controller
Scan a URL for phishing. For most hosts only the hostname is sent to the API; for known
shared gateways the pathname is included (see PHISHING_DETECTION_PATH_BASED_ROOT_DOMAINS).
Only supports web URLs (http: / https:).
Parameters:
| Name | Description |
|---|---|
url | The URL to scan. |
flow | Product flow used to attribute a network scan in the x-request-source header. If omitted, the header uses an unknown flow. Cached results do not make a network scan or emit a header. |
Returns: The phishing detection scan result.
Handler signature:
(url: string, flow?: RequestSourceFlow) => Promise<PhishingDetectionScanResult>
PhishingController:testOrigin
Package: @metamask/phishing-controller
Determines if a given origin is unapproved.
It is strongly recommended that you call maybeUpdateState before calling this,
to check whether the phishing configuration is up-to-date. It will be updated if necessary
by calling updateStalelist or updateHotlist.
Parameters:
| Name | Description |
|---|---|
origin | Domain origin of a website. |
Returns: Whether the origin is an unapproved origin.
Handler signature:
(origin: string) => PhishingDetectorResult