@@ -4,13 +4,30 @@ import { Nothing } from 'folktale/maybe';
44export default function useActivateFlowState() {
55 const [derivedPatp, setDerivedPatp] = useState(Nothing());
66 const [derivedPoint, setDerivedPoint] = useState(Nothing());
7− const [derivedPointDominion, setDerivedPointDominion] = useState(Nothing());
8− const [derivedWallet, setDerivedWallet] = useState(Nothing());
97 const [generated, setGenerated] = useState(false);
108 const [incomingPoints, setIncomingPoints] = useState(Nothing());
11− const [inviteWallet, setInviteWallet] = useState(Nothing());
9+ const [derivedPointDominion, setDerivedPointDominion] = useState(Nothing());
1210 const [isIn, setIsIn] = useState(false);
1311
12+ // A new wallet generated after confirming that the invite ticket is valid
13+ // and the point is available for activation.
14+ // At the end of the Activate flow, the point will be transferred
15+ // from the invite wallet to the derived wallet. When the user confirms
16+ // the Master Key (ticket) and downloads the passport / mnemonic,
17+ // it is for the derived wallet
18+ // type UrbitWallet
19+ const [derivedWallet, setDerivedWallet] = useState(Nothing());
20+ // The wallet generated deterministically during the invite flow;
21+ // it is re-generated when the user starts the Activate flow. It is used
22+ // to derive and confirm a shareable ticket that a user can activate a point with.
23+ // type UrbitWallet
24+ const [inviteWallet, setInviteWallet] = useState(Nothing());
25+ // This wallet is generated from the invite wallet's seed phrase.
26+ // It is used during the transfer phase of the invite flow to send transactions.
27+ // useMultiKeyFileGenerator.
28+ // type bip32.BIP32Interface
29+ const [sendWallet, setSendWallet] = useState(Nothing());
30+
1431 const reset = useCallback(() => {
1532 setDerivedPatp(Nothing());
1633 setDerivedPoint(Nothing());
@@ -19,13 +36,16 @@ export default function useActivateFlowState() {
1936 setGenerated(false);
2037 setIncomingPoints(Nothing());
2138 setInviteWallet(Nothing());
39+ setSendWallet(Nothing());
2240 }, [
41+ setDerivedPatp,
2342 setDerivedPoint,
2443 setDerivedPointDominion,
2544 setDerivedWallet,
2645 setGenerated,
2746 setIncomingPoints,
2847 setInviteWallet,
48+ setSendWallet,
2949 ]);
3050
3151 return {
@@ -38,6 +58,7 @@ export default function useActivateFlowState() {
3858 inviteWallet,
3959 isIn,
4060 reset,
61+ sendWallet,
4162 setDerivedPatp,
4263 setDerivedPoint,
4364 setDerivedPointDominion,
@@ -46,5 +67,6 @@ export default function useActivateFlowState() {
4667 setIncomingPoints,
4768 setInviteWallet,
4869 setIsIn,
70+ setSendWallet,
4971 };
5072}