@verified-network/verified-custody 0.1.8 → 0.2.0

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 (65) hide show
  1. package/babel.config.json +12 -0
  2. package/dist/index.d.mts +165 -0
  3. package/dist/index.d.ts +165 -0
  4. package/dist/index.js +3 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/index.mjs +3 -0
  7. package/dist/index.mjs.map +1 -0
  8. package/package.json +31 -38
  9. package/src/components/overlays.tsx +61 -0
  10. package/src/components/search.tsx +381 -0
  11. package/src/components/slider.tsx +29 -0
  12. package/src/components/success.tsx +142 -0
  13. package/src/customTypes.d.ts +37 -0
  14. package/src/index.ts +17 -0
  15. package/src/pages/addCosigners.tsx +1014 -0
  16. package/src/pages/contact.tsx +280 -0
  17. package/src/pages/createPin.tsx +693 -0
  18. package/src/pages/enterPin.tsx +821 -0
  19. package/src/pages/ftu.tsx +244 -0
  20. package/src/pages/index.tsx +170 -0
  21. package/src/pages/otp.tsx +410 -0
  22. package/src/services/contracts.ts +817 -0
  23. package/src/services/store.tsx +65 -0
  24. package/src/style.css +2030 -0
  25. package/src/utils/config.ts +103 -0
  26. package/src/utils/constants.ts +1966 -0
  27. package/src/utils/helpers.tsx +334 -0
  28. package/src/utils/types.ts +85 -0
  29. package/tsconfig.json +16 -0
  30. package/tsup.config.ts +36 -0
  31. package/README.md +0 -93
  32. package/dist/assets/icon128.png +0 -0
  33. package/dist/assets/icon16.png +0 -0
  34. package/dist/assets/icon32.png +0 -0
  35. package/dist/assets/icon48.png +0 -0
  36. package/dist/autoreload-bg.1777342b.js +0 -392
  37. package/dist/autoreload.af9e0afa.js +0 -393
  38. package/dist/main.js +0 -2
  39. package/dist/main.js.LICENSE.txt +0 -190
  40. package/dist/manifest.json +0 -39
  41. package/dist/src/scripts/background.js +0 -866
  42. package/dist/src/scripts/content.js +0 -22029
  43. package/dist/src/static/options.b1269179.js +0 -22033
  44. package/dist/src/static/options.html +0 -9
  45. package/dist/src/static/popup.e3c8c7b7.js +0 -22043
  46. package/dist/src/static/popup.html +0 -9
  47. package/dist/webext-prod/assets/icon128.png +0 -0
  48. package/dist/webext-prod/assets/icon16.png +0 -0
  49. package/dist/webext-prod/assets/icon32.png +0 -0
  50. package/dist/webext-prod/assets/icon48.png +0 -0
  51. package/dist/webext-prod/manifest.json +0 -36
  52. package/dist/webext-prod/src/scripts/background.js +0 -2
  53. package/dist/webext-prod/src/scripts/background.js.map +0 -1
  54. package/dist/webext-prod/src/scripts/content.js +0 -35
  55. package/dist/webext-prod/src/scripts/content.js.map +0 -1
  56. package/dist/webext-prod/src/static/options.a111dcd9.js +0 -2
  57. package/dist/webext-prod/src/static/options.a111dcd9.js.map +0 -1
  58. package/dist/webext-prod/src/static/options.html +0 -1
  59. package/dist/webext-prod/src/static/popup.70071e3e.js +0 -35
  60. package/dist/webext-prod/src/static/popup.70071e3e.js.map +0 -1
  61. package/dist/webext-prod/src/static/popup.cc04f56e.js +0 -2
  62. package/dist/webext-prod/src/static/popup.cc04f56e.js.map +0 -1
  63. package/dist/webext-prod/src/static/popup.e8a65b8a.js +0 -35
  64. package/dist/webext-prod/src/static/popup.e8a65b8a.js.map +0 -1
  65. package/dist/webext-prod/src/static/popup.html +0 -1
