> ## 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.

# Upgrading to EIP-7702

> Learn how to check wallet account type and upgrade EOA wallets to EIP-7702 using Portal's React Native SDK.

Portal's React Native SDK provides EVM Account Type management through the `portal.evmAccountType` API. This enables checking wallet account types, retrieving wallet addresses, and upgrading EOA wallets to EIP-7702 on supported EVM chains.

## Overview

The EVM Account Type functionality allows you to:

* **Check wallet status** to determine the current account type
* **Get wallet addresses** to retrieve EOA and smart contract addresses
* **Upgrade to EIP-7702** to enable ejecting the Portal wallet's EOA private key

## Account Type Constants

The SDK provides the `WalletAccountType` enum for type-safe account type comparisons:

```typescript theme={null}
import { WalletAccountType } from '@portal-hq/core'

// Available account types:
WalletAccountType.EIP_155_EOA        // Standard Ethereum EOA
WalletAccountType.EIP_7702_EOA       // EIP-7702 upgraded EOA
WalletAccountType.SMART_CONTRACT     // Smart contract wallet
```

## Prerequisites

Before using EVM Account Type operations, ensure you have:

* A properly initialized Portal client
* An active wallet on a supported network (see [Create a wallet](./create-a-wallet))
* Understanding of [EVM Account Type concepts](/resources/evmAccountType)
* You fund the [Upgrade Sponsor address with native tokens for the target chain in the Portal Dashboard](https://app.portalhq.io/upgrade-sponsorship)

## Checking Wallet Status

Use `getStatus` to check the current account type of your wallet. The response includes both the account status and metadata about the wallet addresses.

```typescript theme={null}
import { WalletAccountType } from '@portal-hq/core'

const handleGetStatus = async () => {
  try {
    const { data, metadata } = await portal.evmAccountType.getStatus({
      chain: 'eip155:10143', // Monad Testnet
    })

    // Use the WalletAccountType enum for type-safe comparisons
    if (data.status === WalletAccountType.EIP_155_EOA) {
      console.log('✅ Can upgrade to EIP-7702')
    } else if (data.status === WalletAccountType.EIP_7702_EOA) {
      console.log('ℹ️ Already upgraded')
    } else if (data.status === WalletAccountType.SMART_CONTRACT) {
      console.log('❌ Cannot upgrade - Smart contract wallet')
    }
  } catch (e) {
    console.error('Failed to get account status', e)
  }
}
```

**Response (`GetStatusResponse`):**

* `data.status`: One of `EIP_155_EOA`, `SMART_CONTRACT`, or `EIP_7702_EOA`
* `metadata.eoaAddress`: The EOA address associated with the wallet
* `metadata.smartContractAddress`: Your smart contract wallet address (optional, may be `null`/`undefined` for EOA-only accounts)
* `metadata.chainId`: The chain identifier

***

## Getting Wallet Addresses

Use `getAddresses` to retrieve the EOA and smart contract addresses for your wallet on a specific chain. This method is useful when you only need the addresses without the full status information.

```typescript theme={null}
const handleGetAddresses = async () => {
  try {
    const addresses = await portal.evmAccountType.getAddresses({
      chain: 'eip155:10143', // Monad Testnet
    })
    
    console.log('EOA Address:', addresses.eoaAddress)
    console.log('Smart Contract Address:', addresses.smartContractAddress)
  } catch (e) {
    console.error('Failed to get addresses', e)
  }
}
```

**Response (`GetAddressesResponse`):**

* `eoaAddress`: The EOA address associated with the wallet
* `smartContractAddress`: Your smart contract wallet address (optional; may be `null` or `undefined` for EOA-only accounts)

***

## Upgrading to EIP-7702

Use `upgradeTo7702` to upgrade an EOA wallet to EIP-7702. This method automatically handles the entire upgrade process, including gas subsidization, and returns the transaction hash directly.

```typescript theme={null}
import { WalletAccountType } from '@portal-hq/core'

const handleUpgradeTo7702 = async () => {
  try {
    const { txHash } = await portal.evmAccountType.upgradeTo7702({
      chain: 'eip155:10143', // Monad Testnet
    })
    console.log('Upgrade submitted! TX hash:', txHash)

    // Verify the upgrade was successful
    const status = await portal.evmAccountType.getStatus({ 
      chain: 'eip155:10143' 
    })
    console.log('Final Status:', status.data.status)

    if (status.data.status === WalletAccountType.EIP_7702_EOA) {
      console.log('✅ Successfully upgraded to EIP-7702!')
    }
  } catch (e) {
    console.error('Upgrade failed', e)
  }
}

```

**What happens during the upgrade:**

1. **Chain validation**: Verifies the chain uses the `eip155` namespace
2. **Status check**: Confirms the wallet is currently an `EIP_155_EOA`
3. **Authorization building**: Creates the EIP-7702 authorization list
4. **Signature**: Signs the authorization hash with your wallet
5. **Transaction submission**: Submits the subsidized upgrade transaction (gas is paid by Portal)
6. **Transaction hash**: Returns the on-chain transaction hash

**Response:**

The method returns a `string` containing the transaction hash of the submitted upgrade transaction.

***

<Warning>
  The upgrade process is irreversible per wallet. Once upgraded to EIP-7702, the wallet cannot be reverted to a standard EOA on that chain.
</Warning>

***

## Supported Networks

EVM Account Type upgrades are currently available on:

* **Monad Testnet** (`eip155:10143`)

For a complete list of supported chains, reach out to the Portal team.

***

## Next Steps

* Learn about [signing transactions](./sign-a-transaction)
* Explore [Portal API methods](./portal-api-methods)
* Review [EVM Account Type concepts](/resources/evmAccountType)
* Check out [wallet lifecycle management](./manage-wallet-lifecycle-states)
