diff --git a/packages/background/package.json b/packages/background/package.json index 437669873..6154dd09a 100644 --- a/packages/background/package.json +++ b/packages/background/package.json @@ -1,9 +1,9 @@ { "name": "@block-wallet/background", - "version": "1.1.24", + "version": "1.1.25", "private": true, "dependencies": { - "@block-wallet/chains-assets": "https://github.com/block-wallet/chains-assets#v0.0.63", + "@block-wallet/chains-assets": "https://github.com/block-wallet/chains-assets#v0.0.65", "@block-wallet/eth-ledger-bridge-keyring": "https://github.com/block-wallet/eth-ledger-bridge-keyring#v0.14.1", "@block-wallet/eth-trezor-keyring": "https://github.com/block-wallet/eth-trezor-keyring#v1.0.1", "@block-wallet/explorer-link": "https://github.com/block-wallet/explorer-link#v2.2.2", diff --git a/packages/background/src/infrastructure/stores/migrator/migrations/index.ts b/packages/background/src/infrastructure/stores/migrator/migrations/index.ts index 0bd2d9537..dfd25b44b 100644 --- a/packages/background/src/infrastructure/stores/migrator/migrations/index.ts +++ b/packages/background/src/infrastructure/stores/migrator/migrations/index.ts @@ -73,6 +73,7 @@ import migration71 from './migration-71'; import migration72 from './migration-72'; import migration73 from './migration-73'; import migration74 from './migration-74'; +import migration75 from './migration-75'; const migrations: IMigration[] = [ migration01, @@ -149,6 +150,7 @@ const migrations: IMigration[] = [ migration72, migration73, migration74, + migration75, ]; export default (): IMigration[] => migrations; diff --git a/packages/background/src/infrastructure/stores/migrator/migrations/migration-75.ts b/packages/background/src/infrastructure/stores/migrator/migrations/migration-75.ts new file mode 100644 index 000000000..1fe48ccd4 --- /dev/null +++ b/packages/background/src/infrastructure/stores/migrator/migrations/migration-75.ts @@ -0,0 +1,32 @@ +import { BlankAppState } from '../../../../utils/constants/initialState'; +import { IMigration } from '../IMigration'; + +/** + * This migration updates the currency icon for morph + */ +export default { + migrate: async (persistedState: BlankAppState) => { + const { availableNetworks } = persistedState.NetworkController; + const updatedNetworks = { ...availableNetworks }; + + const key = `CHAIN-2810`; + if (key in availableNetworks) { + updatedNetworks[key] = { + ...updatedNetworks[key], + nativeCurrency: { + ...updatedNetworks[key].nativeCurrency, + logo: 'https://raw.githubusercontent.com/block-wallet/assets/master/blockchains/ethereum/info/logo.png', + }, + }; + } + + return { + ...persistedState, + NetworkController: { + ...persistedState.NetworkController, + availableNetworks: { ...updatedNetworks }, + }, + }; + }, + version: '1.1.25', +} as IMigration; diff --git a/packages/background/yarn.lock b/packages/background/yarn.lock index 61c519105..e0a9968e4 100644 --- a/packages/background/yarn.lock +++ b/packages/background/yarn.lock @@ -199,9 +199,9 @@ "@babel/helper-validator-identifier" "^7.22.20" to-fast-properties "^2.0.0" -"@block-wallet/chains-assets@https://github.com/block-wallet/chains-assets#v0.0.63": - version "0.0.63" - resolved "https://github.com/block-wallet/chains-assets#1322b3706cc0fbf434a61f55ab63823bff800452" +"@block-wallet/chains-assets@https://github.com/block-wallet/chains-assets#v0.0.65": + version "0.0.65" + resolved "https://github.com/block-wallet/chains-assets#e5cd2b2e82fe44bdaa20cd9e84adbeae4623d2af" "@block-wallet/eth-ledger-bridge-keyring@https://github.com/block-wallet/eth-ledger-bridge-keyring#v0.14.1": version "0.14.0"