@@ -8,6 +8,7 @@ import { useWallet } from 'store/wallet';
8import { usePointCursor } from 'store/pointCursor';
8import { usePointCursor } from 'store/pointCursor';
10import * as need from 'lib/need';
10import * as need from 'lib/need';
11+import { generateCode } from 'lib/networkCode';
13 attemptNetworkSeedDerivation,
14 attemptNetworkSeedDerivation,
@@ -28,6 +29,8 @@ export default function useKeyfileGenerator(manualNetworkSeed) {
28 const [generating, setGenerating] = useState(true);
29 const [generating, setGenerating] = useState(true);
29 const [keyfile, setKeyfile] = useState(false);
30 const [keyfile, setKeyfile] = useState(false);
32+ const [code, setCode] = useState(false);
31 const _point = need.point(pointCursor);
34 const _point = need.point(pointCursor);
32 const _details = need.details(getDetails(_point));
35 const _details = need.details(getDetails(_point));
@@ -71,6 +74,8 @@ export default function useKeyfileGenerator(manualNetworkSeed) {
72 const pair = deriveNetworkKeys(_networkSeed);
75 const pair = deriveNetworkKeys(_networkSeed);
77+ setCode(generateCode(pair));
74 if (!keysMatchChain(pair, _details)) {
79 if (!keysMatchChain(pair, _details)) {
75 setGenerating(false);
80 setGenerating(false);
76 setNotice('Derived networking keys do not match on-chain details.');
81 setNotice('Derived networking keys do not match on-chain details.');
@@ -88,6 +93,7 @@ export default function useKeyfileGenerator(manualNetworkSeed) {
88 urbitWallet,
93 urbitWallet,
90 authMnemonic,
95 authMnemonic,
@@ -113,6 +119,7 @@ export default function useKeyfileGenerator(manualNetworkSeed) {
113 downloaded,
119 downloaded,
114 download,
120 download,
118 return { ...values, bind: values };
125 return { ...values, bind: values };