Function Signature
Description
Evaluates a transaction for security risks using Blockaid. This helps identify malicious contracts, phishing attempts, and other security threats before sending a transaction.Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
chainId | String | Yes | The chain ID in CAIP-2 format |
to | String | Yes | The recipient/contract address |
from | String | No | The sender address |
value | String | No | Value in wei (hex string) |
data | String | No | Transaction data (hex string) |
gas | String | No | Gas limit (hex string) |
maxFeePerGas | String | No | Max fee per gas (hex string) |
maxPriorityFeePerGas | String | No | Max priority fee (hex string) |
operationType | PortalEvaluateTransactionOperationType | No | Type of evaluation to perform |
PortalEvaluateTransactionOperationType
| Value | Description |
|---|---|
validation | Only validate the transaction |
simulation | Only simulate the transaction |
all | Perform both validation and simulation |
Returns
PortalEvaluateTransactionResult - An object containing:
| Property | Type | Description |
|---|---|---|
result | String? | The overall assessment (e.g., Benign, Warning, Malicious) |
reason | String? | The reason for the assessment |
classification | String? | The classification category of the risk |
description | String? | A human-readable description of the findings |
status | String? | The status of the evaluation |
Example
Errors
| Code | Description |
|---|---|
NOT_INITIALIZED | Portal was not initialized |
EVALUATION_FAILED | The evaluation operation failed |