@worldcoin/idkit 0.0.2 → 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.
@@ -9,7 +9,7 @@ export type Config = {
9
9
  signal: StringOrAdvanced;
10
10
  actionId: StringOrAdvanced;
11
11
  autoClose?: boolean;
12
- onSuccess?: CallbackFn;
12
+ onVerification?: CallbackFn;
13
13
  enableTelemetry?: boolean;
14
14
  copy?: {
15
15
  title?: string;
@@ -2,9 +2,11 @@ export declare enum IDKITStage {
2
2
  ENTER_PHONE = "ENTER_PHONE",
3
3
  ENTER_CODE = "ENTER_CODE",
4
4
  WORLD_ID = "WORLD_ID",
5
+ PRIVACY = "PRIVACY",
5
6
  SUCCESS = "SUCCESS",
6
7
  ERROR = "ERROR",
7
- ABOUT = "ABOUT"
8
+ ABOUT = "ABOUT",
9
+ HOST_APP_VERIFICATION = "HOST_APP_VERIFICATION"
8
10
  }
9
11
  export interface OrbSignalProof {
10
12
  merkle_root: string;
@@ -23,12 +25,28 @@ export interface ISuccessResult {
23
25
  proof_payload: OrbSignalProof | PhoneSignalProof;
24
26
  nullifier_hash: string;
25
27
  }
26
- export type CallbackFn = (result: ISuccessResult) => void;
27
- export declare enum ErrorState {
28
+ export type CallbackFn = (result: ISuccessResult) => Promise<void> | void;
29
+ export interface IErrorState {
30
+ code: ErrorCodes;
31
+ message?: string;
32
+ }
33
+ export declare enum ErrorCodes {
28
34
  GENERIC_ERROR = "GENERIC_ERROR",
29
- INVALID_CODE = "INVALID_CODE"
35
+ PHONE_OTP_REQUEST_ERROR = "PHONE_OTP_REQUEST_ERROR",
36
+ INVALID_CODE = "INVALID_CODE",
37
+ REJECTED_BY_HOST_APP = "REJECTED_BY_HOST_APP"
30
38
  }
31
39
  export interface ExpectedErrorResponse {
32
40
  message: string;
33
41
  stack: string;
34
42
  }
43
+ export declare enum PhoneVerificationChannel {
44
+ SMS = "sms",
45
+ Call = "call"
46
+ }
47
+ export declare enum PhoneRequestErrorCodes {
48
+ MAX_ATTEMPTS = "max_attempts",
49
+ TIMEOUT = "timeout",
50
+ UNSUPPORTED_COUNTRY = "unsupported_country",
51
+ SERVER_ERROR = "server_error"
52
+ }
@@ -1,4 +1,4 @@
1
- export declare enum ErrorCodes {
1
+ export declare enum OrbErrorCodes {
2
2
  ConnectionFailed = "connection_failed",
3
3
  VerificationRejected = "verification_rejected",
4
4
  AlreadySigned = "already_signed",
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "The identity SDK. Add sybil resistance to your apps through the World ID protocol.",
4
4
  "type": "module",
5
5
  "types": "./build/index.d.ts",
6
- "version": "0.0.2",
6
+ "version": "0.2.0",
7
7
  "private": false,
8
8
  "main": "./build/index.cjs",
9
9
  "module": "./build/index.js",