Skip to main content

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.

Portal’s Android SDK provides EVM Account Type management through the portal.evmAccountType API. This enables checking wallet account types 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 the EOA address and (if applicable) the smart contract address
  • Upgrade to EIP-7702 to enable ejecting the Portal wallet’s EOA private key

Prerequisites

Before using EVM Account Type operations, ensure you have:

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.
lifecycleScope.launch {
    try {
        val chainId = "eip155:10143" // Monad Testnet

        val status = portal.evmAccountType.getStatus(chainId)

        println("Status: ${status.data.status}")
        println("EOA Address: ${status.metadata.eoaAddress}")

        status.metadata.smartContractAddress?.let {
            println("Smart Contract Address: $it")
        }

        if (status.data.status == "EIP_155_EOA") {
            println("Can upgrade to EIP-7702")
        } else if (status.data.status == "EIP_7702_EOA") {
            println("Already upgraded")
        } else {
            println("Cannot upgrade")
        }
    } catch (e: Exception) {
        println("Failed to get account status: ${e.message}")
    }
}
Response (EvmAccountTypeResponse):
  • 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 (nullable, may be null 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 given chain. This is a convenience method that returns the EOA and optional smart contract address, equivalent to the address metadata returned by getStatus.
lifecycleScope.launch {
    try {
        val chainId = "eip155:10143" // Monad Testnet

        val addresses = portal.evmAccountType.getAddresses(chainId)

        println("EOA Address: ${addresses.eoaAddress}")

        addresses.smartContractAddress?.let {
            println("Smart Contract Address: $it")
        }
    } catch (e: Exception) {
        println("Failed to get addresses: ${e.message}")
    }
}
Parameters:
  • chainId (String): A CAIP-2 chain identifier (e.g., "eip155:10143")
Response (EvmAccountTypeAddresses):
  • eoaAddress (String): The EOA address associated with the wallet
  • smartContractAddress (String?): The smart contract wallet address (nullable, null 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.
lifecycleScope.launch {
    try {
        val chainId = "eip155:10143" // Monad Testnet

        // Upgrade to EIP-7702
        val txHash = portal.evmAccountType.upgradeTo7702(chainId)
        println("Upgrade done! TX: $txHash")

        // Verify final status
        val statusAfter = portal.evmAccountType.getStatus(chainId)
        println("Final Status: ${statusAfter.data.status}")

        if (statusAfter.data.status == "EIP_7702_EOA") {
            println("Successfully upgraded to EIP-7702!")
        }
    } catch (e: Exception) {
        println("Upgrade failed: ${e.message}")
    }
}
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.
The upgrade process is irreversible per wallet. Once upgraded to EIP-7702, the wallet cannot be reverted to a standard EOA on that chain.

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