@verified-network/verified-custody 0.4.4 → 0.4.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.
package/README.md CHANGED
@@ -351,28 +351,35 @@ function App() {
351
351
  ```
352
352
 
353
353
  # 🔄 React(Create React App) Setup and Fixes
354
+
354
355
  ✅ 1. Initialize the Project
356
+
355
357
  ```jsx
356
358
  npx create-react-app my-app
357
359
  cd my-app
358
360
  ```
359
361
 
360
362
  ✅ 2. Install react-app-rewired
363
+
361
364
  ```jsx
362
365
  npm install react-app-rewired --save-dev
363
366
  OR
364
367
  yarn add --dev react-app-rewired
365
368
  ```
369
+
366
370
  ✅ 3. Install other dependencies for node polyfils
371
+
367
372
  ```jsx
368
- npm install --save-dev crypto-browserify stream-browserify assert stream-http https-browserify os-browserify url path-browserify vm-browserify buffer process
373
+ npm install --save-dev crypto-browserify stream-browserify assert stream-http https-browserify os-browserify url path-browserify vm-browserify buffer process
369
374
  OR
370
- yarn add crypto-browserify stream-browserify assert stream-http https-browserify os-browserify url path-browserify vm-browserify buffer process
375
+ yarn add crypto-browserify stream-browserify assert stream-http https-browserify os-browserify url path-browserify vm-browserify buffer process
371
376
  ```
377
+
372
378
  note: the above dependencies are needed dependencies to make node related packages work, more dependencies can be added to handle any other nodeJs polyfills error.
373
379
 
374
380
  ✅ 4. Override create-react-app webpack configuration
375
381
  In the root folder of your project, create a new file named 'config-overrides.js', and add:
382
+
376
383
  ```jsx
377
384
  //config-overrides.js
378
385
 
@@ -418,10 +425,12 @@ module.exports = function override(config) {
418
425
  return config;
419
426
  };
420
427
  ```
428
+
421
429
  config-overrides.js' code snippet instructs webpack how to resolve node js related dependencies that may not be available on browser side but are required. It also instruct webpack to ignore react-native related dependencies that may breack our react app.
422
430
 
423
431
  ✅ 5. Modify package.json Scripts
424
432
  In your package.json, replace this:
433
+
425
434
  ```json
426
435
  "scripts": {
427
436
  "start": "react-scripts start",
@@ -430,7 +439,9 @@ In your package.json, replace this:
430
439
  "eject": "react-scripts eject"
431
440
  }
432
441
  ```
442
+
433
443
  With this:
444
+
434
445
  ```json
435
446
  "scripts": {
436
447
  "start": "react-app-rewired start",
@@ -439,15 +450,19 @@ With this:
439
450
  }
440
451
 
441
452
  ```
453
+
442
454
  note: the above scripts changes ensure your app is handled by react-app-rewired scripts instead of react-scripts this way the webpack configuration will be acknowledged.
443
455
 
444
456
  ✅ 6. Import and Initialize Verified-Custody-Module and Start the application
445
457
  Using the instruction on Verified Custody Module Usage initialize the module to suit your app logic,
446
458
  You can start the application using:
459
+
447
460
  ```jsx
448
461
  npm start
449
462
  ```
463
+
450
464
  # React(Create React App) Folder Structure
465
+
451
466
  ```pgsql
452
467
  my-app/
453
468
  ├── node_modules/
@@ -461,29 +476,35 @@ my-app/
461
476
  ```
462
477
 
463
478
  # 🔄 React Native(Using Expo) Setup and Fixes
479
+
464
480
  ✅ 1. Initialize the Project
481
+
465
482
  ```jsx
466
483
  npx create-expo-app my-rn-app
467
484
  cd my-rn-app
468
485
  ```
469
486
 
470
487
  ✅ 2. Install required dependencies
488
+
471
489
  ```jsx
472
490
  npm react-native-get-random-values expo-font @react-native-async-storage/async-storage
473
491
  OR
474
492
  yarn add react-native-get-random-values expo-font @react-native-async-storage/async-storage
475
493
  ```
494
+
476
495
  ✅ 3. Install other dependencies for node polyfils
496
+
477
497
  ```jsx
478
- npm install --save-dev crypto-browserify stream-browserify assert stream-http https-browserify os-browserify url path-browserify vm-browserify buffer process
498
+ npm install --save-dev crypto-browserify stream-browserify assert stream-http https-browserify os-browserify url path-browserify vm-browserify buffer process
479
499
  OR
480
- yarn add crypto-browserify stream-browserify assert stream-http https-browserify os-browserify url path-browserify vm-browserify buffer process
500
+ yarn add crypto-browserify stream-browserify assert stream-http https-browserify os-browserify url path-browserify vm-browserify buffer process
481
501
  ```
502
+
482
503
  note: the above dependencies are required as external/peer dependencies for the module to work on react-native.
483
-
484
504
 
485
505
  ✅ 4. Modify the (tabs) index.js or index.ts
486
506
  In the app/(tabs) folder, open the index.js or index.ts file and add:
507
+
487
508
  ```jsx
488
509
  //index.js or index.ts
489
510
 
@@ -492,11 +513,13 @@ OR
492
513
  require("react-native-get-random-values")
493
514
  };
