@verified-network/verified-custody 0.1.4 → 0.1.6

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 +46 -33
  2. package/dist/main.js +1 -1
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -1,32 +1,44 @@
1
- # Verified Wallet
1
+ # Verified Custody
2
2
 
3
- # Verified Custody Module.
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
- This module allows users to create a vault using Mobile/ E-mail as their vault address and gives you a private Key which the users can use to sign all transactions further.
6
-
7
- Usage:
5
+ ### Build:
8
6
  - All the components of the module is compiled and available under the dist/ directory.
9
7
 
10
8
 
11
- Install:
12
- - npm install verified-wallet
9
+ ### Install:
10
+ ``` npm install @verified-network/verified-custody```
11
+
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
14
+
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
+
17
+ **useCustody() - (hook)** - contains vaultInfo and IS_CUSTODY_SET.
18
+
19
+ **initializeMessaging() - (void)** - Should be called to initialise the fcm which will get the device token. Should be called at the earliest.
13
20
 
14
- The Module exports some constants and functions which will be useful when changing UI based on a user state or any Business Logic
21
+ **getPermissionStatus - (bool** - Returns the status whether the user has allowed Push notification permissions.
15
22
 
16
- - IS_CUSTODY_SET - (bool) - Returns true when the user's pk is stored in the device and is validated by the users pin.
17
- - useCustody() - hook - contains vaultInfo and IS_CUSTODY_SET.
23
+ **getFcmToken - ( string)** - Returns the FCM token of the device.
18
24
 
19
- - initializeMessaging() - (void) - Should be called to initialise the fcm which will get the device token. Should be called at the earliest.
20
25
 
21
- - getPermissionStatus - (bool) - Returns the status whether the user has allowed Push notification permissions.
22
26
 
23
- - getFcmToken - ( string) - Returns the FCM token of the device.
24
27
 
25
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
26
36
 
27
- **< StartCustody />** component is the entry component, which starts from asking the user to enter their phone/email and follows.
37
+ **creator, txId, transactionType, user(id), etc.,** will be obtained from the notification params and as the query params.
28
38
 
39
+ ## Usage:
29
40
 
41
+ ### Creating a vault:
30
42
 
31
43
  return (
32
44
  <>
@@ -41,19 +53,10 @@ The Module exports some constants and functions which will be useful when changi
41
53
  ) }
42
54
  </>
43
55
  ) : permissionStatus === 'denied' ? (
44
- <div style={{
45
- position: "absolute",
46
- left: "50%",
47
- top: "50%",
48
- transform: "translate(-50%, -50%)",
49
- textAlign: "center",
50
- }}
51
- >
52
56
  <p>
53
57
  Notifications are blocked. Please enable them from your browser
54
58
  settings.
55
59
  </p>
56
- </div>
57
60
  ) : (
58
61
  <div>Requesting notification permissions...</div>
59
62
  )}
@@ -61,20 +64,30 @@ The Module exports some constants and functions which will be useful when changi
61
64
  )
62
65
 
63
66
 
64
- This **< StartCustody />** component, can be used for multiple use case like to Sign Transactions and Retrieve Private Key by passing props.
65
-
66
- - To Accept and Decline Cosigner Request
67
- - To Sign Transactions
68
- - To Retrieve Private Key
69
-
67
+ ### Handling cosigner requests:
70
68
 
71
- <StartCustody
72
- startPoint={{
69
+ <StartCustody
70
+ startPoint={{
73
71
  component: "StartCosigner", // currently supports all forms of signing
74
72
  args: { creator, txId, transactionType, id },
75
- }}
73
+ }}
74
+ />
76
75
 
76
+ *transactionType* determines the type of signing request.
77
77
 
78
78
 
79
- - **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
+
80
93