Skip to main content
Portal’s React Native 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)

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.
async function scanEipTransaction(portal: Portal) {
  const response = await portal.security.hypernative.scanEVMTx({
    transaction: {
      fromAddress: '0x7C01728004d3F2370C1BBC36a4Ad680fE6FE8729',
      toAddress: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
      chain: 'eip155:1',
      input: '0x095ea7b3...',
      value: 0,
      nonce: 2340,
      gas: 3000000,
      gasPrice: 3000000,
    },
  })

  console.log('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.
async function scanTypedMessage(portal: Portal) {
  const response = await portal.security.hypernative.scanEip712Tx({
    walletAddress: '0x7b1363f33b86d16ef7c8d03d11f4394a37d95c36',
    chainId: 'eip155:1',
    eip712Message: {
      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,
      },
    },
  })

  console.log('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.
async function scanSolanaTransaction(portal: Portal) {
  const response = await portal.security.hypernative.scanSolanaTx({
    showFullFindings: true,
    transaction: {
        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' as const,
    },
  })

  console.log('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.
async function scanAddresses(portal: Portal) {
  const response = await portal.security.hypernative.scanAddresses({
    addresses: [
      '0x31c05d73f2333b5a176cfdbb7c5ef96ec7bb04ac',
      '0x2753a0d37a2ad09be3ccc0afcb650bea8ea57a8f',
    ],
  })

  console.log('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.
async function scanNfts(portal: Portal) {
  const response = await portal.security.hypernative.scanNfts({
    nfts: [
      {
        address: '0x5C1B9caA8492585182eD994633e76d744A876548',
        evmChainId: 'eip155:1',
      },
      {
        address: '0xC2e0cA5FE0b9AbE1B86f3cC0b865448908D20A16',
        evmChainId: 'eip155:1',
      },
    ],
  })

  console.log('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.
async function scanTokens(portal: Portal) {
  const response = await portal.security.hypernative.scanTokens({
    tokens: [
      {
        address: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
        evmChainId: 'eip155:1',
      },
    ],
  })

  console.log('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.
async function scanURL(portal: Portal, url: string) {
  const response = await portal.security.hypernative.scanURL({
    url,
  })

  console.log('Hypernative URL scan response:', response)
}

Next Steps