@verified-network/verified-custody 0.2.0 → 0.2.1
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.
- package/README.md +437 -0
- package/package.json +5 -2
- package/babel.config.json +0 -12
- package/src/components/overlays.tsx +0 -61
- package/src/components/search.tsx +0 -381
- package/src/components/slider.tsx +0 -29
- package/src/components/success.tsx +0 -142
- package/src/customTypes.d.ts +0 -37
- package/src/index.ts +0 -17
- package/src/pages/addCosigners.tsx +0 -1014
- package/src/pages/contact.tsx +0 -280
- package/src/pages/createPin.tsx +0 -693
- package/src/pages/enterPin.tsx +0 -821
- package/src/pages/ftu.tsx +0 -244
- package/src/pages/index.tsx +0 -170
- package/src/pages/otp.tsx +0 -410
- package/src/services/contracts.ts +0 -817
- package/src/services/store.tsx +0 -65
- package/src/style.css +0 -2030
- package/src/utils/config.ts +0 -103
- package/src/utils/constants.ts +0 -1966
- package/src/utils/helpers.tsx +0 -334
- package/src/utils/types.ts +0 -85
- package/tsconfig.json +0 -16
- package/tsup.config.ts +0 -36
package/README.md
ADDED
|
@@ -0,0 +1,437 @@
|
|
|
1
|
+
# Verified Custody
|
|
2
|
+
|
|
3
|
+
Verified Custody is a react submodule for Custody of digital assets. This react module allows users to create Blockchain wallets using PHONE NUMBER/EMAIL and save the secured version on the wallet keys on-chain. It provides extra layer of security by utilizing Co-Signers protocol where users can add up to 5 other users/non-users as their trusted Co-Signers, these custodians serve as signers that can help recover your account keys and sign transactions.
|
|
4
|
+
|
|
5
|
+
### Installation:
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
npm install @verified-network/verified-custody
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```jsx
|
|
12
|
+
import React from "react";
|
|
13
|
+
|
|
14
|
+
import { VerifiedCustody } from "@verified-network/verified-custody";
|
|
15
|
+
|
|
16
|
+
function App() {
|
|
17
|
+
return (
|
|
18
|
+
<div>
|
|
19
|
+
<VerifiedCustody />
|
|
20
|
+
</div>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Build:
|
|
26
|
+
|
|
27
|
+
- This module is built with typescript and work for both javascript and typescript react/vite projects.
|
|
28
|
+
- All the components of the module is compiled and available under the dist/ directory.
|
|
29
|
+
|
|
30
|
+
The react module exports react components and helper functions which will be useful when changing UI based on a user's state or any business logic
|
|
31
|
+
|
|
32
|
+
\***\*< VerifiedCustody />\*\*** component is the completed workflow of the custody module, it handles full workflow for new and existing users in steps; it consists of:
|
|
33
|
+
|
|
34
|
+
# First Time Users
|
|
35
|
+
|
|
36
|
+
\***\*< FTUPage />\*\*** component which handles full workflow for First Time Users. This consists of:
|
|
37
|
+
|
|
38
|
+
\***\*< ContactPage />\*\*** component which is the starting point for all users, where they are required to input their phone number or email. And they receive an OTP(one time password).
|
|
39
|
+
|
|
40
|
+
\***\*< OTPPage />\*\*** component which is where new/existing users verify and resend OTP.
|
|
41
|
+
|
|
42
|
+
\***\*< CreatePinPage />\*\*** component which is where all users either;
|
|
43
|
+
|
|
44
|
+
1. create 4 digit pin to secure their account.
|
|
45
|
+
2. Input their existing pin and get redirected to another page.
|
|
46
|
+
In this component new users accounts are created as they had verified their Phone number/Email from previous components.
|
|
47
|
+
|
|
48
|
+
\***\*< AddCoSignersPage />\*\*** component which is where all new users gets to add coSigners to their account and decide the rule of signing. Users can add up to 5 Co-signers with 2 as minimum required signers.
|
|
49
|
+
|
|
50
|
+
# Returning Users
|
|
51
|
+
|
|
52
|
+
\***\*< EnterPinPage />\*\*** component which is where existing/returning users gets to input their account pin to perform various actions like;
|
|
53
|
+
|
|
54
|
+
1. connect their account/wallet to an application.
|
|
55
|
+
2. Accept/Reject Co-signers invitation.
|
|
56
|
+
3. Recover their lost account/wallet keys
|
|
57
|
+
4. Sign account recovery transaction for users
|
|
58
|
+
5. Sign regular transactions. e.t.c
|
|
59
|
+
|
|
60
|
+
## Usage:
|
|
61
|
+
|
|
62
|
+
Note: To implement this module in your project there are some important component props required.
|
|
63
|
+
|
|
64
|
+
# Components Props Type:
|
|
65
|
+
|
|
66
|
+
```jsx
|
|
67
|
+
export interface VerifiedCustodyProps {
|
|
68
|
+
action?: VerifiedWalletAction;
|
|
69
|
+
actionText?: string;
|
|
70
|
+
origin?: string;
|
|
71
|
+
title?: string;
|
|
72
|
+
chainId?: number;
|
|
73
|
+
vaultData?: VerifiedWalletVault;
|
|
74
|
+
txData?: VerifiedWalletTx;
|
|
75
|
+
reqVaultData?: VerifiedWalletVault;
|
|
76
|
+
delayPageElement?: React.JSX.Element;
|
|
77
|
+
delayPageStyle?: React.CSSProperties;
|
|
78
|
+
helperFunctions?: VerifiedCustodyHelpers;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export type VerifiedWalletAction =
|
|
82
|
+
| "connect_wallet"
|
|
83
|
+
| "getPk"
|
|
84
|
+
| "invitation"
|
|
85
|
+
| "signRecovery"
|
|
86
|
+
| "completeRecovery";
|
|
87
|
+
|
|
88
|
+
export type VerifiedWalletVault = {
|
|
89
|
+
vaultId: string,
|
|
90
|
+
hashedVaultId?: string,
|
|
91
|
+
hashedVaultPin?: string,
|
|
92
|
+
CoSignerId?: string,
|
|
93
|
+
vId?: string,
|
|
94
|
+
vPh?: string,
|
|
95
|
+
cId?: string,
|
|
96
|
+
address?: string,
|
|
97
|
+
channel?: "sms" | "email",
|
|
98
|
+
pk?: string,
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
export type VerifiedWalletTx = {
|
|
102
|
+
id: string,
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
export interface VerifiedCustodyHelpers {
|
|
106
|
+
sendCoSignerInvitation: (
|
|
107
|
+
channel: "sms" | "email",
|
|
108
|
+
cosigerId: string,
|
|
109
|
+
cretorId: string,
|
|
110
|
+
hashedCretorPin: string
|
|
111
|
+
) => Promise<boolean>;
|
|
112
|
+
|
|
113
|
+
sendCreatorConfirmation: (
|
|
114
|
+
channel: "sms" | "email",
|
|
115
|
+
cretorId: string,
|
|
116
|
+
cosigersList: [],
|
|
117
|
+
requiredSigners: number
|
|
118
|
+
) => Promise<boolean>;
|
|
119
|
+
|
|
120
|
+
sendCreatorInitiation: (
|
|
121
|
+
channel: "sms" | "email",
|
|
122
|
+
cretorId: string,
|
|
123
|
+
hashedCretorPin: string,
|
|
124
|
+
txId: number,
|
|
125
|
+
requiredSigners: number
|
|
126
|
+
) => Promise<boolean>;
|
|
127
|
+
|
|
128
|
+
sendCreatorSigned: (
|
|
129
|
+
channel: "sms" | "email",
|
|
130
|
+
cretorId: string,
|
|
131
|
+
coSignerId: string
|
|
132
|
+
) => Promise<boolean>;
|
|
133
|
+
|
|
134
|
+
sendCreatorCompleted: (
|
|
135
|
+
channel: "sms" | "email",
|
|
136
|
+
cretorId: string,
|
|
137
|
+
txId: number
|
|
138
|
+
) => Promise<boolean>;
|
|
139
|
+
|
|
140
|
+
sendCreatorAcceptance: (
|
|
141
|
+
channel: "sms" | "email",
|
|
142
|
+
creatorId: string,
|
|
143
|
+
coSignerId: string
|
|
144
|
+
) => Promise<boolean>;
|
|
145
|
+
|
|
146
|
+
sendCreatorRejection: (
|
|
147
|
+
channel: "sms" | "email",
|
|
148
|
+
creatorId: string,
|
|
149
|
+
coSignerId: string
|
|
150
|
+
) => Promise<boolean>;
|
|
151
|
+
}
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
1. action: which can be either "connect_wallet" or "getPk" or "invitation" or "signRecovery" or "completeRecovery". if action is not passed in the props it will create account for new users or login for an existing users.
|
|
155
|
+
2. helperFunctions:
|
|
156
|
+
For Example: sendCoSignerInvitation: this is required to send messages to cosigners using their email or phone number. it must take 4 parameters: ` jsx
|
|
157
|
+
channel: "sms" | "email",
|
|
158
|
+
cosigerId: string, //email or phone number of the cosigner added. note: phone number must be ``+${countryPhoneCode}${10DigitsPhoneNumber} `` for example: +10987654321 where 1 is the countryCode and 0987654321 is the phone number.
|
|
159
|
+
cretorId: string, //email or phone number of the account creator. note: phone number must be ``+${countryPhoneCode}${10DigitsPhoneNumber} `` for example: +10987654321 where 1 is the countryCode and 0987654321 is the phone number.
|
|
160
|
+
hashedCretorPin: string `
|
|
161
|
+
and return `true or false` true when message sends without error and false incase of any error.
|
|
162
|
+
|
|
163
|
+
Check the code Below for better explaination of how all helper functions work.
|
|
164
|
+
|
|
165
|
+
### Full workflow with one component(handle First time users, existing user and all type of actions)
|
|
166
|
+
|
|
167
|
+
```jsx
|
|
168
|
+
import React from 'react';
|
|
169
|
+
|
|
170
|
+
import { VerifiedCustody} from '@verified-network/verified-custody';
|
|
171
|
+
|
|
172
|
+
function App(){
|
|
173
|
+
|
|
174
|
+
const myCustomSendCoSignerInvitation = async(
|
|
175
|
+
channel: "sms" | "email",
|
|
176
|
+
cosigerId: string,
|
|
177
|
+
cretorId: string,
|
|
178
|
+
hashedCretorPin: string
|
|
179
|
+
) => Promise<boolean> {
|
|
180
|
+
try {
|
|
181
|
+
//sends email/messages depending on the channel
|
|
182
|
+
if(channel === "sms") {
|
|
183
|
+
//send message to cosigerId phone number using creatorId and hashedCretorPin in message
|
|
184
|
+
return true
|
|
185
|
+
}else if(channel === "email") {
|
|
186
|
+
//send message to cosigerId email using creatorId and hashedCretorPin in message
|
|
187
|
+
return true
|
|
188
|
+
}else {
|
|
189
|
+
return false
|
|
190
|
+
}
|
|
191
|
+
}catch(err) {
|
|
192
|
+
//handles error
|
|
193
|
+
return false
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
const myCustomSendCreatorConfirmation = async(
|
|
198
|
+
channel: "sms" | "email",
|
|
199
|
+
cretorId: string,
|
|
200
|
+
cosigersList: [],
|
|
201
|
+
requiredSigners: number
|
|
202
|
+
) => Promise<boolean> {
|
|
203
|
+
try {
|
|
204
|
+
//sends email/messages depending on the channel
|
|
205
|
+
if(channel === "sms") {
|
|
206
|
+
//send message to cretorId phone number showing creator his coSigners list and rule of signer using requiredSigners and totalNumber of coSignersList
|
|
207
|
+
return true
|
|
208
|
+
}else if(channel === "email") {
|
|
209
|
+
//send message to cretorId email showing creator his coSigners list and rule of signer using requiredSigners and totalNumber of coSignersList
|
|
210
|
+
return true
|
|
211
|
+
}else {
|
|
212
|
+
return false
|
|
213
|
+
}
|
|
214
|
+
}catch(err) {
|
|
215
|
+
//handles error
|
|
216
|
+
return false
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
// no action/ create account for new user or login existing user.
|
|
221
|
+
return (
|
|
222
|
+
<div>
|
|
223
|
+
<VerifiedCustody helperFunctions={
|
|
224
|
+
sendCoSignerInvitation: myCustomSendCoSignerInvitation,
|
|
225
|
+
sendCreatorConfirmation: myCustomSendCreatorConfirmation,
|
|
226
|
+
sendCreatorInitiation: myCustomsendCreatorInitiation,
|
|
227
|
+
sendCreatorSigned: myCustomSendCreatorSigned,
|
|
228
|
+
sendCreatorCompleted: myCustomSendCreatorCompleted,
|
|
229
|
+
sendCreatorAcceptance: myCustomSendCreatorAcceptance,
|
|
230
|
+
sendCreatorRejection: myCustomSendCreatorRejection
|
|
231
|
+
} />
|
|
232
|
+
</div>
|
|
233
|
+
);
|
|
234
|
+
|
|
235
|
+
// connect existing user account
|
|
236
|
+
return (
|
|
237
|
+
<div>
|
|
238
|
+
<VerifiedCustody action="connect_wallet" actionText="CustomActionTextToDisplay like: Connect Your Account" origin="websiteToConnectToUrl" title="websiteToConnectToTitle" helperFunctions={
|
|
239
|
+
sendCoSignerInvitation: myCustomSendCoSignerInvitation,
|
|
240
|
+
sendCreatorConfirmation: myCustomSendCreatorConfirmation,
|
|
241
|
+
sendCreatorInitiation: myCustomsendCreatorInitiation,
|
|
242
|
+
sendCreatorSigned: myCustomSendCreatorSigned,
|
|
243
|
+
sendCreatorCompleted: myCustomSendCreatorCompleted,
|
|
244
|
+
sendCreatorAcceptance: myCustomSendCreatorAcceptance,
|
|
245
|
+
sendCreatorRejection: myCustomSendCreatorRejection
|
|
246
|
+
} />
|
|
247
|
+
</div>
|
|
248
|
+
);
|
|
249
|
+
|
|
250
|
+
//accept or reject coSigner invitation
|
|
251
|
+
return (
|
|
252
|
+
<div>
|
|
253
|
+
<VerifiedCustody action="invitation" origin="websiteUrl" title="websiteTitle" helperFunctions={
|
|
254
|
+
sendCoSignerInvitation: myCustomSendCoSignerInvitation,
|
|
255
|
+
sendCreatorConfirmation: myCustomSendCreatorConfirmation,
|
|
256
|
+
sendCreatorInitiation: myCustomsendCreatorInitiation,
|
|
257
|
+
sendCreatorSigned: myCustomSendCreatorSigned,
|
|
258
|
+
sendCreatorCompleted: myCustomSendCreatorCompleted,
|
|
259
|
+
sendCreatorAcceptance: myCustomSendCreatorAcceptance,
|
|
260
|
+
sendCreatorRejection: myCustomSendCreatorRejection
|
|
261
|
+
} />
|
|
262
|
+
</div>
|
|
263
|
+
);
|
|
264
|
+
|
|
265
|
+
//sign account recovery for an existing account as their cosigner
|
|
266
|
+
return (
|
|
267
|
+
<div>
|
|
268
|
+
<VerifiedCustody action="signRecovery" origin="websiteUrl" title="websiteTitle" helperFunctions={
|
|
269
|
+
sendCoSignerInvitation: myCustomSendCoSignerInvitation,
|
|
270
|
+
sendCreatorConfirmation: myCustomSendCreatorConfirmation,
|
|
271
|
+
sendCreatorInitiation: myCustomsendCreatorInitiation,
|
|
272
|
+
sendCreatorSigned: myCustomSendCreatorSigned,
|
|
273
|
+
sendCreatorCompleted: myCustomSendCreatorCompleted,
|
|
274
|
+
sendCreatorAcceptance: myCustomSendCreatorAcceptance,
|
|
275
|
+
sendCreatorRejection: myCustomSendCreatorRejection
|
|
276
|
+
} />
|
|
277
|
+
</div>
|
|
278
|
+
);
|
|
279
|
+
|
|
280
|
+
//complete account recovery for an existing account
|
|
281
|
+
return (
|
|
282
|
+
<div>
|
|
283
|
+
<VerifiedCustody action="completeRecovery" origin="websiteUrl" title="websiteTitle" helperFunctions={
|
|
284
|
+
sendCoSignerInvitation: myCustomSendCoSignerInvitation,
|
|
285
|
+
sendCreatorConfirmation: myCustomSendCreatorConfirmation,
|
|
286
|
+
sendCreatorInitiation: myCustomsendCreatorInitiation,
|
|
287
|
+
sendCreatorSigned: myCustomSendCreatorSigned,
|
|
288
|
+
sendCreatorCompleted: myCustomSendCreatorCompleted,
|
|
289
|
+
sendCreatorAcceptance: myCustomSendCreatorAcceptance,
|
|
290
|
+
sendCreatorRejection: myCustomSendCreatorRejection
|
|
291
|
+
} />
|
|
292
|
+
</div>
|
|
293
|
+
);
|
|
294
|
+
}
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
### First time users
|
|
298
|
+
|
|
299
|
+
```jsx
|
|
300
|
+
import React from 'react';
|
|
301
|
+
|
|
302
|
+
import { FTUPage} from '@verified-network/verified-custody';
|
|
303
|
+
|
|
304
|
+
function App(){
|
|
305
|
+
|
|
306
|
+
const myCustomSendCoSignerInvitation = async(
|
|
307
|
+
channel: "sms" | "email",
|
|
308
|
+
cosigerId: string,
|
|
309
|
+
cretorId: string,
|
|
310
|
+
hashedCretorPin: string
|
|
311
|
+
) => Promise<boolean> {
|
|
312
|
+
try {
|
|
313
|
+
//sends email/messages depending on the channel
|
|
314
|
+
if(channel === "sms") {
|
|
315
|
+
//send message to cosigerId phone number using creatorId and hashedCretorPin in message
|
|
316
|
+
return true
|
|
317
|
+
}else if(channel === "email") {
|
|
318
|
+
//send message to cosigerId email using creatorId and hashedCretorPin in message
|
|
319
|
+
return true
|
|
320
|
+
}else {
|
|
321
|
+
return false
|
|
322
|
+
}
|
|
323
|
+
}catch(err) {
|
|
324
|
+
//handles error
|
|
325
|
+
return false
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
const myCustomSendCreatorConfirmation = async(
|
|
330
|
+
channel: "sms" | "email",
|
|
331
|
+
cretorId: string,
|
|
332
|
+
cosigersList: [],
|
|
333
|
+
requiredSigners: number
|
|
334
|
+
) => Promise<boolean> {
|
|
335
|
+
try {
|
|
336
|
+
//sends email/messages depending on the channel
|
|
337
|
+
if(channel === "sms") {
|
|
338
|
+
//send message to cretorId phone number showing creator his coSigners list and rule of signer using requiredSigners and totalNumber of coSignersList
|
|
339
|
+
return true
|
|
340
|
+
}else if(channel === "email") {
|
|
341
|
+
//send message to cretorId email showing creator his coSigners list and rule of signer using requiredSigners and totalNumber of coSignersList
|
|
342
|
+
return true
|
|
343
|
+
}else {
|
|
344
|
+
return false
|
|
345
|
+
}
|
|
346
|
+
}catch(err) {
|
|
347
|
+
//handles error
|
|
348
|
+
return false
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
return (
|
|
353
|
+
<div>
|
|
354
|
+
<FTUPage helperFunctions={
|
|
355
|
+
sendCoSignerInvitation: myCustomSendCoSignerInvitation,
|
|
356
|
+
sendCreatorConfirmation: myCustomSendCreatorConfirmation,
|
|
357
|
+
sendCreatorInitiation: myCustomsendCreatorInitiation,
|
|
358
|
+
sendCreatorSigned: myCustomSendCreatorSigned,
|
|
359
|
+
sendCreatorCompleted: myCustomSendCreatorCompleted,
|
|
360
|
+
sendCreatorAcceptance: myCustomSendCreatorAcceptance,
|
|
361
|
+
sendCreatorRejection: myCustomSendCreatorRejection
|
|
362
|
+
} />
|
|
363
|
+
</div>
|
|
364
|
+
);
|
|
365
|
+
}
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
### Existing/Returning Users
|
|
369
|
+
|
|
370
|
+
```jsx
|
|
371
|
+
import React from 'react';
|
|
372
|
+
|
|
373
|
+
import { EnterPinPage} from '@verified-network/verified-custody';
|
|
374
|
+
|
|
375
|
+
function App(){
|
|
376
|
+
|
|
377
|
+
const myCustomSendCoSignerInvitation = async(
|
|
378
|
+
channel: "sms" | "email",
|
|
379
|
+
cosigerId: string,
|
|
380
|
+
cretorId: string,
|
|
381
|
+
hashedCretorPin: string
|
|
382
|
+
) => Promise<boolean> {
|
|
383
|
+
try {
|
|
384
|
+
//sends email/messages depending on the channel
|
|
385
|
+
if(channel === "sms") {
|
|
386
|
+
//send message to cosigerId phone number using creatorId and hashedCretorPin in message
|
|
387
|
+
return true
|
|
388
|
+
}else if(channel === "email") {
|
|
389
|
+
//send message to cosigerId email using creatorId and hashedCretorPin in message
|
|
390
|
+
return true
|
|
391
|
+
}else {
|
|
392
|
+
return false
|
|
393
|
+
}
|
|
394
|
+
}catch(err) {
|
|
395
|
+
//handles error
|
|
396
|
+
return false
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
const myCustomSendCreatorConfirmation = async(
|
|
401
|
+
channel: "sms" | "email",
|
|
402
|
+
cretorId: string,
|
|
403
|
+
cosigersList: [],
|
|
404
|
+
requiredSigners: number
|
|
405
|
+
) => Promise<boolean> {
|
|
406
|
+
try {
|
|
407
|
+
//sends email/messages depending on the channel
|
|
408
|
+
if(channel === "sms") {
|
|
409
|
+
//send message to cretorId phone number showing creator his coSigners list and rule of signer using requiredSigners and totalNumber of coSignersList
|
|
410
|
+
return true
|
|
411
|
+
}else if(channel === "email") {
|
|
412
|
+
//send message to cretorId email showing creator his coSigners list and rule of signer using requiredSigners and totalNumber of coSignersList
|
|
413
|
+
return true
|
|
414
|
+
}else {
|
|
415
|
+
return false
|
|
416
|
+
}
|
|
417
|
+
}catch(err) {
|
|
418
|
+
//handles error
|
|
419
|
+
return false
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
return (
|
|
424
|
+
<div>
|
|
425
|
+
<EnterPinPage helperFunctions={
|
|
426
|
+
sendCoSignerInvitation: myCustomSendCoSignerInvitation,
|
|
427
|
+
sendCreatorConfirmation: myCustomSendCreatorConfirmation,
|
|
428
|
+
sendCreatorInitiation: myCustomsendCreatorInitiation,
|
|
429
|
+
sendCreatorSigned: myCustomSendCreatorSigned,
|
|
430
|
+
sendCreatorCompleted: myCustomSendCreatorCompleted,
|
|
431
|
+
sendCreatorAcceptance: myCustomSendCreatorAcceptance,
|
|
432
|
+
sendCreatorRejection: myCustomSendCreatorRejection
|
|
433
|
+
} />
|
|
434
|
+
</div>
|
|
435
|
+
);
|
|
436
|
+
}
|
|
437
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@verified-network/verified-custody",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"description": "React submodule for Custody of digital assets",
|
|
4
5
|
"main": "dist/index.js",
|
|
5
6
|
"module": "dist/index.mjs",
|
|
6
7
|
"types": "dist/index.d.ts",
|
|
@@ -8,10 +9,12 @@
|
|
|
8
9
|
"build": "tsup",
|
|
9
10
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
10
11
|
},
|
|
12
|
+
"files": [
|
|
13
|
+
"dist"
|
|
14
|
+
],
|
|
11
15
|
"keywords": [],
|
|
12
16
|
"author": "",
|
|
13
17
|
"license": "MIT",
|
|
14
|
-
"description": "React submodule for Custody of digital assets",
|
|
15
18
|
"dependencies": {
|
|
16
19
|
"@biconomy/account": "^4.5.7",
|
|
17
20
|
"@verified-network/verified-sdk": "^1.9.5",
|
package/babel.config.json
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { imageAssets } from "../utils/constants";
|
|
3
|
-
|
|
4
|
-
export const TermsAndConditionsOverlay = () => {
|
|
5
|
-
return (
|
|
6
|
-
<p className="verified-custd-mdl-terms-and-condition">
|
|
7
|
-
By proceeding, you agree with Verified Wallet{" "}
|
|
8
|
-
<span style={{ color: "#603FF4", cursor: "pointer" }}>T&C</span> and{" "}
|
|
9
|
-
<span style={{ color: "#603FF4", cursor: "pointer" }}>
|
|
10
|
-
Privacy Policy.
|
|
11
|
-
</span>
|
|
12
|
-
</p>
|
|
13
|
-
);
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export const LogoutOverlay = (props: {
|
|
17
|
-
setIsLoading: (isLoading: boolean) => void;
|
|
18
|
-
setisOnboard?: (isOnboard: boolean) => void;
|
|
19
|
-
}) => {
|
|
20
|
-
return (
|
|
21
|
-
<p
|
|
22
|
-
style={{ fontSize: "0.7rem" }}
|
|
23
|
-
className="verified-custd-mdl-terms-and-condition"
|
|
24
|
-
>
|
|
25
|
-
Want to access a different account? Click{" "}
|
|
26
|
-
<span
|
|
27
|
-
style={{ color: "#603FF4", cursor: "pointer" }}
|
|
28
|
-
onClick={async () => {
|
|
29
|
-
props.setIsLoading(true);
|
|
30
|
-
if (chrome?.storage?.local) {
|
|
31
|
-
await chrome.storage.local.remove("myVault");
|
|
32
|
-
} else if (localStorage) {
|
|
33
|
-
localStorage.removeItem("myVault");
|
|
34
|
-
}
|
|
35
|
-
if (props.setisOnboard) {
|
|
36
|
-
props.setisOnboard(false);
|
|
37
|
-
}
|
|
38
|
-
props.setIsLoading(false);
|
|
39
|
-
}}
|
|
40
|
-
>
|
|
41
|
-
Logout
|
|
42
|
-
</span>{" "}
|
|
43
|
-
to logout and login/create another account
|
|
44
|
-
</p>
|
|
45
|
-
);
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
export const PrivacyOverlay = () => {
|
|
49
|
-
return (
|
|
50
|
-
<div className="verified-custd-mdl-privacy">
|
|
51
|
-
<img
|
|
52
|
-
alt="Privacy Icon"
|
|
53
|
-
src={imageAssets.privacyTip}
|
|
54
|
-
className="verified-custd-mdl-privacy-icon"
|
|
55
|
-
/>
|
|
56
|
-
<p className="verified-custd-mdl-privacy-text">
|
|
57
|
-
Trusted by 10M+ Investors globally
|
|
58
|
-
</p>
|
|
59
|
-
</div>
|
|
60
|
-
);
|
|
61
|
-
};
|