From bb2c3c8428fd813635da3fb5b0a4e0c3650bb869 Mon Sep 17 00:00:00 2001 From: Armani Ferrante Date: Wed, 7 Jul 2021 22:37:25 -0700 Subject: [PATCH] Add warning for aux accounts (#333) --- src/components/BalancesList.js | 2 +- src/components/DepositDialog.js | 2 ++ src/components/MergeAccountsDialog.js | 28 +++++++++++++-------------- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/components/BalancesList.js b/src/components/BalancesList.js index 6574f76..1e17050 100644 --- a/src/components/BalancesList.js +++ b/src/components/BalancesList.js @@ -232,7 +232,7 @@ export default function BalancesList() { - + setShowMergeAccounts(true)} diff --git a/src/components/DepositDialog.js b/src/components/DepositDialog.js index 08ae1db..5c814ea 100644 --- a/src/components/DepositDialog.js +++ b/src/components/DepositDialog.js @@ -96,6 +96,8 @@ export default function DepositDialog({ This address can only be used to receive{' '} {tokenSymbol ?? abbreviateAddress(mint)}. Do not send SOL to this address. +
+ WARNING: You are using a deprecated account type. Please migrate your tokens. Ideally, create a new wallet. If you send to this address from a poorly implemented wallet, you may burn tokens. ) : ( diff --git a/src/components/MergeAccountsDialog.js b/src/components/MergeAccountsDialog.js index 7c8cacf..dae9c89 100644 --- a/src/components/MergeAccountsDialog.js +++ b/src/components/MergeAccountsDialog.js @@ -47,7 +47,7 @@ export default function MergeAccountsDialog({ open, onClose }) { const mergeAccounts = async (retryCount = 30) => { try { if (retryCount === 0) { - enqueueSnackbar(`Unable to complete merge. Please try again.`, { + enqueueSnackbar(`Unable to complete migration. Please try again.`, { variant: 'error', }); return; @@ -107,8 +107,8 @@ export default function MergeAccountsDialog({ open, onClose }) { const symbol = tokenInfo.symbol ? tokenInfo.symbol : mint.toString(); - console.log(`Merging ${symbol}`); - enqueueSnackbar(`Merging ${symbol}`, { + console.log(`Migrating ${symbol}`); + enqueueSnackbar(`Migrating ${symbol}`, { variant: 'info', }); await mergeMint( @@ -133,7 +133,7 @@ export default function MergeAccountsDialog({ open, onClose }) { // Exit dialogue. close(); } catch (err) { - console.error('There was a problem merging accounts', err); + console.error('There was a problem migrating accounts', err); enqueueSnackbar('Could not confirm transaction. Please wait.', { variant: 'info', }); @@ -141,7 +141,7 @@ export default function MergeAccountsDialog({ open, onClose }) { // Sleep to give the RPC nodes some time to catch up. await sleep(10000); - enqueueSnackbar('Retrying merge', { variant: 'info' }); + enqueueSnackbar('Retrying migration', { variant: 'info' }); await mergeAccounts(retryCount - 1); } }; @@ -149,7 +149,7 @@ export default function MergeAccountsDialog({ open, onClose }) { setMergeCheck(''); onClose(); }; - const disabled = mergeCheck.toLowerCase() !== 'merge'; + const disabled = mergeCheck.toLowerCase() !== 'migrate'; return ( @@ -170,14 +170,14 @@ export default function MergeAccountsDialog({ open, onClose }) { ) : ( <> - Are you sure you want to merge tokens? + Are you sure you want to migrate tokens? WARNING: This action may break apps that depend on your existing token accounts. - Merging sends all tokens to{' '} + Migrating sends all tokens to{' '} - If merging fails during a period of high network load, you will - not have lost your funds. Just recontinue the merge from where you - left off. If you have a lot of accounts, merging might take a + If migrating fails during a period of high network load, you will + not have lost your funds. Just recontinue the migration from where you + left off. If you have a lot of accounts, migrating might take a while. { - enqueueSnackbar('Account merge complete', { + enqueueSnackbar('Account migrate complete', { variant: 'success', }); setIsMerging(false); @@ -229,7 +229,7 @@ export default function MergeAccountsDialog({ open, onClose }) { color="secondary" autoFocus > - Merge + Migrate