-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: rely on be to trigger face auth (#208)
- Loading branch information
Showing
21 changed files
with
178 additions
and
200 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,20 @@ | ||
// SPDX-License-Identifier: ice License 1.0 | ||
|
||
import {post} from '@api/client'; | ||
import {MiningSummary} from '@api/tokenomics/types'; | ||
import {FaceAuthKycNumber, MiningSummary} from '@api/tokenomics/types'; | ||
|
||
interface Params { | ||
userId: string; | ||
resurrect?: boolean | null; | ||
skipKYCStep?: FaceAuthKycNumber | null; | ||
} | ||
|
||
export function startMiningSession({userId, resurrect}: Params) { | ||
return post<{resurrect?: boolean | null}, MiningSummary | null>( | ||
`/tokenomics/${userId}/mining-sessions`, | ||
{resurrect}, | ||
); | ||
export function startMiningSession({userId, resurrect, skipKYCStep}: Params) { | ||
return post< | ||
{resurrect?: boolean | null; skipKYCSteps?: number[] | undefined}, | ||
MiningSummary | null | ||
>(`/tokenomics/${userId}/mining-sessions`, { | ||
resurrect, | ||
skipKYCSteps: skipKYCStep ? [skipKYCStep] : undefined, | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
// SPDX-License-Identifier: ice License 1.0 | ||
|
||
import {degreesToRadians} from '@utils/units'; | ||
import {VideoQuality} from 'expo-camera'; | ||
import {Platform} from 'react-native'; | ||
|
||
export const FACE_RECOGNITION_PICTURE_SIZE = 224; | ||
|
||
export const VIDEO_DURATION_SEC = 5; | ||
|
||
export const DEVICE_Y_ALLOWED_ROTATION_RADIANS = degreesToRadians(60); | ||
|
||
export const VIDEO_QUALITY = | ||
VideoQuality[Platform.OS === 'ios' ? '720p' : '480p']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
...nFlow/EmotionsAuthCameraFeed/components/GatherEmotionsStep/hooks/useGetVideoDimensions.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// SPDX-License-Identifier: ice License 1.0 | ||
|
||
import {getVideoDimensionsWithFFmpeg, VideoDimensions} from '@utils/ffmpeg'; | ||
import {useCallback, useRef} from 'react'; | ||
|
||
export function useGetVideoDimensions() { | ||
const videoDimensionsRef = useRef<VideoDimensions | null>(null); | ||
|
||
return useCallback(async (videoUri: string) => { | ||
if (!videoDimensionsRef.current) { | ||
videoDimensionsRef.current = await getVideoDimensionsWithFFmpeg(videoUri); | ||
} | ||
return videoDimensionsRef.current; | ||
}, []); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.