diff --git a/packages/frontend/src/components/wallet-migration/WalletMigration.jsx b/packages/frontend/src/components/wallet-migration/WalletMigration.jsx index b566cfa56c..3db1089886 100644 --- a/packages/frontend/src/components/wallet-migration/WalletMigration.jsx +++ b/packages/frontend/src/components/wallet-migration/WalletMigration.jsx @@ -95,7 +95,6 @@ const WalletMigration = ({ open, onClose }) => { }; const navigateToMigrateAccounts = () => { - setMigrationStep(WALLET_MIGRATION_VIEWS.MIGRATE_ACCOUNTS); handleSetActiveView(WALLET_MIGRATION_VIEWS.MIGRATE_ACCOUNTS); }; @@ -173,6 +172,7 @@ const WalletMigration = ({ open, onClose }) => { onComplete={navigateToRedirect} migrationAccounts={accountWithDetails} network={NETWORK_ID === 'default' ? 'testnet': NETWORK_ID} + rotatedKeys={rotatedKeys} /> )} {state.activeView === WALLET_MIGRATION_VIEWS.REDIRECTING && ( diff --git a/packages/frontend/src/components/wallet-migration/modals/WalletSelectorModal/WalletSelectorModal.jsx b/packages/frontend/src/components/wallet-migration/modals/WalletSelectorModal/WalletSelectorModal.jsx index 7c7e962046..f5781bfede 100644 --- a/packages/frontend/src/components/wallet-migration/modals/WalletSelectorModal/WalletSelectorModal.jsx +++ b/packages/frontend/src/components/wallet-migration/modals/WalletSelectorModal/WalletSelectorModal.jsx @@ -1,18 +1,22 @@ import React, { useEffect, useState } from 'react'; -import { wallet } from '../../../../utils/wallet'; import { WalletSelectorContent } from './WalletSelectorContent'; import { ExportAccountSelectorContextProvider } from './WalletSelectorExportContext'; -export const WalletSelectorModal = ({ onComplete, migrationAccounts, network }) => { +export const WalletSelectorModal = ({ onComplete, migrationAccounts, network, rotatedKeys }) => { const [accounts, setAccounts] = useState([]); useEffect(() => { const init = async () => { const accountsWithKey = await Promise.all(migrationAccounts.map(async (account) => { - const localKey = await wallet.getLocalSecretKey(account.accountId); + const accountId = account.accountId; + const privateKey = rotatedKeys[accountId]; + if (!privateKey) { + throw new Error('Unable to find a private key from the rotated keys'); + } + return { - accountId: account.accountId, - privateKey: localKey, + accountId, + privateKey, }; })); setAccounts(accountsWithKey);