Skip to main content

Upgrade Universal Account

Overview

Upgrades the UEA (Universal Executor Account) to the latest required implementation version. This is a gasless, signature-based operation and is done automatically via the SDK without requiring gas.

You only need to call this when getAccountStatus() reports uea.requiresUpgrade === true. Sending universal transactions on an outdated UEA will fail.

Note: upgradeAccount() is a no-op if the UEA is already at or above the minimum required version.

Upgrade Universal Account

pushChainClient.upgradeAccount({options?}): Promise<void>

await pushChainClient.upgradeAccount({
progressHook: (progress) => {
console.log(`${progress.id}: ${progress.message}`);
},
});

TheseArgumentsare mandatory

ArgumentsTypeDefaultDescription
options.progressHook(event: ProgressEvent) => voidundefinedCallback invoked at each upgrade step showing progress.

Progress Hook Type and Response

ProgressHook Type and Response
FieldTypeDescription
progressObjectThe progress of the upgrade operation.
progress.idstringUnique identifier for the progress event.
progress.titlestringBrief title of the progress event.
progress.messagestringDetailed message describing the event.
progress.levelINFO | SUCCESS | ERRORSeverity level of the event.
progress.timestampstringISO-8601 timestamp when the event occurred.
IDTitleMessageLevel
UEA-MIG-01Checking StatusFetching current UEA version and upgrade requirementINFO
UEA-MIG-02Awaiting SignatureAwaiting user signature for migration payload (EIP-712)INFO
UEA-MIG-03BroadcastingSubmitting migration transaction to Push ChainINFO
UEA-MIG-9901Upgrade CompleteUEA successfully upgraded to version <new version>SUCCESS
UEA-MIG-9902Upgrade Failed<error message>ERROR
UEA-MIG-9903No Upgrade NeededUEA is already at the required version; operation skippedINFO

Always check getAccountStatus() before calling upgradeAccount() to avoid unnecessary prompts:

const status = await pushChainClient.getAccountStatus();

if (status.uea.requiresUpgrade) {
await pushChainClient.upgradeAccount({
progressHook: (progress) => {
console.log(`${progress.id}: ${progress.message}`);
},
});
}

Live Playground

VIRTUAL NODE IDE
Copy playground link
Copy code

Next Steps