on 4c8c607 help sign in
50 lines 1.6 kB history raw
1import React from 'react';
2import { Grid, Text } from 'indigo-react';
3import { useWallet } from 'store/wallet';
5import { useLocalRouter } from 'lib/LocalRouter';
7import ViewHeader from 'components/ViewHeader';
8import View from 'components/View';
9import WarningBox from 'components/WarningBox';
11import CopiableAddressWrap from 'components/CopiableAddressWrap';
12import Highlighted from 'components/Highlighted';
14import * as need from 'lib/need';
16export default function Xpub() {
17 const { pop } = useLocalRouter();
18 const { urbitWallet } = useWallet();
20 const { xpub: zpub } = need.urbitWallet(urbitWallet).bitcoinMainnet.keys;
21 const { xpub: vpub } = need.urbitWallet(urbitWallet).bitcoinTestnet.keys;
23 // set to false for BTC testnet
24 const isMainnet = true;
26 return (
27 <View pop={pop} inset>
28 <Grid className="mt4">
29 <Grid.Item full as={ViewHeader}>
30 Bitcoin
31 </Grid.Item>
32 <Grid.Item full as={WarningBox}>
33 We do not recommend using this feature for significant amounts of
34 money, since your private keys are exposed to the browser.
35 </Grid.Item>
36 <Grid.Item full className="mt4" as={Text}>
37 The public key derived from your master ticket.
38 </Grid.Item>
39 <Grid.Item full className="mt4" as={Text}>
40 Paste it into landscape while setting up your wallet.
41 </Grid.Item>
42 <Grid.Item full className="mt4" as={Text}>
43 <Highlighted>
44 <CopiableAddressWrap>{isMainnet ? zpub : vpub}</CopiableAddressWrap>
45 </Highlighted>
46 </Grid.Item>
47 </Grid>
48 </View>
49 );