-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Switch from credential types to verification level (#202)
Co-authored-by: Paolo <[email protected]>
- Loading branch information
Showing
11 changed files
with
57 additions
and
35 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,11 +3,19 @@ type Brand<T, TBrand extends string> = T & { [brand]: TBrand } | |
|
||
export type AbiEncodedValue = Brand<{ types: string[]; values: unknown[] }, 'AbiEncodedValue'> | ||
|
||
/** | ||
* @deprecated in [email protected], use VerificationLevel instead | ||
*/ | ||
export enum CredentialType { | ||
Orb = 'orb', | ||
Device = 'device', | ||
} | ||
|
||
export enum VerificationLevel { | ||
Lite = 'lite', | ||
Orb = 'orb', | ||
} | ||
|
||
export type IDKitConfig = { | ||
/** Unique identifier for the app verifying the action. This should be the app ID obtained from the Developer Portal. */ | ||
app_id: `app_${string}` | ||
|
@@ -19,6 +27,6 @@ export type IDKitConfig = { | |
action?: AbiEncodedValue | string | ||
/** URL to a third-party bridge to use when connecting to the World App. Optional. */ | ||
bridge_url?: string | ||
/** An array of credential types to allow for verification. Will accept any combination of "orb" & "device". Defaults to orb. TypeScript apps can use the `CredentialType` enum. */ | ||
credential_types?: CredentialType[] // Accepted credentials for verification by the host app | ||
/** The minimum required level of verification. Defaults to "orb". */ | ||
verification_level?: VerificationLevel | ||
} |
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,3 +1,3 @@ | ||
export { ISuccessResult, IErrorState } from '@/types/result' | ||
export { AppErrorCodes, VerificationState } from '@/types/bridge' | ||
export { AbiEncodedValue, CredentialType, IDKitConfig } from '@/types/config' | ||
export { AbiEncodedValue, VerificationLevel, CredentialType, IDKitConfig } from '@/types/config' |
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,11 +1,11 @@ | ||
import useIDKit from './hooks/useIDKit' | ||
import SignInButton from './components/SignInButton' | ||
import { CredentialType } from '@worldcoin/idkit-core' | ||
import IDKitWidget from '@/components/IDKitWidget/index' | ||
import type { WidgetProps, Config } from '@/types/config' | ||
import { solidityEncode } from '@worldcoin/idkit-core/hashing' | ||
import SignInWithWorldID from './components/SignInWithWorldID' | ||
import type { ISuccessResult, IErrorState } from '@worldcoin/idkit-core' | ||
import { CredentialType, VerificationLevel } from '@worldcoin/idkit-core' | ||
|
||
export { IDKitWidget, useIDKit, solidityEncode, SignInWithWorldID, CredentialType, SignInButton } | ||
export { IDKitWidget, useIDKit, solidityEncode, SignInWithWorldID, CredentialType, SignInButton, VerificationLevel } | ||
export type { ISuccessResult, IErrorState, Config, WidgetProps } |
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