494
515
  ```
495
- note the react-native-get-random-values import needs to be on the first line of the file so this is import early before the custody module is used. The react-native-get-random-values is very important for node packages like crypto and various hashing/encryption functions to work.
516
+
517
+ note the react-native-get-random-values import needs to be on the first line of the file so this is import early before the custody module is used. The react-native-get-random-values is very important for node packages like crypto and various hashing/encryption functions to work.
496
518
 
497
519
  ✅ 6. Import and Initialize Verified-Custody-Module and Start the application
498
520
  Using the instruction on Verified Custody Module Usage initialize the module to suit your app logic,
499
521
  You can start the application using:
522
+
500
523
  ```jsx
501
524
  npm start(if your script is setup)
502
525
  OR
@@ -506,7 +529,9 @@ npx expo run:android (to start the application on android)
506
529
  OR
507
530
  npx expo run:ios (to start the application on ios)
508
531
  ```
532
+
509
533
  # React Native(With Expo) Folder Structure
534
+
510
535
  ```pgsql
511
536
  my-rn-app/
512
537
  ├── node_modules/
@@ -519,10 +544,12 @@ my-rn-app/
519
544
  ```
520
545
 
521
546
  # 🔄 Web Extension Setup and Fixes
547
+
522
548
  Web Extension has various setup procedures, any of the setup you decide to use will work fine with Verify Custody Module.
523
549
  It is important to know that Web extension are to be built like react app and therefore during build react native related dependencies should be ignored or set as external.
524
550
  This can be done using plugin on webpack.
525
551
  For Example:
552
+
526
553
  ```jsx
527
554
  plugins: [
528
555
  {
@@ -541,7 +568,7 @@ plugins: [
541
568
  return { external: true };
542
569
  }
543
570
  );
544
-
571
+
545
572
  ...Other polyfills
546
573
  },
547
574
  }
package/dist/index.d.mts CHANGED
@@ -37,6 +37,9 @@ interface VerifiedCustodyProps {
37
37
  name: string;
38
38
  };
39
39
  showLogoPage?: boolean;
40
+ rootTagId?: string;
41
+ rootExpandedWidth?: string;
42
+ rootExpandedHeight?: string;
40
43
  logoPageElement?: React.JSX.Element;
41
44
  logoTimeoutTime?: number;
42
45
  enablePhone?: boolean;
@@ -108,6 +111,9 @@ declare const FTUPage: (props: {
108
111
  dashbordElement?: React$1.ComponentType<{
109
112
  setIsLoading: React$1.Dispatch<React$1.SetStateAction<boolean>>;
110
113
  }>;
114
+ rootTagId?: string;
115
+ rootExpandedWidth?: string;
116
+ rootExpandedHeight?: string;
111
117
  }) => React$1.JSX.Element;
112
118
 
113
119
  declare const EnterPinPage: (props: {
@@ -162,6 +168,9 @@ declare const EnterPinPage: (props: {
162
168
  dashbordElement?: React$1.ComponentType<{
163
169
  setIsLoading: React$1.Dispatch<React$1.SetStateAction<boolean>>;
164
170
  }>;
171
+ rootTagId?: string;
172
+ rootExpandedWidth?: string;
173
+ rootExpandedHeight?: string;
165
174
  }) => React$1.JSX.Element;
166
175
 
167
176
  declare const CreatePinPage: (props: {
@@ -203,6 +212,9 @@ declare const CreatePinPage: (props: {
203
212
  txData?: any;
204
213
  helperFunctions?: VerifiedCustodyHelpers;
205
214
  isExistingUser?: boolean;
215
+ rootTagId?: string;
216
+ rootExpandedWidth?: string;
217
+ rootExpandedHeight?: string;
206
218
  }) => React$1.JSX.Element;
207
219
 
208
220
  declare const ContactPage: (props: {
package/dist/index.d.ts CHANGED
@@ -37,6 +37,9 @@ interface VerifiedCustodyProps {
37
37
  name: string;
38
38
  };
39
39
  showLogoPage?: boolean;
40
+ rootTagId?: string;
41
+ rootExpandedWidth?: string;
42
+ rootExpandedHeight?: string;
40
43
  logoPageElement?: React.JSX.Element;
41
44
  logoTimeoutTime?: number;
42
45
  enablePhone?: boolean;
@@ -108,6 +111,9 @@ declare const FTUPage: (props: {
108
111
  dashbordElement?: React$1.ComponentType<{
109
112
  setIsLoading: React$1.Dispatch<React$1.SetStateAction<boolean>>;
110
113
  }>;
114
+ rootTagId?: string;
115
+ rootExpandedWidth?: string;
116
+ rootExpandedHeight?: string;
111
117
  }) => React$1.JSX.Element;
112
118
 
113
119
  declare const EnterPinPage: (props: {
@@ -162,6 +168,9 @@ declare const EnterPinPage: (props: {
162
168
  dashbordElement?: React$1.ComponentType<{
163
169
  setIsLoading: React$1.Dispatch<React$1.SetStateAction<boolean>>;
164
170
  }>;
171
+ rootTagId?: string;
172
+ rootExpandedWidth?: string;
173
+ rootExpandedHeight?: string;
165
174
  }) => React$1.JSX.Element;
166
175
 
167
176
  declare const CreatePinPage: (props: {
@@ -203,6 +212,9 @@ declare const CreatePinPage: (props: {
203
212
  txData?: any;
204
213
  helperFunctions?: VerifiedCustodyHelpers;
205
214
  isExistingUser?: boolean;
215
+ rootTagId?: string;
216
+ rootExpandedWidth?: string;
217
+ rootExpandedHeight?: string;
206
218
  }) => React$1.JSX.Element;
207
219
 
208
220
  declare const ContactPage: (props: {