Skip to content

Commit

Permalink
ImportAccount: add disclaimer info
Browse files Browse the repository at this point in the history
  • Loading branch information
kaloudis committed Jul 11, 2024
1 parent 45a6233 commit d135a3b
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 2 deletions.
4 changes: 4 additions & 0 deletions locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,10 @@
"views.ImportAccount.externalAddrs": "Receive Addresses",
"views.ImportAccount.internalAddrs": "Change Addresses",
"views.ImportAccount.success": "Successfully imported external account",
"views.ImportAccount.Warning.text1": "Importing external accounts is currently an experimental feature.",
"views.ImportAccount.Warning.text2": "By hitting 'I Understand' you are agreeing to proceed at your own risk.",
"views.ImportAccount.Warning.text3": "If crafting a channel open with an external account, please follow all instructions on screen and DO NOT broadcast the transaction from anywhere except your ZEUS wallet.",
"views.ImportAccount.Warning.text4": "NOTE: Events (deposits/spends) for keys derived from an account will only be detected by LND if they happen after the import. Rescans to detect past events will be supported later on.",
"views.Wallet.Channels.open": "Open Channel",
"views.Wallet.Channels.inactive": "INACTIVE",
"views.Wallet.Channels.private": "Private",
Expand Down
76 changes: 74 additions & 2 deletions views/Accounts/ImportAccount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ interface ImportAccountState {
extended_public_key: string;
master_key_fingerprint: string;
address_type: number;
understood: boolean;
}

@inject('UTXOsStore')
Expand All @@ -72,7 +73,8 @@ export default class ImportAccount extends React.Component<
name: '',
extended_public_key: '',
master_key_fingerprint: '',
address_type: walletrpc.AddressType.WITNESS_PUBKEY_HASH
address_type: walletrpc.AddressType.WITNESS_PUBKEY_HASH,
understood: false
};
}

Expand Down Expand Up @@ -114,7 +116,8 @@ export default class ImportAccount extends React.Component<
name,
extended_public_key,
master_key_fingerprint,
address_type
address_type,
understood
} = this.state;
const { errorMsg } = UTXOsStore;

Expand All @@ -132,6 +135,75 @@ export default class ImportAccount extends React.Component<
</TouchableOpacity>
);

if (!understood) {
return (
<>
<View style={{ marginLeft: 10, marginRight: 10 }}>
<ErrorMessage
message={localeString(
'general.warning'
).toUpperCase()}
/>
</View>
<Text
style={{
color: themeColor('text'),
fontFamily: 'PPNeueMontreal-Book',
margin: 10,
fontSize: 20
}}
>
{localeString('views.ImportAccount.Warning.text1')}
</Text>
<Text
style={{
color: themeColor('text'),
fontFamily: 'PPNeueMontreal-Book',
margin: 10,
fontSize: 20
}}
>
{localeString('views.ImportAccount.Warning.text2')}
</Text>
<Text
style={{
color: themeColor('text'),
fontFamily: 'PPNeueMontreal-Book',
margin: 10,
fontSize: 20
}}
>
{localeString(
'views.ImportAccount.Warning.text3'
).replace('Zeus', 'ZEUS')}
</Text>
<Text
style={{
color: themeColor('text'),
fontFamily: 'PPNeueMontreal-Book',
margin: 10,
fontSize: 20
}}
>
{localeString('views.ImportAccount.Warning.text4')}
</Text>
<View
style={{
alignSelf: 'center',
position: 'absolute',
bottom: 35,
width: '100%'
}}
>
<Button
onPress={() => this.setState({ understood: true })}
title={localeString('general.iUnderstand')}
/>
</View>
</>
);
}

return (
<Screen>
<Header
Expand Down

0 comments on commit d135a3b

Please sign in to comment.