EvmAccountType

EVM Account Type business logic provider.

Orchestrates the EIP-7702 upgrade flow:

  1. Validates the chain namespace is "eip155"

  2. Checks the account is currently an EIP_155_EOA

  3. Builds the authorization list (obtains the hash)

  4. Signs the hash via Portal's rawSign

  5. Builds the authorization transaction with the signature (subsidized)

  6. Returns the transaction hash

Usage Example

val txHash = portal.evmAccountType.upgradeTo7702("eip155:11155111")
println("Upgrade tx: $txHash")

Parameters

api

The API layer for EVM account type endpoints.

Constructors

Link copied to clipboard
constructor(api: EvmAccountTypeApi)

Properties

Link copied to clipboard

The portal dependency, or null if not yet set.

Functions

Link copied to clipboard

Gets the EOA and smart contract addresses for the given chain.

Link copied to clipboard
suspend fun getStatus(chainId: String): EvmAccountTypeResponse

Gets the account type status for the given chain.

Link copied to clipboard

Sets the portal dependency.

Link copied to clipboard
suspend fun upgradeTo7702(chainId: String): String

Upgrades an EIP-155 EOA account to EIP-7702.