@verified-network/verified-custody 0.1.5 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +44 -29
  2. package/dist/main.js +1 -1
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -2,29 +2,43 @@
2
2
 
3
3
  This react module allows users to create a vault using Mobile/ E-mail as their vault id and gives you a private Key which the users can use to sign all transactions further.
4
4
 
5
- Build:
5
+ ### Build:
6
6
  - All the components of the module is compiled and available under the dist/ directory.
7
7
 
8
8
 
9
- Install:
10
- - npm install @verified-network/verified-custody
9
+ ### Install:
10
+ ``` npm install @verified-network/verified-custody```
11
11
 
12
+
12
13
  The react module exports some constants and helper functions which will be useful when changing UI based on a user's state or any business logic
13
14
 
14
- - IS_CUSTODY_SET - (bool) - Returns true when the user's pk is stored in the device and is validated by the users pin.
15
- - useCustody() - hook - contains vaultInfo and IS_CUSTODY_SET.
15
+ **IS_CUSTODY_SET - (bool)** - Returns true when the user's pk is stored in the device and is validated by the users pin.
16
16
 
17
- - initializeMessaging() - (void) - Should be called to initialise the fcm which will get the device token. Should be called at the earliest.
17
+ **useCustody() - (hook)** - contains vaultInfo and IS_CUSTODY_SET.
18
18
 
19
- - getPermissionStatus - (bool) - Returns the status whether the user has allowed Push notification permissions.
19
+ **initializeMessaging() - (void)** - Should be called to initialise the fcm which will get the device token. Should be called at the earliest.
20
20
 
21
- - getFcmToken - ( string) - Returns the FCM token of the device.
21
+ **getPermissionStatus - (bool** - Returns the status whether the user has allowed Push notification permissions.
22
22
 
23
+ **getFcmToken - ( string)** - Returns the FCM token of the device.
23
24
 
24
25
 
25
- **< StartCustody />** component is the entry component, which starts from asking the user to enter their phone/email and follows.
26
26
 
27
- Usage:
27
+
28
+
29
+ ****< StartCustody />**** component is the entry component, which starts from asking the user to enter their phone/email and follows.
30
+
31
+ This **< StartCustody />** component, can be used for multiple use case like to Sign Transactions and Retrieve Private Key by passing props.
32
+
33
+ - Create a new vault
34
+ - To Accept and Decline Cosigner Request
35
+ - To Sign Transactions
36
+
37
+ **creator, txId, transactionType, user(id), etc.,** will be obtained from the notification params and as the query params.
38
+
39
+ ## Usage:
40
+
41
+ ### Creating a vault:
28
42
 
29
43
  return (
30
44
  <>
@@ -39,19 +53,10 @@ Usage:
39
53
  ) }
40
54
  </>
41
55
  ) : permissionStatus === 'denied' ? (
42
- <div style={{
43
- position: "absolute",
44
- left: "50%",
45
- top: "50%",
46
- transform: "translate(-50%, -50%)",
47
- textAlign: "center",
48
- }}
49
- >
50
56
  <p>
51
57
  Notifications are blocked. Please enable them from your browser
52
58
  settings.
53
59
  </p>
54
- </div>
55
60
  ) : (
56
61
  <div>Requesting notification permissions...</div>
57
62
  )}
@@ -59,20 +64,30 @@ Usage:
59
64
  )
60
65
 
61
66
 
62
- This **< StartCustody />** component, can be used for multiple use case like to Sign Transactions and Retrieve Private Key by passing props.
63
-
64
- - To Accept and Decline Cosigner Request
65
- - To Sign Transactions
66
- - To Retrieve Private Key
67
-
67
+ ### Handling cosigner requests:
68
68
 
69
- <StartCustody
70
- startPoint={{
69
+ <StartCustody
70
+ startPoint={{
71
71
  component: "StartCosigner", // currently supports all forms of signing
72
72
  args: { creator, txId, transactionType, id },
73
- }}
73
+ }}
74
+ />
74
75
 
76
+ *transactionType* determines the type of signing request.
75
77
 
76
78
 
77
- - **creator, txId, transactionType** will be obtained from the notification params and as the query params.
79
+
80
+ ### Recovering a private key:
81
+
82
+ This **< GetPrivateKey />** component, will let you to retreive the private key once all your cosigners signoff your recovery code request.
83
+
84
+ return (
85
+ <GetPrivateKey
86
+ setupProps={{
87
+ chainId: 84532,
88
+ }}
89
+ signingInfo={{ creator, txId, transactionType, user }}
90
+ />
91
+ )
92
+
78
93