1import { useCallback, useState } from 'react';
2import { Nothing } from 'folktale/maybe';
4export default function useActivateFlowState() {
5 const [derivedPatp, setDerivedPatp] = useState(Nothing());
6 const [derivedPoint, setDerivedPoint] = useState(Nothing());
7 const [generated, setGenerated] = useState(false);
8 const [incomingPoints, setIncomingPoints] = useState(Nothing());
9 const [derivedPointDominion, setDerivedPointDominion] = useState(Nothing());
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 this wallet. When the user confirms
16 // the Master Key (ticket) and downloads the passport / mnemonic,
17 // it is for this wallet
19 const [inviteMasterTicketWallet, setInviteMasterTicketWallet] = useState(Nothing());
20 // The wallet generated deterministically during the invite creation 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 // type bip32.BIP32Interface
28 const [sendWallet, setSendWallet] = useState(Nothing());
30 const reset = useCallback(() => {
31 setDerivedPatp(Nothing());
32 setDerivedPoint(Nothing());
33 setDerivedPointDominion(Nothing());
34 setInviteMasterTicketWallet(Nothing());
36 setIncomingPoints(Nothing());
37 setInviteWallet(Nothing());
38 setSendWallet(Nothing());
42 setDerivedPointDominion,
43 setInviteMasterTicketWallet,
54 inviteMasterTicketWallet,
63 setDerivedPointDominion,
64 setInviteMasterTicketWallet,
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list