Portal’s Web SDK integrates with Blockaid to provide real-time security scanning for transactions, addresses, tokens, and URLs. This integration helps detect malicious activity, phishing attempts, scam tokens, and suspicious interactions before users sign or submit transactions.
Overview
The Blockaid integration enables you to:
- Scan transactions before signing or submission (EVM, Solana, Tron)
- Scan addresses for known malicious actors or compromised contracts
- Validate tokens to detect scams or security risks
- Verify URLs to prevent phishing attacks
Prerequisites
Before using Blockaid security scanning, ensure you have:
- A properly initialized Portal client
- Blockaid integration enabled in your Portal Dashboard (see Blockaid Integration)
Scanning EVM Transactions
Use scanEVMTx to analyze Ethereum transactions before signing or broadcasting them. This method scans EVM transactions for malicious contract interactions, risky approvals, phishing attempts, and other on-chain security threats.
Scanning Solana Transactions
Use scanSolanaTx to analyze Solana transactions before signing. This method detects malicious program invocations, suspicious token movements, and other Solana-specific risks.
Scanning Tron Transactions
Use scanTronTx to analyze Tron transactions before signing. This method detects malicious smart contract interactions, suspicious token movements, and other Tron-specific security risks.
scanTronTx only supports tron:mainnet. Passing any other chain identifier, such as tron:shasta or tron:nile, throws an error before any request is sent to Blockaid.
The request object accepts the following fields:
Reading the response
Like scanEVMTx, the scanTronTx result is nested under data.rawResponse:
data.rawResponse can include:
Error handling
- Passing a
chain other than tron:mainnet rejects immediately with an error and does not send a request to Blockaid.
- Requests with an invalid or incomplete payload, or failures from the Blockaid API itself, reject with the error returned by Blockaid.
Scanning Addresses
Use scanAddress to analyze a single address for known security risks. This method can be used for both EVM and Solana addresses and detects malicious contracts, compromised wallets, sanctioned addresses, and other flagged entities.
EVM Address Scan
Solana Address Scan
Scanning Tokens
Use scanTokens to analyze multiple tokens in a single request for known security risks. This method detects scam tokens, honeypots, compromised contracts, and other malicious token behavior.
Scanning URLs
Use scanURL to detect phishing sites and malicious domains before users navigate to them. This method helps protect users from social engineering attacks and malicious off-chain activity.
Next Steps