> ## Documentation Index
> Fetch the complete documentation index at: https://docs.portalhq.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Enhance your wallets' security with Hypernative

> Learn how to integrate real-time security scanning for transactions, addresses, tokens, NFTs, and URLs using Portal's Flutter SDK with Hypernative.

Portal's Flutter SDK provides comprehensive security scanning capabilities through the `portal.security.hypernative` API. This integration allows you to detect malicious transactions, flagged addresses, compromised tokens, and suspicious URLs before users interact with them.

## Overview

The Hypernative integration enables you to:

* **Scan transactions** before signing or submission (EVM, EIP-712, Solana)
* **Scan addresses** for known malicious actors or compromised contracts
* **Validate tokens** to detect scams, honeypots, or security risks
* **Check NFTs** for fraudulent collections or suspicious activity
* **Verify URLs** to prevent phishing attacks

## Prerequisites

Before using Hypernative security scanning, ensure you have:

* A properly initialized Portal client
* Hypernative integration enabled in your Portal Dashboard (see [Hypernative Integration](../../../integrations/Security/hypernative))

## Scanning EVM Transactions

Use `scanEvmTx` to analyze standard Ethereum transactions before signing or sending. This method scans EVM transactions for malicious contract interactions, suspicious token approvals, and other security risks.

```dart theme={null}
import 'package:portal_flutter/portal_flutter.dart';

final portal = Portal();

Future<void> scanEvmTransaction() async {
  final response = await portal.security.hypernative.scanEvmTx(
    chain: 'eip155:1',
    fromAddress: '0x7C01728004d3F2370C1BBC36a4Ad680fE6FE8729',
    toAddress: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
    input:
        '0x095ea7b300000000000000000000000066ba61be3bab35c0c00038f335850a390b086fe300000000000000000000000000000000000000000fffffffffffffffffffffff',
    value: '0',
    nonce: '2340',
    gas: '3000000',
    gasPrice: '3000000',
  );

  print('Hypernative EVM scan response: $response');
}
```

***

## Scanning EIP-712 Typed Messages

Use `scanEip712Tx` to analyze typed structured data before signing. This method is critical for detecting malicious permit signatures, phishing attempts, and unauthorized token approvals.

EIP-712 defines a standard for hashing and signing typed structured data, commonly used for gasless approvals and off-chain signatures. The Flutter SDK accepts the EIP-712 message as a JSON-encoded string.

```dart theme={null}
import 'dart:convert';
import 'package:portal_flutter/portal_flutter.dart';

Future<void> scanTypedMessage() async {
  final eip712Message = jsonEncode({
    'primaryType': 'Permit',
    'types': {
      'EIP712Domain': [
        {'name': 'name', 'type': 'string'},
        {'name': 'version', 'type': 'string'},
        {'name': 'chainId', 'type': 'uint256'},
        {'name': 'verifyingContract', 'type': 'address'},
      ],
      'Permit': [
        {'name': 'owner', 'type': 'address'},
        {'name': 'spender', 'type': 'address'},
        {'name': 'value', 'type': 'uint256'},
        {'name': 'nonce', 'type': 'uint256'},
        {'name': 'deadline', 'type': 'uint256'},
      ],
    },
    'domain': {
      'chainId': 'eip155:1',
      'name': 'MyToken',
      'version': '1',
      'verifyingContract': '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
    },
    'message': {
      'owner': '0x7b1363f33b86d16ef7c8d03d11f4394a37d95c36',
      'spender': '0x67beb4dd770a9c2cbc7133ba428b9eecdcf09186',
      'value': 3000,
      'nonce': 0,
      'deadline': 50000000000,
    },
  });

  final response = await portal.security.hypernative.scanEip712Tx(
    walletAddress: '0x7b1363f33b86d16ef7c8d03d11f4394a37d95c36',
    chainId: 'eip155:1',
    eip712MessageJson: eip712Message,
  );

  print('Hypernative EIP-712 scan response: $response');
}
```

***

## Scanning Solana Transactions

Use `scanSolanaTx` to analyze Solana transactions before signing. This method detects malicious program invocations, suspicious token transfers, and other Solana-specific security risks.

The Flutter SDK accepts the Solana transaction as a JSON-encoded string.

