Skip to content

WalletActions.upgradeAccount

Viem Action for upgrading an Externally-Owned Account (EOA) into a Porto Account. Uses wallet_upgradeAccount under the hood.

Usage

example.ts
import { privateKeyToAccount } from 'viem/accounts'
import { WalletActions } from 'porto/viem'
import { client } from './config'
 
const eoa = privateKeyToAccount('0x...')
 
const result = await WalletActions.upgradeAccount(client, { 
  account: eoa, 
})