@huma-finance/widgets 0.0.61-beta.552 → 0.0.61-beta.557
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@huma-finance/widgets",
|
|
3
|
-
"version": "0.0.61-beta.
|
|
3
|
+
"version": "0.0.61-beta.557+74f273e",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"@ethersproject/experimental": "^5.7.0",
|
|
31
31
|
"@ethersproject/providers": "^5.6.0",
|
|
32
32
|
"@ethersproject/units": "^5.6.0",
|
|
33
|
-
"@huma-finance/sdk": "^0.0.
|
|
34
|
-
"@huma-finance/shared": "^0.0.
|
|
33
|
+
"@huma-finance/sdk": "^0.0.61-beta.557+74f273e",
|
|
34
|
+
"@huma-finance/shared": "^0.0.61-beta.557+74f273e",
|
|
35
35
|
"@huma-finance/web-shared": "^0.0.60",
|
|
36
36
|
"@mui/icons-material": "^5.3.0",
|
|
37
37
|
"@mui/material": "^5.0.6",
|
|
@@ -195,5 +195,5 @@
|
|
|
195
195
|
"optionalDependencies": {
|
|
196
196
|
"encoding": "^0.1.13"
|
|
197
197
|
},
|
|
198
|
-
"gitHead": "
|
|
198
|
+
"gitHead": "74f273e16aa7ff7994668961206fb93ec0405817"
|
|
199
199
|
}
|
|
@@ -158,12 +158,20 @@ export function PersonaEvaluation({
|
|
|
158
158
|
setInquiryId(verificationStatus.personaInquiryId)
|
|
159
159
|
|
|
160
160
|
switch (verificationStatus.status) {
|
|
161
|
-
case IdentityVerificationStatusV2.
|
|
161
|
+
case IdentityVerificationStatusV2.ACCREDITED: {
|
|
162
162
|
const startVerificationResult =
|
|
163
163
|
await IdentityServiceV2.startVerification(account, chainId, isDev)
|
|
164
164
|
setInquiryId(startVerificationResult.personaInquiryId)
|
|
165
165
|
setKYCCopy(KYCCopies.verifyIdentity)
|
|
166
166
|
setLoadingType(undefined)
|
|
167
|
+
if (
|
|
168
|
+
startVerificationResult.status ===
|
|
169
|
+
IdentityVerificationStatusV2.BYPASSED
|
|
170
|
+
) {
|
|
171
|
+
setVerificationStatus(startVerificationResult)
|
|
172
|
+
setKYCCopy(KYCCopies.verificationBypassed)
|
|
173
|
+
}
|
|
174
|
+
|
|
167
175
|
break
|
|
168
176
|
}
|
|
169
177
|
|
|
@@ -209,6 +217,13 @@ export function PersonaEvaluation({
|
|
|
209
217
|
break
|
|
210
218
|
}
|
|
211
219
|
|
|
220
|
+
case IdentityVerificationStatusV2.BYPASSED: {
|
|
221
|
+
setKYCCopy(KYCCopies.verificationBypassed)
|
|
222
|
+
setLoadingType(undefined)
|
|
223
|
+
|
|
224
|
+
break
|
|
225
|
+
}
|
|
226
|
+
|
|
212
227
|
case IdentityVerificationStatusV2.APPROVED: {
|
|
213
228
|
setKYCCopy(KYCCopies.verificationApproved)
|
|
214
229
|
setLoadingType(undefined)
|
|
@@ -299,7 +314,7 @@ export function PersonaEvaluation({
|
|
|
299
314
|
}
|
|
300
315
|
}, [showPersonaClient])
|
|
301
316
|
|
|
302
|
-
const startKYC = async () => {
|
|
317
|
+
const startKYC = useCallback(async () => {
|
|
303
318
|
isActionOngoingRef.current = true
|
|
304
319
|
isKYCResumedRef.current = false
|
|
305
320
|
setLoadingType('startKYC')
|
|
@@ -328,12 +343,29 @@ export function PersonaEvaluation({
|
|
|
328
343
|
setLoadingType(undefined)
|
|
329
344
|
},
|
|
330
345
|
})
|
|
331
|
-
}
|
|
346
|
+
}, [checkVerificationStatus, inquiryId, sessionToken])
|
|
347
|
+
|
|
348
|
+
// Start KYC flow directly
|
|
349
|
+
useEffect(() => {
|
|
350
|
+
if (verificationStatus) {
|
|
351
|
+
switch (verificationStatus.status) {
|
|
352
|
+
case IdentityVerificationStatusV2.ACCREDITED:
|
|
353
|
+
case IdentityVerificationStatusV2.CREATED:
|
|
354
|
+
case IdentityVerificationStatusV2.PENDING:
|
|
355
|
+
case IdentityVerificationStatusV2.EXPIRED:
|
|
356
|
+
startKYC()
|
|
357
|
+
break
|
|
358
|
+
|
|
359
|
+
default:
|
|
360
|
+
break
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
}, [startKYC, verificationStatus])
|
|
332
364
|
|
|
333
365
|
const handleAction = () => {
|
|
334
366
|
if (verificationStatus) {
|
|
335
367
|
switch (verificationStatus.status) {
|
|
336
|
-
case IdentityVerificationStatusV2.
|
|
368
|
+
case IdentityVerificationStatusV2.ACCREDITED:
|
|
337
369
|
case IdentityVerificationStatusV2.CREATED:
|
|
338
370
|
case IdentityVerificationStatusV2.PENDING:
|
|
339
371
|
case IdentityVerificationStatusV2.EXPIRED:
|
|
@@ -346,6 +378,10 @@ export function PersonaEvaluation({
|
|
|
346
378
|
handleClose(verificationStatus.status)
|
|
347
379
|
break
|
|
348
380
|
|
|
381
|
+
case IdentityVerificationStatusV2.BYPASSED:
|
|
382
|
+
handleClose(IdentityVerificationStatusV2.APPROVED)
|
|
383
|
+
break
|
|
384
|
+
|
|
349
385
|
default:
|
|
350
386
|
break
|
|
351
387
|
}
|