@worldcoin/idkit-core 4.0.13 → 4.0.15-dev.0587d15
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 +9 -5
- package/dist/idkit_wasm_bg.wasm +0 -0
- package/dist/index.cjs +1352 -1307
- package/dist/index.d.cts +88 -79
- package/dist/index.d.ts +88 -79
- package/dist/index.js +1352 -1308
- package/dist/signing.d.cts +1 -1
- package/dist/signing.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { RpSignature, signRequest } from '@worldcoin/idkit-server';
|
|
1
|
+
export { RpSignature, SignRequestParams, signRequest } from '@worldcoin/idkit-server';
|
|
2
2
|
export { hashSignal } from './hashing.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -47,6 +47,8 @@ type IDKitRequestConfig = {
|
|
|
47
47
|
action_description?: string;
|
|
48
48
|
/** URL to a third-party bridge to use when connecting to the World App. Optional. */
|
|
49
49
|
bridge_url?: string;
|
|
50
|
+
/** Optional deep-link callback URL appended as `return_to` on the connector URL. */
|
|
51
|
+
return_to?: string;
|
|
50
52
|
/**
|
|
51
53
|
* Whether to accept legacy (v3) World ID proofs as fallback.
|
|
52
54
|
*
|
|
@@ -77,68 +79,17 @@ type IDKitSessionConfig = {
|
|
|
77
79
|
action_description?: string;
|
|
78
80
|
/** URL to a third-party bridge to use when connecting to the World App. Optional. */
|
|
79
81
|
bridge_url?: string;
|
|
82
|
+
/** Optional deep-link callback URL appended as `return_to` on the connector URL. */
|
|
83
|
+
return_to?: string;
|
|
80
84
|
/** Optional override for the connect base URL (e.g., for staging environments) */
|
|
81
85
|
override_connect_base_url?: string;
|
|
82
86
|
/** Optional environment override. Defaults to "production". */
|
|
83
87
|
environment?: "production" | "staging";
|
|
84
88
|
};
|
|
85
89
|
|
|
86
|
-
interface OrbLegacyPreset {
|
|
87
|
-
/** This preset only returns World ID 3.0 proofs. Use it for compatibility with older IDKit versions. */
|
|
88
|
-
type: "OrbLegacy";
|
|
89
|
-
signal?: string;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
interface SecureDocumentLegacyPreset {
|
|
93
|
-
/** This preset only returns World ID 3.0 proofs. Use it for compatibility with older IDKit versions. */
|
|
94
|
-
type: "SecureDocumentLegacy";
|
|
95
|
-
signal?: string;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
interface DocumentLegacyPreset {
|
|
99
|
-
/** This preset only returns World ID 3.0 proofs. Use it for compatibility with older IDKit versions. */
|
|
100
|
-
type: "DocumentLegacy";
|
|
101
|
-
signal?: string;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
interface SelfieCheckLegacyPreset {
|
|
105
|
-
/** This preset only returns World ID 3.0 proofs. Use it for compatibility with older IDKit versions. */
|
|
106
|
-
/** Preview: Selfie Check is currently in preview. Contact us if you need it enabled. */
|
|
107
|
-
type: "SelfieCheckLegacy";
|
|
108
|
-
signal?: string;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
interface DeviceLegacyPreset {
|
|
112
|
-
/** This preset only returns World ID 3.0 proofs. Use it for compatibility with older IDKit versions. */
|
|
113
|
-
type: "DeviceLegacy";
|
|
114
|
-
signal?: string;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
type Preset = OrbLegacyPreset | SecureDocumentLegacyPreset | DocumentLegacyPreset | SelfieCheckLegacyPreset | DeviceLegacyPreset;
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
type CredentialType = "orb" | "face" | "secure_document" | "document" | "device";
|
|
122
|
-
|
|
123
|
-
interface CredentialRequestType {
|
|
124
|
-
type: CredentialType;
|
|
125
|
-
/** Signal can be a string or raw bytes (Uint8Array) */
|
|
126
|
-
signal?: string | Uint8Array;
|
|
127
|
-
genesis_issued_at_min?: number;
|
|
128
|
-
expires_at_min?: number;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
type ConstraintNode =
|
|
132
|
-
| CredentialRequestType
|
|
133
|
-
| { any: ConstraintNode[] }
|
|
134
|
-
| { all: ConstraintNode[] }
|
|
135
|
-
| { enumerate: ConstraintNode[] };
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
90
|
/** V4 response item for World ID v4 uniqueness proofs */
|
|
140
91
|
interface ResponseItemV4 {
|
|
141
|
-
/** Credential identifier (e.g., "
|
|
92
|
+
/** Credential identifier (e.g., "proof_of_human", "face", "passport", "mnc") */
|
|
142
93
|
identifier: string;
|
|
143
94
|
/** Signal hash (optional, included if signal was provided in request) */
|
|
144
95
|
signal_hash?: string;
|
|
@@ -146,7 +97,7 @@ interface ResponseItemV4 {
|
|
|
146
97
|
proof: string[];
|
|
147
98
|
/** RP-scoped nullifier (hex) */
|
|
148
99
|
nullifier: string;
|
|
149
|
-
/** Credential issuer schema ID (1=
|
|
100
|
+
/** Credential issuer schema ID (1=proof_of_human, 11=face, 9303=passport, 9310=mnc) */
|
|
150
101
|
issuer_schema_id: number;
|
|
151
102
|
/** Minimum expiration timestamp (unix seconds) */
|
|
152
103
|
expires_at_min: number;
|
|
@@ -154,7 +105,7 @@ interface ResponseItemV4 {
|
|
|
154
105
|
|
|
155
106
|
/** V3 response item for World ID v3 (legacy format) */
|
|
156
107
|
interface ResponseItemV3 {
|
|
157
|
-
/** Credential identifier (e.g., "
|
|
108
|
+
/** Credential identifier (e.g., "proof_of_human", "face") */
|
|
158
109
|
identifier: string;
|
|
159
110
|
/** Signal hash (optional, included if signal was provided in request) */
|
|
160
111
|
signal_hash?: string;
|
|
@@ -168,7 +119,7 @@ interface ResponseItemV3 {
|
|
|
168
119
|
|
|
169
120
|
/** Session response item for World ID v4 session proofs */
|
|
170
121
|
interface ResponseItemSession {
|
|
171
|
-
/** Credential identifier (e.g., "
|
|
122
|
+
/** Credential identifier (e.g., "proof_of_human", "face", "passport", "mnc") */
|
|
172
123
|
identifier: string;
|
|
173
124
|
/** Signal hash (optional, included if signal was provided in request) */
|
|
174
125
|
signal_hash?: string;
|
|
@@ -176,7 +127,7 @@ interface ResponseItemSession {
|
|
|
176
127
|
proof: string[];
|
|
177
128
|
/** Session nullifier: 1st element is the session nullifier, 2nd is the generated action (hex strings) */
|
|
178
129
|
session_nullifier: string[];
|
|
179
|
-
/** Credential issuer schema ID (1=
|
|
130
|
+
/** Credential issuer schema ID (1=proof_of_human, 11=face, 9303=passport, 9310=mnc) */
|
|
180
131
|
issuer_schema_id: number;
|
|
181
132
|
/** Minimum expiration timestamp (unix seconds) */
|
|
182
133
|
expires_at_min: number;
|
|
@@ -240,25 +191,78 @@ type IDKitResult = IDKitResultV3 | IDKitResultV4 | IDKitResultSession;
|
|
|
240
191
|
|
|
241
192
|
/** Error codes from World App (mirrors Rust AppError) */
|
|
242
193
|
type IDKitErrorCode =
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
194
|
+
| "user_rejected"
|
|
195
|
+
| "verification_rejected"
|
|
196
|
+
| "credential_unavailable"
|
|
197
|
+
| "malformed_request"
|
|
198
|
+
| "invalid_network"
|
|
199
|
+
| "inclusion_proof_pending"
|
|
200
|
+
| "inclusion_proof_failed"
|
|
201
|
+
| "unexpected_response"
|
|
202
|
+
| "connection_failed"
|
|
203
|
+
| "max_verifications_reached"
|
|
204
|
+
| "failed_by_host_app"
|
|
205
|
+
| "generic_error";
|
|
255
206
|
|
|
256
207
|
/** Status returned from pollForStatus() */
|
|
257
208
|
type Status$1 =
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
209
|
+
| { type: "waiting_for_connection" }
|
|
210
|
+
| { type: "awaiting_confirmation" }
|
|
211
|
+
| { type: "confirmed"; result: IDKitResult }
|
|
212
|
+
| { type: "failed"; error: IDKitErrorCode };
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
interface OrbLegacyPreset {
|
|
217
|
+
/** This preset only returns World ID 3.0 proofs. Use it for compatibility with older IDKit versions. */
|
|
218
|
+
type: "OrbLegacy";
|
|
219
|
+
signal?: string;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
interface SecureDocumentLegacyPreset {
|
|
223
|
+
/** This preset only returns World ID 3.0 proofs. Use it for compatibility with older IDKit versions. */
|
|
224
|
+
type: "SecureDocumentLegacy";
|
|
225
|
+
signal?: string;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
interface DocumentLegacyPreset {
|
|
229
|
+
/** This preset only returns World ID 3.0 proofs. Use it for compatibility with older IDKit versions. */
|
|
230
|
+
type: "DocumentLegacy";
|
|
231
|
+
signal?: string;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
interface SelfieCheckLegacyPreset {
|
|
235
|
+
/** This preset only returns World ID 3.0 proofs. Use it for compatibility with older IDKit versions. */
|
|
236
|
+
/** Preview: Selfie Check is currently in preview. Contact us if you need it enabled. */
|
|
237
|
+
type: "SelfieCheckLegacy";
|
|
238
|
+
signal?: string;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
interface DeviceLegacyPreset {
|
|
242
|
+
/** This preset only returns World ID 3.0 proofs. Use it for compatibility with older IDKit versions. */
|
|
243
|
+
type: "DeviceLegacy";
|
|
244
|
+
signal?: string;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
type Preset = OrbLegacyPreset | SecureDocumentLegacyPreset | DocumentLegacyPreset | SelfieCheckLegacyPreset | DeviceLegacyPreset;
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
type CredentialType = "proof_of_human" | "face" | "passport" | "mnc";
|
|
252
|
+
|
|
253
|
+
interface CredentialRequestType {
|
|
254
|
+
type: CredentialType;
|
|
255
|
+
/** Signal can be a string or raw bytes (Uint8Array) */
|
|
256
|
+
signal?: string | Uint8Array;
|
|
257
|
+
genesis_issued_at_min?: number;
|
|
258
|
+
expires_at_min?: number;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
type ConstraintNode =
|
|
262
|
+
| CredentialRequestType
|
|
263
|
+
| { any: ConstraintNode[] }
|
|
264
|
+
| { all: ConstraintNode[] }
|
|
265
|
+
| { enumerate: ConstraintNode[] };
|
|
262
266
|
|
|
263
267
|
/**
|
|
264
268
|
* Result types - re-exported from WASM bindings
|
|
@@ -288,6 +292,10 @@ declare enum IDKitErrorCodes {
|
|
|
288
292
|
Cancelled = "cancelled"
|
|
289
293
|
}
|
|
290
294
|
|
|
295
|
+
/**
|
|
296
|
+
* Check if running inside World App
|
|
297
|
+
*/
|
|
298
|
+
declare function isInWorldApp(): boolean;
|
|
291
299
|
interface BuilderConfig {
|
|
292
300
|
type: "request" | "session" | "proveSession";
|
|
293
301
|
app_id: string;
|
|
@@ -296,6 +304,7 @@ interface BuilderConfig {
|
|
|
296
304
|
rp_context?: RpContext;
|
|
297
305
|
action_description?: string;
|
|
298
306
|
bridge_url?: string;
|
|
307
|
+
return_to?: string;
|
|
299
308
|
allow_legacy_proofs?: boolean;
|
|
300
309
|
override_connect_base_url?: string;
|
|
301
310
|
environment?: string;
|
|
@@ -310,7 +319,7 @@ interface BuilderConfig {
|
|
|
310
319
|
interface WaitOptions {
|
|
311
320
|
/** Milliseconds between polls (default: 1000) */
|
|
312
321
|
pollInterval?: number;
|
|
313
|
-
/** Total timeout in milliseconds (default:
|
|
322
|
+
/** Total timeout in milliseconds (default: 900000 = 15 minutes) */
|
|
314
323
|
timeout?: number;
|
|
315
324
|
/** AbortSignal for cancellation */
|
|
316
325
|
signal?: AbortSignal;
|
|
@@ -453,7 +462,7 @@ declare class IDKitBuilder {
|
|
|
453
462
|
* @example
|
|
454
463
|
* ```typescript
|
|
455
464
|
* const request = await IDKit.request({ app_id, action, rp_context, allow_legacy_proofs: false })
|
|
456
|
-
* .constraints(any(CredentialRequest('
|
|
465
|
+
* .constraints(any(CredentialRequest('proof_of_human'), CredentialRequest('face')));
|
|
457
466
|
* ```
|
|
458
467
|
*/
|
|
459
468
|
constraints(constraints: ConstraintNode): Promise<IDKitRequest>;
|
|
@@ -502,7 +511,7 @@ declare class IDKitBuilder {
|
|
|
502
511
|
* action: 'my-action',
|
|
503
512
|
* rp_context: { ... },
|
|
504
513
|
* allow_legacy_proofs: false,
|
|
505
|
-
* }).constraints(enumerate(CredentialRequest('
|
|
514
|
+
* }).constraints(enumerate(CredentialRequest('proof_of_human'), CredentialRequest('face')));
|
|
506
515
|
*
|
|
507
516
|
* // In World App: connectorURI is empty, result comes via postMessage
|
|
508
517
|
* // On web: connectorURI is the QR URL to display
|
|
@@ -571,4 +580,4 @@ declare const isWeb: () => boolean;
|
|
|
571
580
|
*/
|
|
572
581
|
declare const isNode: () => boolean;
|
|
573
582
|
|
|
574
|
-
export { type AbiEncodedValue, type ConstraintNode, type CredentialRequestType, type CredentialType, type DeviceLegacyPreset, type DocumentLegacyPreset, IDKit, type IDKitCompletionResult, type IDKitErrorCode, IDKitErrorCodes, type IDKitRequest, type IDKitRequestConfig, type IDKitResult, type IDKitResultSession, type IDKitSessionConfig, type OrbLegacyPreset, type Preset, type ResponseItemSession, type ResponseItemV3, type ResponseItemV4, type RpContext, type SecureDocumentLegacyPreset, type SelfieCheckLegacyPreset, type Status$1 as Status, type WaitOptions, deviceLegacy, documentLegacy, isNode, isReactNative, isWeb, orbLegacy, secureDocumentLegacy, selfieCheckLegacy };
|
|
583
|
+
export { type AbiEncodedValue, type ConstraintNode, type CredentialRequestType, type CredentialType, type DeviceLegacyPreset, type DocumentLegacyPreset, IDKit, type IDKitCompletionResult, type IDKitErrorCode, IDKitErrorCodes, type IDKitRequest, type IDKitRequestConfig, type IDKitResult, type IDKitResultSession, type IDKitSessionConfig, type OrbLegacyPreset, type Preset, type ResponseItemSession, type ResponseItemV3, type ResponseItemV4, type RpContext, type SecureDocumentLegacyPreset, type SelfieCheckLegacyPreset, type Status$1 as Status, type WaitOptions, deviceLegacy, documentLegacy, isInWorldApp, isNode, isReactNative, isWeb, orbLegacy, secureDocumentLegacy, selfieCheckLegacy };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { RpSignature, signRequest } from '@worldcoin/idkit-server';
|
|
1
|
+
export { RpSignature, SignRequestParams, signRequest } from '@worldcoin/idkit-server';
|
|
2
2
|
export { hashSignal } from './hashing.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -47,6 +47,8 @@ type IDKitRequestConfig = {
|
|
|
47
47
|
action_description?: string;
|
|
48
48
|
/** URL to a third-party bridge to use when connecting to the World App. Optional. */
|
|
49
49
|
bridge_url?: string;
|
|
50
|
+
/** Optional deep-link callback URL appended as `return_to` on the connector URL. */
|
|
51
|
+
return_to?: string;
|
|
50
52
|
/**
|
|
51
53
|
* Whether to accept legacy (v3) World ID proofs as fallback.
|
|
52
54
|
*
|
|
@@ -77,68 +79,17 @@ type IDKitSessionConfig = {
|
|
|
77
79
|
action_description?: string;
|
|
78
80
|
/** URL to a third-party bridge to use when connecting to the World App. Optional. */
|
|
79
81
|
bridge_url?: string;
|
|
82
|
+
/** Optional deep-link callback URL appended as `return_to` on the connector URL. */
|
|
83
|
+
return_to?: string;
|
|
80
84
|
/** Optional override for the connect base URL (e.g., for staging environments) */
|
|
81
85
|
override_connect_base_url?: string;
|
|
82
86
|
/** Optional environment override. Defaults to "production". */
|
|
83
87
|
environment?: "production" | "staging";
|
|
84
88
|
};
|
|
85
89
|
|
|
86
|
-
interface OrbLegacyPreset {
|
|
87
|
-
/** This preset only returns World ID 3.0 proofs. Use it for compatibility with older IDKit versions. */
|
|
88
|
-
type: "OrbLegacy";
|
|
89
|
-
signal?: string;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
interface SecureDocumentLegacyPreset {
|
|
93
|
-
/** This preset only returns World ID 3.0 proofs. Use it for compatibility with older IDKit versions. */
|
|
94
|
-
type: "SecureDocumentLegacy";
|
|
95
|
-
signal?: string;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
interface DocumentLegacyPreset {
|
|
99
|
-
/** This preset only returns World ID 3.0 proofs. Use it for compatibility with older IDKit versions. */
|
|
100
|
-
type: "DocumentLegacy";
|
|
101
|
-
signal?: string;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
interface SelfieCheckLegacyPreset {
|
|
105
|
-
/** This preset only returns World ID 3.0 proofs. Use it for compatibility with older IDKit versions. */
|
|
106
|
-
/** Preview: Selfie Check is currently in preview. Contact us if you need it enabled. */
|
|
107
|
-
type: "SelfieCheckLegacy";
|
|
108
|
-
signal?: string;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
interface DeviceLegacyPreset {
|
|
112
|
-
/** This preset only returns World ID 3.0 proofs. Use it for compatibility with older IDKit versions. */
|
|
113
|
-
type: "DeviceLegacy";
|
|
114
|
-
signal?: string;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
type Preset = OrbLegacyPreset | SecureDocumentLegacyPreset | DocumentLegacyPreset | SelfieCheckLegacyPreset | DeviceLegacyPreset;
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
type CredentialType = "orb" | "face" | "secure_document" | "document" | "device";
|
|
122
|
-
|
|
123
|
-
interface CredentialRequestType {
|
|
124
|
-
type: CredentialType;
|
|
125
|
-
/** Signal can be a string or raw bytes (Uint8Array) */
|
|
126
|
-
signal?: string | Uint8Array;
|
|
127
|
-
genesis_issued_at_min?: number;
|
|
128
|
-
expires_at_min?: number;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
type ConstraintNode =
|
|
132
|
-
| CredentialRequestType
|
|
133
|
-
| { any: ConstraintNode[] }
|
|
134
|
-
| { all: ConstraintNode[] }
|
|
135
|
-
| { enumerate: ConstraintNode[] };
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
90
|
/** V4 response item for World ID v4 uniqueness proofs */
|
|
140
91
|
interface ResponseItemV4 {
|
|
141
|
-
/** Credential identifier (e.g., "
|
|
92
|
+
/** Credential identifier (e.g., "proof_of_human", "face", "passport", "mnc") */
|
|
142
93
|
identifier: string;
|
|
143
94
|
/** Signal hash (optional, included if signal was provided in request) */
|
|
144
95
|
signal_hash?: string;
|
|
@@ -146,7 +97,7 @@ interface ResponseItemV4 {
|
|
|
146
97
|
proof: string[];
|
|
147
98
|
/** RP-scoped nullifier (hex) */
|
|
148
99
|
nullifier: string;
|
|
149
|
-
/** Credential issuer schema ID (1=
|
|
100
|
+
/** Credential issuer schema ID (1=proof_of_human, 11=face, 9303=passport, 9310=mnc) */
|
|
150
101
|
issuer_schema_id: number;
|
|
151
102
|
/** Minimum expiration timestamp (unix seconds) */
|
|
152
103
|
expires_at_min: number;
|
|
@@ -154,7 +105,7 @@ interface ResponseItemV4 {
|
|
|
154
105
|
|
|
155
106
|
/** V3 response item for World ID v3 (legacy format) */
|
|
156
107
|
interface ResponseItemV3 {
|
|
157
|
-
/** Credential identifier (e.g., "
|
|
108
|
+
/** Credential identifier (e.g., "proof_of_human", "face") */
|
|
158
109
|
identifier: string;
|
|
159
110
|
/** Signal hash (optional, included if signal was provided in request) */
|
|
160
111
|
signal_hash?: string;
|
|
@@ -168,7 +119,7 @@ interface ResponseItemV3 {
|
|
|
168
119
|
|
|
169
120
|
/** Session response item for World ID v4 session proofs */
|
|
170
121
|
interface ResponseItemSession {
|
|
171
|
-
/** Credential identifier (e.g., "
|
|
122
|
+
/** Credential identifier (e.g., "proof_of_human", "face", "passport", "mnc") */
|
|
172
123
|
identifier: string;
|
|
173
124
|
/** Signal hash (optional, included if signal was provided in request) */
|
|
174
125
|
signal_hash?: string;
|
|
@@ -176,7 +127,7 @@ interface ResponseItemSession {
|
|
|
176
127
|
proof: string[];
|
|
177
128
|
/** Session nullifier: 1st element is the session nullifier, 2nd is the generated action (hex strings) */
|
|
178
129
|
session_nullifier: string[];
|
|
179
|
-
/** Credential issuer schema ID (1=
|
|
130
|
+
/** Credential issuer schema ID (1=proof_of_human, 11=face, 9303=passport, 9310=mnc) */
|
|
180
131
|
issuer_schema_id: number;
|
|
181
132
|
/** Minimum expiration timestamp (unix seconds) */
|
|
182
133
|
expires_at_min: number;
|
|
@@ -240,25 +191,78 @@ type IDKitResult = IDKitResultV3 | IDKitResultV4 | IDKitResultSession;
|
|
|
240
191
|
|
|
241
192
|
/** Error codes from World App (mirrors Rust AppError) */
|
|
242
193
|
type IDKitErrorCode =
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
194
|
+
| "user_rejected"
|
|
195
|
+
| "verification_rejected"
|
|
196
|
+
| "credential_unavailable"
|
|
197
|
+
| "malformed_request"
|
|
198
|
+
| "invalid_network"
|
|
199
|
+
| "inclusion_proof_pending"
|
|
200
|
+
| "inclusion_proof_failed"
|
|
201
|
+
| "unexpected_response"
|
|
202
|
+
| "connection_failed"
|
|
203
|
+
| "max_verifications_reached"
|
|
204
|
+
| "failed_by_host_app"
|
|
205
|
+
| "generic_error";
|
|
255
206
|
|
|
256
207
|
/** Status returned from pollForStatus() */
|
|
257
208
|
type Status$1 =
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
209
|
+
| { type: "waiting_for_connection" }
|
|
210
|
+
| { type: "awaiting_confirmation" }
|
|
211
|
+
| { type: "confirmed"; result: IDKitResult }
|
|
212
|
+
| { type: "failed"; error: IDKitErrorCode };
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
interface OrbLegacyPreset {
|
|
217
|
+
/** This preset only returns World ID 3.0 proofs. Use it for compatibility with older IDKit versions. */
|
|
218
|
+
type: "OrbLegacy";
|
|
219
|
+
signal?: string;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
interface SecureDocumentLegacyPreset {
|
|
223
|
+
/** This preset only returns World ID 3.0 proofs. Use it for compatibility with older IDKit versions. */
|
|
224
|
+
type: "SecureDocumentLegacy";
|
|
225
|
+
signal?: string;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
interface DocumentLegacyPreset {
|
|
229
|
+
/** This preset only returns World ID 3.0 proofs. Use it for compatibility with older IDKit versions. */
|
|
230
|
+
type: "DocumentLegacy";
|
|
231
|
+
signal?: string;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
interface SelfieCheckLegacyPreset {
|
|
235
|
+
/** This preset only returns World ID 3.0 proofs. Use it for compatibility with older IDKit versions. */
|
|
236
|
+
/** Preview: Selfie Check is currently in preview. Contact us if you need it enabled. */
|
|
237
|
+
type: "SelfieCheckLegacy";
|
|
238
|
+
signal?: string;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
interface DeviceLegacyPreset {
|
|
242
|
+
/** This preset only returns World ID 3.0 proofs. Use it for compatibility with older IDKit versions. */
|
|
243
|
+
type: "DeviceLegacy";
|
|
244
|
+
signal?: string;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
type Preset = OrbLegacyPreset | SecureDocumentLegacyPreset | DocumentLegacyPreset | SelfieCheckLegacyPreset | DeviceLegacyPreset;
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
type CredentialType = "proof_of_human" | "face" | "passport" | "mnc";
|
|
252
|
+
|
|
253
|
+
interface CredentialRequestType {
|
|
254
|
+
type: CredentialType;
|
|
255
|
+
/** Signal can be a string or raw bytes (Uint8Array) */
|
|
256
|
+
signal?: string | Uint8Array;
|
|
257
|
+
genesis_issued_at_min?: number;
|
|
258
|
+
expires_at_min?: number;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
type ConstraintNode =
|
|
262
|
+
| CredentialRequestType
|
|
263
|
+
| { any: ConstraintNode[] }
|
|
264
|
+
| { all: ConstraintNode[] }
|
|
265
|
+
| { enumerate: ConstraintNode[] };
|
|
262
266
|
|
|
263
267
|
/**
|
|
264
268
|
* Result types - re-exported from WASM bindings
|
|
@@ -288,6 +292,10 @@ declare enum IDKitErrorCodes {
|
|
|
288
292
|
Cancelled = "cancelled"
|
|
289
293
|
}
|
|
290
294
|
|
|
295
|
+
/**
|
|
296
|
+
* Check if running inside World App
|
|
297
|
+
*/
|
|
298
|
+
declare function isInWorldApp(): boolean;
|
|
291
299
|
interface BuilderConfig {
|
|
292
300
|
type: "request" | "session" | "proveSession";
|
|
293
301
|
app_id: string;
|
|
@@ -296,6 +304,7 @@ interface BuilderConfig {
|
|
|
296
304
|
rp_context?: RpContext;
|
|
297
305
|
action_description?: string;
|
|
298
306
|
bridge_url?: string;
|
|
307
|
+
return_to?: string;
|
|
299
308
|
allow_legacy_proofs?: boolean;
|
|
300
309
|
override_connect_base_url?: string;
|
|
301
310
|
environment?: string;
|
|
@@ -310,7 +319,7 @@ interface BuilderConfig {
|
|
|
310
319
|
interface WaitOptions {
|
|
311
320
|
/** Milliseconds between polls (default: 1000) */
|
|
312
321
|
pollInterval?: number;
|
|
313
|
-
/** Total timeout in milliseconds (default:
|
|
322
|
+
/** Total timeout in milliseconds (default: 900000 = 15 minutes) */
|
|
314
323
|
timeout?: number;
|
|
315
324
|
/** AbortSignal for cancellation */
|
|
316
325
|
signal?: AbortSignal;
|
|
@@ -453,7 +462,7 @@ declare class IDKitBuilder {
|
|
|
453
462
|
* @example
|
|
454
463
|
* ```typescript
|
|
455
464
|
* const request = await IDKit.request({ app_id, action, rp_context, allow_legacy_proofs: false })
|
|
456
|
-
* .constraints(any(CredentialRequest('
|
|
465
|
+
* .constraints(any(CredentialRequest('proof_of_human'), CredentialRequest('face')));
|
|
457
466
|
* ```
|
|
458
467
|
*/
|
|
459
468
|
constraints(constraints: ConstraintNode): Promise<IDKitRequest>;
|
|
@@ -502,7 +511,7 @@ declare class IDKitBuilder {
|
|
|
502
511
|
* action: 'my-action',
|
|
503
512
|
* rp_context: { ... },
|
|
504
513
|
* allow_legacy_proofs: false,
|
|
505
|
-
* }).constraints(enumerate(CredentialRequest('
|
|
514
|
+
* }).constraints(enumerate(CredentialRequest('proof_of_human'), CredentialRequest('face')));
|
|
506
515
|
*
|
|
507
516
|
* // In World App: connectorURI is empty, result comes via postMessage
|
|
508
517
|
* // On web: connectorURI is the QR URL to display
|
|
@@ -571,4 +580,4 @@ declare const isWeb: () => boolean;
|
|
|
571
580
|
*/
|
|
572
581
|
declare const isNode: () => boolean;
|
|
573
582
|
|
|
574
|
-
export { type AbiEncodedValue, type ConstraintNode, type CredentialRequestType, type CredentialType, type DeviceLegacyPreset, type DocumentLegacyPreset, IDKit, type IDKitCompletionResult, type IDKitErrorCode, IDKitErrorCodes, type IDKitRequest, type IDKitRequestConfig, type IDKitResult, type IDKitResultSession, type IDKitSessionConfig, type OrbLegacyPreset, type Preset, type ResponseItemSession, type ResponseItemV3, type ResponseItemV4, type RpContext, type SecureDocumentLegacyPreset, type SelfieCheckLegacyPreset, type Status$1 as Status, type WaitOptions, deviceLegacy, documentLegacy, isNode, isReactNative, isWeb, orbLegacy, secureDocumentLegacy, selfieCheckLegacy };
|
|
583
|
+
export { type AbiEncodedValue, type ConstraintNode, type CredentialRequestType, type CredentialType, type DeviceLegacyPreset, type DocumentLegacyPreset, IDKit, type IDKitCompletionResult, type IDKitErrorCode, IDKitErrorCodes, type IDKitRequest, type IDKitRequestConfig, type IDKitResult, type IDKitResultSession, type IDKitSessionConfig, type OrbLegacyPreset, type Preset, type ResponseItemSession, type ResponseItemV3, type ResponseItemV4, type RpContext, type SecureDocumentLegacyPreset, type SelfieCheckLegacyPreset, type Status$1 as Status, type WaitOptions, deviceLegacy, documentLegacy, isInWorldApp, isNode, isReactNative, isWeb, orbLegacy, secureDocumentLegacy, selfieCheckLegacy };
|