@@ -4,13 +4,30 @@ import { Nothing } from 'folktale/maybe';
4export default function useActivateFlowState() {
4export default function useActivateFlowState() {
5 const [derivedPatp, setDerivedPatp] = useState(Nothing());
5 const [derivedPatp, setDerivedPatp] = useState(Nothing());
6 const [derivedPoint, setDerivedPoint] = useState(Nothing());
6 const [derivedPoint, setDerivedPoint] = useState(Nothing());
7− const [derivedPointDominion, setDerivedPointDominion] = useState(Nothing());
8− const [derivedWallet, setDerivedWallet] = useState(Nothing());
9 const [generated, setGenerated] = useState(false);
7 const [generated, setGenerated] = useState(false);
10 const [incomingPoints, setIncomingPoints] = useState(Nothing());
8 const [incomingPoints, setIncomingPoints] = useState(Nothing());
11− const [inviteWallet, setInviteWallet] = useState(Nothing());
9+ const [derivedPointDominion, setDerivedPointDominion] = useState(Nothing());
12 const [isIn, setIsIn] = useState(false);
10 const [isIn, setIsIn] = useState(false);
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
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.
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());
14 const reset = useCallback(() => {
31 const reset = useCallback(() => {
15 setDerivedPatp(Nothing());
32 setDerivedPatp(Nothing());
16 setDerivedPoint(Nothing());
33 setDerivedPoint(Nothing());
@@ -19,13 +36,16 @@ export default function useActivateFlowState() {
19 setGenerated(false);
36 setGenerated(false);
20 setIncomingPoints(Nothing());
37 setIncomingPoints(Nothing());
21 setInviteWallet(Nothing());
38 setInviteWallet(Nothing());
39+ setSendWallet(Nothing());
23 setDerivedPoint,
42 setDerivedPoint,
24 setDerivedPointDominion,
43 setDerivedPointDominion,
25 setDerivedWallet,
44 setDerivedWallet,
26 setGenerated,
45 setGenerated,
27 setIncomingPoints,
46 setIncomingPoints,
28 setInviteWallet,
47 setInviteWallet,
@@ -38,6 +58,7 @@ export default function useActivateFlowState() {
38 inviteWallet,
58 inviteWallet,
41 setDerivedPatp,
62 setDerivedPatp,
42 setDerivedPoint,
63 setDerivedPoint,
43 setDerivedPointDominion,
64 setDerivedPointDominion,
@@ -46,5 +67,6 @@ export default function useActivateFlowState() {
46 setIncomingPoints,
67 setIncomingPoints,
47 setInviteWallet,
68 setInviteWallet,