Skip to content

Commit

Permalink
frontend: remove old split account specific guide entries
Browse files Browse the repository at this point in the history
These were used in the settings page when we used to have separate
accounts per script type, with toggles for each one. this is also
all gone now with unified accounts and the multi-accounts feature.

Also: there is now a script type guide in the receive screen.
  • Loading branch information
thisconnect committed Oct 4, 2022
1 parent b1a2e72 commit 47810e4
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 68 deletions.
22 changes: 0 additions & 22 deletions frontends/web/src/locales/en/app.json
Expand Up @@ -554,10 +554,6 @@
"title": "What is an extended public key?"
}
},
"accountLegacyConvert": {
"text": "Go to the Bitcoin account, select receive and copy the address. Go back to your legacy account, click send, paste the copied address and tick send all. Then sign and send to move all your coins in a single transaction.",
"title": "How can I move my coins out of the Legacy account?"
},
"accountRates": {
"text": "We update exchange rates every minute from CoinGecko.",
"title": "Which exchange rates apply?"
Expand Down Expand Up @@ -807,24 +803,6 @@
}
},
"settings": {
"btc-p2pkh": {
"text": "An account that uses an old transaction format, now superseded by the Segwit address and transaction formats. If you used the BitBox with the old desktop app then this account will contain your coins. We recommend transferring your coins to a Bitcoin or Bitcoin bech32 account to save transaction fees.",
"title": "What is Bitcoin Legacy?"
},
"btc-p2sh": {
"link": {
"text": "Segregated witness benefits"
},
"text": "This is a backwards compatible Segwit account (p2sh-p2wpkh). It uses a new transaction format that saves you network fees. The address format is similar to legacy, and as such can be used with all existing Bitcoin wallets/exchanges/services.",
"title": "What is the Bitcoin account?"
},
"btc-p2wpkh": {
"link": {
"text": "Bech32 adoption"
},
"text": "Use the new Bitcoin bech32 address format to reap the full benefits of Segwit's cheaper network fees. Remember that this format is not accepted everywhere yet.",
"title": "What is Bitcoin bech32?"
},
"servers": {
"text": "This app communicates with the Shift Crypto servers to check for updates, load transactions, and send information to paired mobile apps.\nThe app also retrieves the latest exchange rates from CoinGecko. All conversions are calculated locally which means no data about the amount of your transaction is ever transmitted.\nNote: For Ethereum and ERC20 Tokens, we use Etherscan.io APIs.",
"title": "Which servers does this app talk to?"
Expand Down
2 changes: 0 additions & 2 deletions frontends/web/src/routes/account/account.tsx
Expand Up @@ -251,7 +251,6 @@ class Account extends Component<Props, State> {
transactions,
balance,
hasCard,
accountInfo,
syncedAddressesCount,
} = this.state;
const account = accounts &&
Expand Down Expand Up @@ -355,7 +354,6 @@ class Account extends Component<Props, State> {
</div>
<AccountGuide
account={account}
accountInfo={accountInfo}
unit={balance?.available.unit}
hasIncomingBalance={balance && balance.hasIncoming}
hasTransactions={transactions !== undefined && transactions.length > 0}
Expand Down
32 changes: 2 additions & 30 deletions frontends/web/src/routes/account/guide.tsx
Expand Up @@ -15,14 +15,13 @@
*/

import { useTranslation } from 'react-i18next';
import { IAccount, ISigningConfigurationList } from '../../api/account';
import { IAccount } from '../../api/account';
import { Entry } from '../../components/guide/entry';
import { Guide } from '../../components/guide/guide';
import { isBitcoinBased, isBTCScriptType } from './utils';
import { isBitcoinBased } from './utils';

type Props = {
account: IAccount;
accountInfo?: ISigningConfigurationList;
unit?: string;
hasNoBalance?: boolean;
hasIncomingBalance?: boolean;
Expand All @@ -31,7 +30,6 @@ type Props = {

export function AccountGuide({
account,
accountInfo,
unit,
hasNoBalance,
hasIncomingBalance,
Expand All @@ -41,29 +39,6 @@ export function AccountGuide({
return (
<Guide>
<Entry key="accountDescription" entry={t('guide.accountDescription')} />
{isBTCScriptType('p2pkh', account, accountInfo) && (
<Entry key="guide.settings.btc-p2pkh" entry={t('guide.settings.btc-p2pkh')} />
)}
{isBTCScriptType('p2wpkh-p2sh', account, accountInfo) && (
<Entry key="guide.settings.btc-p2sh" entry={{
link: {
text: t('guide.settings.btc-p2sh.link.text'),
url: 'https://bitcoincore.org/en/2016/01/26/segwit-benefits/'
},
text: t('guide.settings.btc-p2sh.text'),
title: t('guide.settings.btc-p2sh.title')
}} />
)}
{isBTCScriptType('p2wpkh', account, accountInfo) && (
<Entry key="guide.settings.btc-p2wpkh" entry={{
link: {
text: t('guide.settings.btc-p2wpkh.link.text'),
url: 'https://en.bitcoin.it/wiki/Bech32_adoption'
},
text: t('guide.settings.btc-p2wpkh.text'),
title: t('guide.settings.btc-p2wpkh.title')
}} />
)}
{hasNoBalance && (
<Entry key="accountSendDisabled" entry={t('guide.accountSendDisabled', {
unit
Expand All @@ -76,9 +51,6 @@ export function AccountGuide({
{hasTransactions && (
<Entry key="accountTransactionTime" entry={t('guide.accountTransactionTime')} />
)}
{isBTCScriptType('p2pkh', account, accountInfo) && (
<Entry key="accountLegacyConvert" entry={t('guide.accountLegacyConvert')} />
)}
{hasTransactions && (
<Entry key="accountTransactionAttributesGeneric" entry={t('guide.accountTransactionAttributesGeneric')} />
)}
Expand Down
15 changes: 1 addition & 14 deletions frontends/web/src/routes/account/utils.ts
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

import { CoinCode, IAccount, ISigningConfigurationList, ScriptType } from '../../api/account';
import { CoinCode, ScriptType } from '../../api/account';

export function isBitcoinOnly(coinCode: CoinCode): boolean {
switch (coinCode) {
Expand Down Expand Up @@ -81,16 +81,3 @@ export function customFeeUnit(coinCode: CoinCode): string {
}
return '';
}

export function isBTCScriptType(
scriptType: ScriptType,
account: IAccount,
accountInfo?: ISigningConfigurationList,
): boolean {
if (!accountInfo || accountInfo.signingConfigurations.length !== 1) {
return false;
}
const config = accountInfo.signingConfigurations[0].bitcoinSimple;
return (account.coinCode === 'btc' || account.coinCode === 'tbtc')
&& config !== undefined && config.scriptType === scriptType;
}

0 comments on commit 47810e4

Please sign in to comment.