diff --git a/packages/suite/src/storage/index.ts b/packages/suite/src/storage/index.ts index 8db8d304aa02..ffb721a2109e 100644 --- a/packages/suite/src/storage/index.ts +++ b/packages/suite/src/storage/index.ts @@ -5,7 +5,7 @@ import { reloadApp } from 'src/utils/suite/reload'; import { migrate } from './migrations'; import type { SuiteDBSchema } from './definitions'; -const VERSION = 51; // don't forget to add migration and CHANGELOG when changing versions! +const VERSION = 52; // don't forget to add migration and CHANGELOG when changing versions! /** * If the object stores don't already exist then creates them. diff --git a/packages/suite/src/storage/migrations/index.ts b/packages/suite/src/storage/migrations/index.ts index c9e1fe4c6446..0aa83e7dda21 100644 --- a/packages/suite/src/storage/migrations/index.ts +++ b/packages/suite/src/storage/migrations/index.ts @@ -1176,4 +1176,24 @@ export const migrate: OnUpgradeFunc = async ( return account; }); } + + if (oldVersion < 52) { + await updateAll(transaction, 'accounts', account => { + if ( + account.networkType === 'ethereum' || + account.networkType === 'cardano' || + account.networkType === 'solana' || + account.networkType === 'ripple' + ) { + account.tokens?.forEach(token => { + token.standard = token.type || ''; + delete token.type; + }); + + return account; + } + + return account; + }); + } };