@@ -0,0 +1,12 @@
1
+ {
2
+ "presets": [
3
+ ["@babel/preset-env", {
4
+ "useBuiltIns": "entry",
5
+ "corejs": 3
6
+ }],
7
+ "@babel/preset-react"
8
+ ],
9
+ "plugins": [
10
+ "@babel/plugin-transform-runtime"
11
+ ]
12
+ }
@@ -0,0 +1,165 @@
1
+ import React$1 from 'react';
2
+
3
+ type VerifiedWalletAction = "connect_wallet" | "getPk" | "invitation" | "signRecovery" | "completeRecovery";
4
+ type VerifiedWalletVault = {
5
+ vaultId: string;
6
+ hashedVaultId?: string;
7
+ hashedVaultPin?: string;
8
+ CoSignerId?: string;
9
+ vId?: string;
10
+ vPh?: string;
11
+ cId?: string;
12
+ address?: string;
13
+ channel?: "sms" | "email";
14
+ pk?: string;
15
+ };
16
+ type VerifiedWalletTx = {
17
+ id: string;
18
+ };
19
+ interface VerifiedCustodyProps {
20
+ action?: VerifiedWalletAction;
21
+ actionText?: string;
22
+ origin?: string;
23
+ title?: string;
24
+ chainId?: number;
25
+ vaultData?: VerifiedWalletVault;
26
+ txData?: VerifiedWalletTx;
27
+ reqVaultData?: VerifiedWalletVault;
28
+ delayPageElement?: React.JSX.Element;
29
+ delayPageStyle?: React.CSSProperties;
30
+ helperFunctions?: VerifiedCustodyHelpers;
31
+ }
32
+ interface VerifiedCustodyHelpers {
33
+ sendCoSignerInvitation: (channel: "sms" | "email", cosigerId: string, cretorId: string, hashedCretorPin: string) => Promise<boolean>;
34
+ sendCreatorConfirmation: (channel: "sms" | "email", cretorId: string, cosigersList: [], requiredSigners: number) => Promise<boolean>;
35
+ sendCreatorInitiation: (channel: "sms" | "email", cretorId: string, hashedCretorPin: string, txId: number, requiredSigners: number) => Promise<boolean>;
36
+ sendCreatorSigned: (channel: "sms" | "email", cretorId: string, coSignerId: string) => Promise<boolean>;
37
+ sendCreatorCompleted: (channel: "sms" | "email", cretorId: string, txId: number) => Promise<boolean>;
38
+ sendCreatorAcceptance: (channel: "sms" | "email", creatorId: string, coSignerId: string) => Promise<boolean>;
39
+ sendCreatorRejection: (channel: "sms" | "email", creatorId: string, coSignerId: string) => Promise<boolean>;
40
+ }
41
+
42
+ declare const VerifiedCustody: (props: VerifiedCustodyProps) => React$1.JSX.Element;
43
+
44
+ declare const FTUPage: (props: {
45
+ fontsLoaded?: boolean;
46
+ popupView?: boolean;
47
+ action?: string;
48
+ vaultData?: any;
49
+ txData?: any;
50
+ chainId?: number;
51
+ defaultCountry?: {
52
+ area: string;
53
+ flag: string;
54
+ name: string;
55
+ };
56
+ showLogoPage?: boolean;
57
+ logoPageElement?: React$1.JSX.Element;
58
+ logoTimeoutTime?: number;
59
+ showStartupPage?: boolean;
60
+ startupPageElement?: React$1.JSX.Element;
61
+ setisOnboard?: (isOnboard: boolean) => void;
62
+ helperFunctions?: VerifiedCustodyHelpers;
63
+ }) => React$1.JSX.Element;
64
+
65
+ declare const EnterPinPage: (props: {
66
+ fontsLoaded?: boolean;
67
+ setisOnboard: (isOnboard: boolean) => void;
68
+ vaultId: string;
69
+ hashedVaultId: string;
70
+ encrptedPk: string;
71
+ vaultAddress: string;
72
+ vaultChannel: "sms" | "email";
73
+ actionText?: string;
74
+ title?: string;
75
+ origin?: string;
76
+ chainId?: number;
77
+ newChainId?: number;
78
+ action?: string;
79
+ reqVaultData?: any;
80
+ reqTxData?: any;
81
+ setIsLoading: (isLoading: boolean) => void;
82
+ helperFunctions?: VerifiedCustodyHelpers;
83
+ }) => React$1.JSX.Element;
84
+
85
+ declare const CreatePinPage: (props: {
86
+ setStep: (step: string) => void;
87
+ setIsLoading: (isLoading: boolean) => void;
88
+ setShowSuccessBtn: (showSuccessBtn: boolean) => void;
89
+ setSuccessBtnText: (successBtnText: string) => void;
90
+ setSuccessBtnNeutText: (successBtnNeutText: string) => void;
91
+ setSuccessBtnFunc: (successBtnFunc: any) => void;
92
+ setSuccessBtnNeutFunc: (successBtnNeutFunc: any) => void;
93
+ setActionHeaderText: (actionHeaderText: string) => void;
94
+ setActionFooterText: (actionFooterText: string) => void;
95
+ userNumberFmt: string;
96
+ userEmail: string;
97
+ selectedCountry: {
98
+ name: string;
99
+ area: string;
100
+ flag: string;
101
+ };
102
+ action?: string;
103
+ vaultData?: any;
104
+ txData?: any;
105
+ helperFunctions?: VerifiedCustodyHelpers;
106
+ }) => React$1.JSX.Element;
107
+
108
+ declare const ContactPage: (props: {
109
+ setStep: (step: string) => void;
110
+ setIsLoading: (isLoading: boolean) => void;
111
+ setUserNumberFmt: (number: string) => void;
112
+ userNumberFmt: string;
113
+ setUserEmail: (email: string) => void;
114
+ userEmail: string;
115
+ setSelectedCountry: (country: {
116
+ name: string;
117
+ area: string;
118
+ flag: string;
119
+ }) => void;
120
+ selectedCountry: {
121
+ name: string;
122
+ area: string;
123
+ flag: string;
124
+ };
125
+ allCountries: any;
126
+ }) => React$1.JSX.Element;
127
+
128
+ declare const OTPPage: (props: {
129
+ setStep: (step: string) => void;
130
+ setIsLoading: (isLoading: boolean) => void;
131
+ setUserNumberFmt: (number: string) => void;
132
+ setUserEmail: (email: string) => void;
133
+ selectedCountry: {
134
+ name: string;
135
+ area: string;
136
+ flag: string;
137
+ };
138
+ userNumberFmt: string;
139
+ userEmail: string;
140
+ }) => React$1.JSX.Element;
141
+
142
+ declare const AddCosignersPage: (props: {
143
+ setStep: (step: string) => void;
144
+ setIsLoading: (isLoading: boolean) => void;
145
+ userNumberFmt: string;
146
+ userEmail: string;
147
+ selectedCountry: {
148
+ name: string;
149
+ area: string;
150
+ flag: string;
151
+ };
152
+ allCountries: any;
153
+ defaultCountry?: {
154
+ area: string;
155
+ flag: string;
156
+ name: string;
157
+ };
158
+ helperFunctions?: VerifiedCustodyHelpers;
159
+ }) => React$1.JSX.Element;
160
+
161
+ declare const hashTheString: (text: string) => string;
162
+ declare const encryptString: (text: string, secretKey: string) => string;
163
+ declare const decryptString: (encryptedText: string, secretKey: string) => string;
164
+
165
+ export { AddCosignersPage as AddCoSignersPage, ContactPage, CreatePinPage, EnterPinPage, FTUPage, OTPPage, VerifiedCustody, decryptString, encryptString, hashTheString };
@@ -0,0 +1,165 @@
1
+ import React$1 from 'react';
2
+
3
+ type VerifiedWalletAction = "connect_wallet" | "getPk" | "invitation" | "signRecovery" | "completeRecovery";
4
+ type VerifiedWalletVault = {
5
+ vaultId: string;
6
+ hashedVaultId?: string;
7
+ hashedVaultPin?: string;
8
+ CoSignerId?: string;
9
+ vId?: string;
10
+ vPh?: string;
11
+ cId?: string;
12
+ address?: string;
13
+ channel?: "sms" | "email";
14
+ pk?: string;
15
+ };
16
+ type VerifiedWalletTx = {
17
+ id: string;
18
+ };
19
+ interface VerifiedCustodyProps {
20
+ action?: VerifiedWalletAction;
21
+ actionText?: string;
22
+ origin?: string;
23
+ title?: string;
24
+ chainId?: number;
25
+ vaultData?: VerifiedWalletVault;
26
+ txData?: VerifiedWalletTx;
27
+ reqVaultData?: VerifiedWalletVault;
28
+ delayPageElement?: React.JSX.Element;
29
+ delayPageStyle?: React.CSSProperties;
30
+ helperFunctions?: VerifiedCustodyHelpers;
31
+ }
32
+ interface VerifiedCustodyHelpers {
33
+ sendCoSignerInvitation: (channel: "sms" | "email", cosigerId: string, cretorId: string, hashedCretorPin: string) => Promise<boolean>;
34
+ sendCreatorConfirmation: (channel: "sms" | "email", cretorId: string, cosigersList: [], requiredSigners: number) => Promise<boolean>;
35
+ sendCreatorInitiation: (channel: "sms" | "email", cretorId: string, hashedCretorPin: string, txId: number, requiredSigners: number) => Promise<boolean>;
36
+ sendCreatorSigned: (channel: "sms" | "email", cretorId: string, coSignerId: string) => Promise<boolean>;
37
+ sendCreatorCompleted: (channel: "sms" | "email", cretorId: string, txId: number) => Promise<boolean>;
38
+ sendCreatorAcceptance: (channel: "sms" | "email", creatorId: string, coSignerId: string) => Promise<boolean>;
39
+ sendCreatorRejection: (channel: "sms" | "email", creatorId: string, coSignerId: string) => Promise<boolean>;
40
+ }
41
+
42
+ declare const VerifiedCustody: (props: VerifiedCustodyProps) => React$1.JSX.Element;
43
+
44
+ declare const FTUPage: (props: {
45
+ fontsLoaded?: boolean;
46
+ popupView?: boolean;
47
+ action?: string;
48
+ vaultData?: any;
49
+ txData?: any;
50
+ chainId?: number;
51
+ defaultCountry?: {
52
+ area: string;
53
+ flag: string;
54
+ name: string;
55
+ };
56
+ showLogoPage?: boolean;
57
+ logoPageElement?: React$1.JSX.Element;
58
+ logoTimeoutTime?: number;
59
+ showStartupPage?: boolean;
60
+ startupPageElement?: React$1.JSX.Element;
61
+ setisOnboard?: (isOnboard: boolean) => void;
62
+ helperFunctions?: VerifiedCustodyHelpers;
63
+ }) => React$1.JSX.Element;
64
+
65
+ declare const EnterPinPage: (props: {
66
+ fontsLoaded?: boolean;
67
+ setisOnboard: (isOnboard: boolean) => void;
68
+ vaultId: string;
69
+ hashedVaultId: string;
70
+ encrptedPk: string;
71
+ vaultAddress: string;
72
+ vaultChannel: "sms" | "email";
73
+ actionText?: string;
74
+ title?: string;
75
+ origin?: string;
76
+ chainId?: number;
77
+ newChainId?: number;
78
+ action?: string;
79
+ reqVaultData?: any;
80
+ reqTxData?: any;
81
+ setIsLoading: (isLoading: boolean) => void;
82
+ helperFunctions?: VerifiedCustodyHelpers;
83
+ }) => React$1.JSX.Element;
84
+
85
+ declare const CreatePinPage: (props: {
86
+ setStep: (step: string) => void;
87
+ setIsLoading: (isLoading: boolean) => void;
88
+ setShowSuccessBtn: (showSuccessBtn: boolean) => void;
89
+ setSuccessBtnText: (successBtnText: string) => void;
90
+ setSuccessBtnNeutText: (successBtnNeutText: string) => void;
91
+ setSuccessBtnFunc: (successBtnFunc: any) => void;
92
+ setSuccessBtnNeutFunc: (successBtnNeutFunc: any) => void;
93
+ setActionHeaderText: (actionHeaderText: string) => void;
94
+ setActionFooterText: (actionFooterText: string) => void;
95
+ userNumberFmt: string;
96
+ userEmail: string;
97
+ selectedCountry: {
98
+ name: string;
99
+ area: string;
100
+ flag: string;
101
+ };
102
+ action?: string;
103
+ vaultData?: any;
104
+ txData?: any;
105
+ helperFunctions?: VerifiedCustodyHelpers;
106
+ }) => React$1.JSX.Element;
107
+
108
+ declare const ContactPage: (props: {
109
+ setStep: (step: string) => void;
110
+ setIsLoading: (isLoading: boolean) => void;
111
+ setUserNumberFmt: (number: string) => void;
112
+ userNumberFmt: string;
113
+ setUserEmail: (email: string) => void;
114
+ userEmail: string;
115
+ setSelectedCountry: (country: {
116
+ name: string;
117
+ area: string;
118
+ flag: string;
119
+ }) => void;
120
+ selectedCountry: {
121
+ name: string;
122
+ area: string;
123
+ flag: string;
124
+ };
125
+ allCountries: any;
126
+ }) => React$1.JSX.Element;
127
+
128
+ declare const OTPPage: (props: {
129
+ setStep: (step: string) => void;
130
+ setIsLoading: (isLoading: boolean) => void;
131
+ setUserNumberFmt: (number: string) => void;
132
+ setUserEmail: (email: string) => void;
133
+ selectedCountry: {
134
+ name: string;
135
+ area: string;
136
+ flag: string;
137
+ };
138
+ userNumberFmt: string;
139
+ userEmail: string;
140
+ }) => React$1.JSX.Element;
141
+
142
+ declare const AddCosignersPage: (props: {
143
+ setStep: (step: string) => void;
144
+ setIsLoading: (isLoading: boolean) => void;
145
+ userNumberFmt: string;
146
+ userEmail: string;
147
+ selectedCountry: {
148
+ name: string;
149
+ area: string;
150
+ flag: string;
151
+ };
152
+ allCountries: any;
153
+ defaultCountry?: {
154
+ area: string;
155
+ flag: string;
156
+ name: string;
157
+ };
158
+ helperFunctions?: VerifiedCustodyHelpers;
159
+ }) => React$1.JSX.Element;
160
+
161
+ declare const hashTheString: (text: string) => string;
162
+ declare const encryptString: (text: string, secretKey: string) => string;
163
+ declare const decryptString: (encryptedText: string, secretKey: string) => string;
164
+
165
+ export { AddCosignersPage as AddCoSignersPage, ContactPage, CreatePinPage, EnterPinPage, FTUPage, OTPPage, VerifiedCustody, decryptString, encryptString, hashTheString };