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.responseobject | nullAdditional data object for the event, or null if not applicable.
progress.timestampstringISO-8601 timestamp when the event occurred.
IDTitleMessageLevelResponse
UEA-MIG-01Checking UEAChecking status for migration.INFOnull
UEA-MIG-02Awaiting Migration SignatureAwaiting wallet signature for upgrading account.INFOnull
UEA-MIG-03Broadcasting Migration TXBroadcasting upgrade transaction to Push Chain...INFOnull
UEA-MIG-9901UEA Migration SuccessfulUEA migration is successful. UEA is now version <newVersion>.SUCCESS{ version }
UEA-MIG-9902UEA Migration FailedUEA migration failed. Check transaction on explorer.ERROR{ error }
UEA-MIG-9903UEA Migration SkippedUEA migration skipped.INFOnull

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