upgradeTo7702

suspend fun upgradeTo7702(chainId: String): String

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

This method orchestrates the full upgrade flow:

  1. Validates the chain namespace is "eip155"

  2. Verifies the account is currently an EIP_155_EOA

  3. Builds the authorization list and obtains the hash

  4. Signs the hash using Portal's rawSign

  5. Submits the signed authorization (subsidized) to build the transaction

  6. Returns the on-chain transaction hash

Return

The transaction hash as a String.

Parameters

chainId

CAIP-2 chain identifier (e.g. "eip155:11155111").

Throws

if the account is not EIP_155_EOA.

if the portal reference is null.

if rawSign returns a non-String result.