```dart theme={null}
import 'dart:convert';

Future<void> scanSolanaTransaction() async {
  final transactionJson = jsonEncode({
    'rawTransaction':
        'AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQADCQkVR3SiiKbW0l4c3NBsEn6+zn1o0YsyypPwN0GUhg4K5HK0Tb5GckDLYW+MsovQASt5EZ3bSH3nluRJAE69H61w0BRUDTrpYQcXosUun6/z2BROkRoH/1bL7KLU9s4lCav6k3ZZgV6qeZFwu4pu89WoIGaqUxG4C93XwVmmDy81v8qBaCSP4/UZfdo3q1bud/W+ixymkH8IMe0laQZYrSx4Uhyxec67hYm1VqLV7JTSSYaC/fm7KvWtZOSRzEFT2gMGRm/lIRcy/+ytunLDm+e8jOW7xfcSayxDmzpAAAAAT4tlY/P4mFG1wDJl0ektVggHiZf73lTlHBVJ3fK0nDoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANG5fPtlMEOI/eXV7aPDlpcdLUKm8L3VoW6k/oJlCNLaBQYABQLARQQABgAJAwYAAAAAAAAABzwACQoLCwgyMzQMNQ0ONjcPEDg5EgETFBUWOhEXGBkaGxwdHh8gISI7IyQlJicCKCkqKywtAwQuLzAxPBFVCg8JAQcHBgYBAAAAAwHwCgYBExUbBgICAAAPAwIAAAYBISMoEQQBGQAPAwIAAAYBLjA2DwMCAAAGAgIAAAAIBgYICAADAQkGCQUFBgACBQAEBwEAAAgCAAUMAgAAADwaAAAAAAAABgAFBGDMBQAEPPm21Wu6wrmHu23/ZFNIumpp+ADooZjd4JQgvjnBxkUJAgEDBqWqCgmmCAUIBwu1tp+gcP/+Ri3C1tRXUbPdgqo6rVsj/qnqC959wTdC/mRARysLz9HS09TW19jZ2tsC1QYsNrdxMcm5Nq5FXZrM0IXpEA+ApFa+pz/JvkLz0+2vnwuztLW2t7i5uru8vgAPvBv8VUeRwDy9yD1NHIH5Ji6ZA+zrmpHejKOz4MP8SwrKy8zNzs/S09TVAdY=',
    'version': '0',
  });

  final response = await portal.security.hypernative.scanSolanaTx(
    transactionJson: transactionJson,
    showFullFindings: true,
  );

  print('Hypernative Solana scan response: $response');
}
```

***

## Scanning Addresses

Use `scanAddresses` to check multiple addresses for known security risks. This method identifies malicious contracts, compromised wallets, sanctioned addresses, and other flagged entities.

```dart theme={null}
Future<void> scanAddresses() async {
  final response = await portal.security.hypernative.scanAddresses(
    addresses: const [
      '0x31c05d73f2333b5a176cfdbb7c5ef96ec7bb04ac',
      '0x2753a0d37a2ad09be3ccc0afcb650bea8ea57a8f',
    ],
  );

  print('Hypernative address scan response: $response');
}
```

***

## Scanning NFTs

Use `scanNfts` to validate NFT collections before displaying or allowing interactions. This method detects fraudulent collections, compromised contracts, and suspicious NFT activity.

```dart theme={null}
Future<void> scanNfts() async {
  final response = await portal.security.hypernative.scanNfts(
    nfts: [
      HypernativeScanNftItem(
        address: '0x5C1B9caA8492585182eD994633e76d744A876548',
        evmChainId: 'eip155:1',
      ),
      HypernativeScanNftItem(
        address: '0xC2e0cA5FE0b9AbE1B86f3cC0b865448908D20A16',
        evmChainId: 'eip155:1',
      ),
    ],
  );

  print('Hypernative NFT scan response: $response');
}
```

***

## Scanning Tokens

Use `scanTokens` to validate ERC-20 tokens before allowing swaps, transfers, or approvals. This method detects honeypots, scam tokens, and compromised token contracts.

```dart theme={null}
Future<void> scanTokens() async {
  final response = await portal.security.hypernative.scanTokens(
    tokens: [
      HypernativeScanTokenItem(
        address: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
        evmChainId: 'eip155:1',
      ),
    ],
  );

  print('Hypernative token scan response: $response');
}
```

***

## Scanning URLs

Use `scanUrl` to detect phishing sites and malicious domains before users navigate to them. This method is critical for protecting users from social engineering attacks.

```dart theme={null}
Future<void> scanUrl() async {
  final response = await portal.security.hypernative.scanUrl(
    url: 'https://vote-ondo.app',
  );

  print('Hypernative URL scan response: $response');
}
```

***

## Next Steps

* Learn about [signing transactions](./sign-a-transaction)
* Explore [transaction evaluation](./evaluate-a-transaction)
* Check out the [Hypernative Integration setup](../../../integrations/Security/hypernative)
