@verified-network/verified-custody 0.5.0 → 0.5.2
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 +18 -18
- package/dist/index.d.mts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -3
package/README.md
CHANGED
|
@@ -129,22 +129,22 @@ export type VerifiedWalletTx = {
|
|
|
129
129
|
export interface VerifiedCustodyHelpers {
|
|
130
130
|
sendCoSignerInvitation: (
|
|
131
131
|
channel: "sms" | "email",
|
|
132
|
-
|
|
132
|
+
coSignerId: string,
|
|
133
133
|
creatorId: string,
|
|
134
|
-
|
|
134
|
+
hashedCreatorPin: string
|
|
135
135
|
) => Promise<boolean>;
|
|
136
136
|
|
|
137
137
|
sendCreatorConfirmation: (
|
|
138
138
|
channel: "sms" | "email",
|
|
139
139
|
creatorId: string,
|
|
140
|
-
|
|
140
|
+
coSignersList: [],
|
|
141
141
|
requiredSigners: number
|
|
142
142
|
) => Promise<boolean>;
|
|
143
143
|
|
|
144
144
|
sendCreatorInitiation: (
|
|
145
145
|
channel: "sms" | "email",
|
|
146
146
|
creatorId: string,
|
|
147
|
-
|
|
147
|
+
hashedCreatorPin: string,
|
|
148
148
|
txId: number,
|
|
149
149
|
requiredSigners: number
|
|
150
150
|
) => Promise<boolean>;
|
|
@@ -190,10 +190,10 @@ export interface VerifiedCustodyHelpers {
|
|
|
190
190
|
Example:
|
|
191
191
|
sendCoSignerInvitation must take four parameters:
|
|
192
192
|
channel: "sms" | "email"
|
|
193
|
-
|
|
193
|
+
coSignerId: string (email or phone number of the co-signer)
|
|
194
194
|
phone number must be in format +{countryCode}{10DigitNumber} e.g. +1098765432
|
|
195
195
|
creatorId: string (email or phone number of the wallet creator)
|
|
196
|
-
|
|
196
|
+
hashedCreatorPin: string
|
|
197
197
|
It returns a Promise resolving to true on successful message delivery, otherwise false.
|
|
198
198
|
|
|
199
199
|
# 🚀 Full Workflow Example
|
|
@@ -205,16 +205,16 @@ import { VerifiedCustody } from "@verified-network/verified-custody";
|
|
|
205
205
|
function App() {
|
|
206
206
|
const myCustomSendCoSignerInvitation = async (
|
|
207
207
|
channel: "sms" | "email",
|
|
208
|
-
|
|
208
|
+
coSignerId: string,
|
|
209
209
|
creatorId: string,
|
|
210
|
-
|
|
210
|
+
hashedCreatorPin: string
|
|
211
211
|
): Promise<boolean> => {
|
|
212
212
|
try {
|
|
213
213
|
if (channel === "sms") {
|
|
214
|
-
// send SMS to
|
|
214
|
+
// send SMS to coSignerId with creatorId and hashedCreatorPin
|
|
215
215
|
return true;
|
|
216
216
|
} else if (channel === "email") {
|
|
217
|
-
// send email to
|
|
217
|
+
// send email to coSignerId with creatorId and hashedCreatorPin
|
|
218
218
|
return true;
|
|
219
219
|
}
|
|
220
220
|
return false;
|
|
@@ -226,7 +226,7 @@ function App() {
|
|
|
226
226
|
const myCustomSendCreatorConfirmation = async (
|
|
227
227
|
channel: "sms" | "email",
|
|
228
228
|
creatorId: string,
|
|
229
|
-
|
|
229
|
+
coSignersList: [],
|
|
230
230
|
requiredSigners: number
|
|
231
231
|
): Promise<boolean> => {
|
|
232
232
|
try {
|
|
@@ -275,9 +275,9 @@ import { FTUPage } from "@verified-network/verified-custody";
|
|
|
275
275
|
function App() {
|
|
276
276
|
const myCustomSendCoSignerInvitation = async (
|
|
277
277
|
channel: "sms" | "email",
|
|
278
|
-
|
|
278
|
+
coSignerId: string,
|
|
279
279
|
creatorId: string,
|
|
280
|
-
|
|
280
|
+
hashedCreatorPin: string
|
|
281
281
|
): Promise<boolean> => {
|
|
282
282
|
// Implementation as above
|
|
283
283
|
};
|
|
@@ -285,7 +285,7 @@ function App() {
|
|
|
285
285
|
const myCustomSendCreatorConfirmation = async (
|
|
286
286
|
channel: "sms" | "email",
|
|
287
287
|
creatorId: string,
|
|
288
|
-
|
|
288
|
+
coSignersList: [],
|
|
289
289
|
requiredSigners: number
|
|
290
290
|
): Promise<boolean> => {
|
|
291
291
|
// Implementation as above
|
|
@@ -318,9 +318,9 @@ import { EnterPinPage } from "@verified-network/verified-custody";
|
|
|
318
318
|
function App() {
|
|
319
319
|
const myCustomSendCoSignerInvitation = async (
|
|
320
320
|
channel: "sms" | "email",
|
|
321
|
-
|
|
321
|
+
coSignerId: string,
|
|
322
322
|
creatorId: string,
|
|
323
|
-
|
|
323
|
+
hashedCreatorPin: string
|
|
324
324
|
): Promise<boolean> => {
|
|
325
325
|
// Implementation as above
|
|
326
326
|
};
|
|
@@ -328,7 +328,7 @@ function App() {
|
|
|
328
328
|
const myCustomSendCreatorConfirmation = async (
|
|
329
329
|
channel: "sms" | "email",
|
|
330
330
|
creatorId: string,
|
|
331
|
-
|
|
331
|
+
coSignersList: [],
|
|
332
332
|
requiredSigners: number
|
|
333
333
|
): Promise<boolean> => {
|
|
334
334
|
// Implementation as above
|
|
@@ -428,7 +428,7 @@ module.exports = function override(config) {
|
|
|
428
428
|
};
|
|
429
429
|
```
|
|
430
430
|
|
|
431
|
-
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
|
|
431
|
+
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 break our react app.
|
|
432
432
|
|
|
433
433
|
✅ 5. Modify package.json Scripts
|
|
434
434
|
In your package.json, replace this:
|
package/dist/index.d.mts
CHANGED
|
@@ -36,6 +36,7 @@ interface VerifiedCustodyProps {
|
|
|
36
36
|
flag: string;
|
|
37
37
|
name: string;
|
|
38
38
|
};
|
|
39
|
+
passKeyRpId?: string;
|
|
39
40
|
showLogoPage?: boolean;
|
|
40
41
|
rootTagId?: string;
|
|
41
42
|
rootExpandedWidth?: string;
|
|
@@ -118,6 +119,7 @@ declare const FTUPage: (props: {
|
|
|
118
119
|
rootTagId?: string;
|
|
119
120
|
rootExpandedWidth?: string;
|
|
120
121
|
rootExpandedHeight?: string;
|
|
122
|
+
passKeyRpId?: string;
|
|
121
123
|
}) => React$1.JSX.Element;
|
|
122
124
|
|
|
123
125
|
declare const EnterPinPage: (props: {
|
|
@@ -177,6 +179,7 @@ declare const EnterPinPage: (props: {
|
|
|
177
179
|
rootTagId?: string;
|
|
178
180
|
rootExpandedWidth?: string;
|
|
179
181
|
rootExpandedHeight?: string;
|
|
182
|
+
passKeyRpId?: string;
|
|
180
183
|
}) => React$1.JSX.Element;
|
|
181
184
|
|
|
182
185
|
declare const CreatePinPage: (props: {
|
|
@@ -223,6 +226,7 @@ declare const CreatePinPage: (props: {
|
|
|
223
226
|
rootTagId?: string;
|
|
224
227
|
rootExpandedWidth?: string;
|
|
225
228
|
rootExpandedHeight?: string;
|
|
229
|
+
passKeyRpId?: string;
|
|
226
230
|
}) => React$1.JSX.Element;
|
|
227
231
|
|
|
228
232
|
declare const ContactPage: (props: {
|
|
@@ -357,7 +361,7 @@ declare const hashTheString: (text: string) => string;
|
|
|
357
361
|
declare const hashTheBuffer: (buffer: ArrayBuffer | Uint8Array) => string;
|
|
358
362
|
declare const encryptString: (text: string, secretKey: string) => string;
|
|
359
363
|
declare const decryptString: (encryptedText: string, secretKey: string) => string;
|
|
360
|
-
declare const publicKeyCredentialRequestOptions: () => any;
|
|
364
|
+
declare const publicKeyCredentialRequestOptions: (rpId?: string) => any;
|
|
361
365
|
declare const encryptWithPasskey: (plaintext: string, rawId: ArrayBuffer | Uint8Array, // allow both ArrayBuffer or Uint8Array
|
|
362
366
|
rawIdString: string) => Promise<string>;
|
|
363
367
|
declare const decryptWithPasskey: (encryptedString: string, rawId: ArrayBuffer | Uint8Array) => Promise<string>;
|
package/dist/index.d.ts
CHANGED
|
@@ -36,6 +36,7 @@ interface VerifiedCustodyProps {
|
|
|
36
36
|
flag: string;
|
|
37
37
|
name: string;
|
|
38
38
|
};
|
|
39
|
+
passKeyRpId?: string;
|
|
39
40
|
showLogoPage?: boolean;
|
|
40
41
|
rootTagId?: string;
|
|
41
42
|
rootExpandedWidth?: string;
|
|
@@ -118,6 +119,7 @@ declare const FTUPage: (props: {
|
|
|
118
119
|
rootTagId?: string;
|
|
119
120
|
rootExpandedWidth?: string;
|
|
120
121
|
rootExpandedHeight?: string;
|
|
122
|
+
passKeyRpId?: string;
|
|
121
123
|
}) => React$1.JSX.Element;
|
|
122
124
|
|
|
123
125
|
declare const EnterPinPage: (props: {
|
|
@@ -177,6 +179,7 @@ declare const EnterPinPage: (props: {
|
|
|
177
179
|
rootTagId?: string;
|
|
178
180
|
rootExpandedWidth?: string;
|
|
179
181
|
rootExpandedHeight?: string;
|
|
182
|
+
passKeyRpId?: string;
|
|
180
183
|
}) => React$1.JSX.Element;
|
|
181
184
|
|
|
182
185
|
declare const CreatePinPage: (props: {
|
|
@@ -223,6 +226,7 @@ declare const CreatePinPage: (props: {
|
|
|
223
226
|
rootTagId?: string;
|
|
224
227
|
rootExpandedWidth?: string;
|
|
225
228
|
rootExpandedHeight?: string;
|
|
229
|
+
passKeyRpId?: string;
|
|
226
230
|
}) => React$1.JSX.Element;
|
|
227
231
|
|
|
228
232
|
declare const ContactPage: (props: {
|
|
@@ -357,7 +361,7 @@ declare const hashTheString: (text: string) => string;
|
|
|
357
361
|
declare const hashTheBuffer: (buffer: ArrayBuffer | Uint8Array) => string;
|
|
358
362
|
declare const encryptString: (text: string, secretKey: string) => string;
|
|
359
363
|
declare const decryptString: (encryptedText: string, secretKey: string) => string;
|
|
360
|
-
declare const publicKeyCredentialRequestOptions: () => any;
|
|
364
|
+
declare const publicKeyCredentialRequestOptions: (rpId?: string) => any;
|
|
361
365
|
declare const encryptWithPasskey: (plaintext: string, rawId: ArrayBuffer | Uint8Array, // allow both ArrayBuffer or Uint8Array
|
|
362
366
|
rawIdString: string) => Promise<string>;
|
|
363
367
|
declare const decryptWithPasskey: (encryptedString: string, rawId: ArrayBuffer | Uint8Array) => Promise<string>;
|