@worldcoin/idkit-core 4.0.13 → 4.0.15
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/dist/idkit_wasm_bg.wasm +0 -0
- package/dist/index.cjs +1323 -1301
- package/dist/index.d.cts +81 -77
- package/dist/index.d.ts +81 -77
- package/dist/index.js +1323 -1302
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -83,62 +83,9 @@ type IDKitSessionConfig = {
|
|
|
83
83
|
environment?: "production" | "staging";
|
|
84
84
|
};
|
|
85
85
|
|
|
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
86
|
/** V4 response item for World ID v4 uniqueness proofs */
|
|
140
87
|
interface ResponseItemV4 {
|
|
141
|
-
/** Credential identifier (e.g., "
|
|
88
|
+
/** Credential identifier (e.g., "proof_of_human", "face", "passport", "mnc") */
|
|
142
89
|
identifier: string;
|
|
143
90
|
/** Signal hash (optional, included if signal was provided in request) */
|
|
144
91
|
signal_hash?: string;
|
|
@@ -146,7 +93,7 @@ interface ResponseItemV4 {
|
|
|
146
93
|
proof: string[];
|
|
147
94
|
/** RP-scoped nullifier (hex) */
|
|
148
95
|
nullifier: string;
|
|
149
|
-
/** Credential issuer schema ID (1=
|
|
96
|
+
/** Credential issuer schema ID (1=proof_of_human, 11=face, 9303=passport, 9310=mnc) */
|
|
150
97
|
issuer_schema_id: number;
|
|
151
98
|
/** Minimum expiration timestamp (unix seconds) */
|
|
152
99
|
expires_at_min: number;
|
|
@@ -154,7 +101,7 @@ interface ResponseItemV4 {
|
|
|
154
101
|
|
|
155
102
|
/** V3 response item for World ID v3 (legacy format) */
|
|
156
103
|
interface ResponseItemV3 {
|
|
157
|
-
/** Credential identifier (e.g., "
|
|
104
|
+
/** Credential identifier (e.g., "proof_of_human", "face") */
|
|
158
105
|
identifier: string;
|
|
159
106
|
/** Signal hash (optional, included if signal was provided in request) */
|
|
160
107
|
signal_hash?: string;
|
|
@@ -168,7 +115,7 @@ interface ResponseItemV3 {
|
|
|
168
115
|
|
|
169
116
|
/** Session response item for World ID v4 session proofs */
|
|
170
117
|
interface ResponseItemSession {
|
|
171
|
-
/** Credential identifier (e.g., "
|
|
118
|
+
/** Credential identifier (e.g., "proof_of_human", "face", "passport", "mnc") */
|
|
172
119
|
identifier: string;
|
|
173
120
|
/** Signal hash (optional, included if signal was provided in request) */
|
|
174
121
|
signal_hash?: string;
|
|
@@ -176,7 +123,7 @@ interface ResponseItemSession {
|
|
|
176
123
|
proof: string[];
|
|
177
124
|
/** Session nullifier: 1st element is the session nullifier, 2nd is the generated action (hex strings) */
|
|
178
125
|
session_nullifier: string[];
|
|
179
|
-
/** Credential issuer schema ID (1=
|
|
126
|
+
/** Credential issuer schema ID (1=proof_of_human, 11=face, 9303=passport, 9310=mnc) */
|
|
180
127
|
issuer_schema_id: number;
|
|
181
128
|
/** Minimum expiration timestamp (unix seconds) */
|
|
182
129
|
expires_at_min: number;
|
|
@@ -240,25 +187,78 @@ type IDKitResult = IDKitResultV3 | IDKitResultV4 | IDKitResultSession;
|
|
|
240
187
|
|
|
241
188
|
/** Error codes from World App (mirrors Rust AppError) */
|
|
242
189
|
type IDKitErrorCode =
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
190
|
+
| "user_rejected"
|
|
191
|
+
| "verification_rejected"
|
|
192
|
+
| "credential_unavailable"
|
|
193
|
+
| "malformed_request"
|
|
194
|
+
| "invalid_network"
|
|
195
|
+
| "inclusion_proof_pending"
|
|
196
|
+
| "inclusion_proof_failed"
|
|
197
|
+
| "unexpected_response"
|
|
198
|
+
| "connection_failed"
|
|
199
|
+
| "max_verifications_reached"
|
|
200
|
+
| "failed_by_host_app"
|
|
201
|
+
| "generic_error";
|
|
255
202
|
|
|
256
203
|
/** Status returned from pollForStatus() */
|
|
257
204
|
type Status$1 =
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
205
|
+
| { type: "waiting_for_connection" }
|
|
206
|
+
| { type: "awaiting_confirmation" }
|
|
207
|
+
| { type: "confirmed"; result: IDKitResult }
|
|
208
|
+
| { type: "failed"; error: IDKitErrorCode };
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
interface OrbLegacyPreset {
|
|
213
|
+
/** This preset only returns World ID 3.0 proofs. Use it for compatibility with older IDKit versions. */
|
|
214
|
+
type: "OrbLegacy";
|
|
215
|
+
signal?: string;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
interface SecureDocumentLegacyPreset {
|
|
219
|
+
/** This preset only returns World ID 3.0 proofs. Use it for compatibility with older IDKit versions. */
|
|
220
|
+
type: "SecureDocumentLegacy";
|
|
221
|
+
signal?: string;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
interface DocumentLegacyPreset {
|
|
225
|
+
/** This preset only returns World ID 3.0 proofs. Use it for compatibility with older IDKit versions. */
|
|
226
|
+
type: "DocumentLegacy";
|
|
227
|
+
signal?: string;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
interface SelfieCheckLegacyPreset {
|
|
231
|
+
/** This preset only returns World ID 3.0 proofs. Use it for compatibility with older IDKit versions. */
|
|
232
|
+
/** Preview: Selfie Check is currently in preview. Contact us if you need it enabled. */
|
|
233
|
+
type: "SelfieCheckLegacy";
|
|
234
|
+
signal?: string;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
interface DeviceLegacyPreset {
|
|
238
|
+
/** This preset only returns World ID 3.0 proofs. Use it for compatibility with older IDKit versions. */
|
|
239
|
+
type: "DeviceLegacy";
|
|
240
|
+
signal?: string;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
type Preset = OrbLegacyPreset | SecureDocumentLegacyPreset | DocumentLegacyPreset | SelfieCheckLegacyPreset | DeviceLegacyPreset;
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
type CredentialType = "proof_of_human" | "face" | "passport" | "mnc";
|
|
248
|
+
|
|
249
|
+
interface CredentialRequestType {
|
|
250
|
+
type: CredentialType;
|
|
251
|
+
/** Signal can be a string or raw bytes (Uint8Array) */
|
|
252
|
+
signal?: string | Uint8Array;
|
|
253
|
+
genesis_issued_at_min?: number;
|
|
254
|
+
expires_at_min?: number;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
type ConstraintNode =
|
|
258
|
+
| CredentialRequestType
|
|
259
|
+
| { any: ConstraintNode[] }
|
|
260
|
+
| { all: ConstraintNode[] }
|
|
261
|
+
| { enumerate: ConstraintNode[] };
|
|
262
262
|
|
|
263
263
|
/**
|
|
264
264
|
* Result types - re-exported from WASM bindings
|
|
@@ -288,6 +288,10 @@ declare enum IDKitErrorCodes {
|
|
|
288
288
|
Cancelled = "cancelled"
|
|
289
289
|
}
|
|
290
290
|
|
|
291
|
+
/**
|
|
292
|
+
* Check if running inside World App
|
|
293
|
+
*/
|
|
294
|
+
declare function isInWorldApp(): boolean;
|
|
291
295
|
interface BuilderConfig {
|
|
292
296
|
type: "request" | "session" | "proveSession";
|
|
293
297
|
app_id: string;
|
|
@@ -453,7 +457,7 @@ declare class IDKitBuilder {
|
|
|
453
457
|
* @example
|
|
454
458
|
* ```typescript
|
|
455
459
|
* const request = await IDKit.request({ app_id, action, rp_context, allow_legacy_proofs: false })
|
|
456
|
-
* .constraints(any(CredentialRequest('
|
|
460
|
+
* .constraints(any(CredentialRequest('proof_of_human'), CredentialRequest('face')));
|
|
457
461
|
* ```
|
|
458
462
|
*/
|
|
459
463
|
constraints(constraints: ConstraintNode): Promise<IDKitRequest>;
|
|
@@ -502,7 +506,7 @@ declare class IDKitBuilder {
|
|
|
502
506
|
* action: 'my-action',
|
|
503
507
|
* rp_context: { ... },
|
|
504
508
|
* allow_legacy_proofs: false,
|
|
505
|
-
* }).constraints(enumerate(CredentialRequest('
|
|
509
|
+
* }).constraints(enumerate(CredentialRequest('proof_of_human'), CredentialRequest('face')));
|
|
506
510
|
*
|
|
507
511
|
* // In World App: connectorURI is empty, result comes via postMessage
|
|
508
512
|
* // On web: connectorURI is the QR URL to display
|
|
@@ -571,4 +575,4 @@ declare const isWeb: () => boolean;
|
|
|
571
575
|
*/
|
|
572
576
|
declare const isNode: () => boolean;
|
|
573
577
|
|
|
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 };
|
|
578
|
+
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
|
@@ -83,62 +83,9 @@ type IDKitSessionConfig = {
|
|
|
83
83
|
environment?: "production" | "staging";
|
|
84
84
|
};
|
|
85
85
|
|
|
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
86
|
/** V4 response item for World ID v4 uniqueness proofs */
|
|
140
87
|
interface ResponseItemV4 {
|
|
141
|
-
/** Credential identifier (e.g., "
|
|
88
|
+
/** Credential identifier (e.g., "proof_of_human", "face", "passport", "mnc") */
|
|
142
89
|
identifier: string;
|
|
143
90
|
/** Signal hash (optional, included if signal was provided in request) */
|
|
144
91
|
signal_hash?: string;
|
|
@@ -146,7 +93,7 @@ interface ResponseItemV4 {
|
|
|
146
93
|
proof: string[];
|
|
147
94
|
/** RP-scoped nullifier (hex) */
|
|
148
95
|
nullifier: string;
|
|
149
|
-
/** Credential issuer schema ID (1=
|
|
96
|
+
/** Credential issuer schema ID (1=proof_of_human, 11=face, 9303=passport, 9310=mnc) */
|
|
150
97
|
issuer_schema_id: number;
|
|
151
98
|
/** Minimum expiration timestamp (unix seconds) */
|
|
152
99
|
expires_at_min: number;
|
|
@@ -154,7 +101,7 @@ interface ResponseItemV4 {
|
|
|
154
101
|
|
|
155
102
|
/** V3 response item for World ID v3 (legacy format) */
|
|
156
103
|
interface ResponseItemV3 {
|
|
157
|
-
/** Credential identifier (e.g., "
|
|
104
|
+
/** Credential identifier (e.g., "proof_of_human", "face") */
|
|
158
105
|
identifier: string;
|
|
159
106
|
/** Signal hash (optional, included if signal was provided in request) */
|
|
160
107
|
signal_hash?: string;
|
|
@@ -168,7 +115,7 @@ interface ResponseItemV3 {
|
|
|
168
115
|
|
|
169
116
|
/** Session response item for World ID v4 session proofs */
|
|
170
117
|
interface ResponseItemSession {
|
|
171
|
-
/** Credential identifier (e.g., "
|
|
118
|
+
/** Credential identifier (e.g., "proof_of_human", "face", "passport", "mnc") */
|
|
172
119
|
identifier: string;
|
|
173
120
|
/** Signal hash (optional, included if signal was provided in request) */
|
|
174
121
|
signal_hash?: string;
|
|
@@ -176,7 +123,7 @@ interface ResponseItemSession {
|
|
|
176
123
|
proof: string[];
|
|
177
124
|
/** Session nullifier: 1st element is the session nullifier, 2nd is the generated action (hex strings) */
|
|
178
125
|
session_nullifier: string[];
|
|
179
|
-
/** Credential issuer schema ID (1=
|
|
126
|
+
/** Credential issuer schema ID (1=proof_of_human, 11=face, 9303=passport, 9310=mnc) */
|
|
180
127
|
issuer_schema_id: number;
|
|
181
128
|
/** Minimum expiration timestamp (unix seconds) */
|
|
182
129
|
expires_at_min: number;
|
|
@@ -240,25 +187,78 @@ type IDKitResult = IDKitResultV3 | IDKitResultV4 | IDKitResultSession;
|
|
|
240
187
|
|
|
241
188
|
/** Error codes from World App (mirrors Rust AppError) */
|
|
242
189
|
type IDKitErrorCode =
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
190
|
+
| "user_rejected"
|
|
191
|
+
| "verification_rejected"
|
|
192
|
+
| "credential_unavailable"
|
|
193
|
+
| "malformed_request"
|
|
194
|
+
| "invalid_network"
|
|
195
|
+
| "inclusion_proof_pending"
|
|
196
|
+
| "inclusion_proof_failed"
|
|
197
|
+
| "unexpected_response"
|
|
198
|
+
| "connection_failed"
|
|
199
|
+
| "max_verifications_reached"
|
|
200
|
+
| "failed_by_host_app"
|
|
201
|
+
| "generic_error";
|
|
255
202
|
|
|
256
203
|
/** Status returned from pollForStatus() */
|
|
257
204
|
type Status$1 =
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
205
|
+
| { type: "waiting_for_connection" }
|
|
206
|
+
| { type: "awaiting_confirmation" }
|
|
207
|
+
| { type: "confirmed"; result: IDKitResult }
|
|
208
|
+
| { type: "failed"; error: IDKitErrorCode };
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
interface OrbLegacyPreset {
|
|
213
|
+
/** This preset only returns World ID 3.0 proofs. Use it for compatibility with older IDKit versions. */
|
|
214
|
+
type: "OrbLegacy";
|
|
215
|
+
signal?: string;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
interface SecureDocumentLegacyPreset {
|
|
219
|
+
/** This preset only returns World ID 3.0 proofs. Use it for compatibility with older IDKit versions. */
|
|
220
|
+
type: "SecureDocumentLegacy";
|
|
221
|
+
signal?: string;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
interface DocumentLegacyPreset {
|
|
225
|
+
/** This preset only returns World ID 3.0 proofs. Use it for compatibility with older IDKit versions. */
|
|
226
|
+
type: "DocumentLegacy";
|
|
227
|
+
signal?: string;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
interface SelfieCheckLegacyPreset {
|
|
231
|
+
/** This preset only returns World ID 3.0 proofs. Use it for compatibility with older IDKit versions. */
|
|
232
|
+
/** Preview: Selfie Check is currently in preview. Contact us if you need it enabled. */
|
|
233
|
+
type: "SelfieCheckLegacy";
|
|
234
|
+
signal?: string;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
interface DeviceLegacyPreset {
|
|
238
|
+
/** This preset only returns World ID 3.0 proofs. Use it for compatibility with older IDKit versions. */
|
|
239
|
+
type: "DeviceLegacy";
|
|
240
|
+
signal?: string;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
type Preset = OrbLegacyPreset | SecureDocumentLegacyPreset | DocumentLegacyPreset | SelfieCheckLegacyPreset | DeviceLegacyPreset;
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
type CredentialType = "proof_of_human" | "face" | "passport" | "mnc";
|
|
248
|
+
|
|
249
|
+
interface CredentialRequestType {
|
|
250
|
+
type: CredentialType;
|
|
251
|
+
/** Signal can be a string or raw bytes (Uint8Array) */
|
|
252
|
+
signal?: string | Uint8Array;
|
|
253
|
+
genesis_issued_at_min?: number;
|
|
254
|
+
expires_at_min?: number;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
type ConstraintNode =
|
|
258
|
+
| CredentialRequestType
|
|
259
|
+
| { any: ConstraintNode[] }
|
|
260
|
+
| { all: ConstraintNode[] }
|
|
261
|
+
| { enumerate: ConstraintNode[] };
|
|
262
262
|
|
|
263
263
|
/**
|
|
264
264
|
* Result types - re-exported from WASM bindings
|
|
@@ -288,6 +288,10 @@ declare enum IDKitErrorCodes {
|
|
|
288
288
|
Cancelled = "cancelled"
|
|
289
289
|
}
|
|
290
290
|
|
|
291
|
+
/**
|
|
292
|
+
* Check if running inside World App
|
|
293
|
+
*/
|
|
294
|
+
declare function isInWorldApp(): boolean;
|
|
291
295
|
interface BuilderConfig {
|
|
292
296
|
type: "request" | "session" | "proveSession";
|
|
293
297
|
app_id: string;
|
|
@@ -453,7 +457,7 @@ declare class IDKitBuilder {
|
|
|
453
457
|
* @example
|
|
454
458
|
* ```typescript
|
|
455
459
|
* const request = await IDKit.request({ app_id, action, rp_context, allow_legacy_proofs: false })
|
|
456
|
-
* .constraints(any(CredentialRequest('
|
|
460
|
+
* .constraints(any(CredentialRequest('proof_of_human'), CredentialRequest('face')));
|
|
457
461
|
* ```
|
|
458
462
|
*/
|
|
459
463
|
constraints(constraints: ConstraintNode): Promise<IDKitRequest>;
|
|
@@ -502,7 +506,7 @@ declare class IDKitBuilder {
|
|
|
502
506
|
* action: 'my-action',
|
|
503
507
|
* rp_context: { ... },
|
|
504
508
|
* allow_legacy_proofs: false,
|
|
505
|
-
* }).constraints(enumerate(CredentialRequest('
|
|
509
|
+
* }).constraints(enumerate(CredentialRequest('proof_of_human'), CredentialRequest('face')));
|
|
506
510
|
*
|
|
507
511
|
* // In World App: connectorURI is empty, result comes via postMessage
|
|
508
512
|
* // On web: connectorURI is the QR URL to display
|
|
@@ -571,4 +575,4 @@ declare const isWeb: () => boolean;
|
|
|
571
575
|
*/
|
|
572
576
|
declare const isNode: () => boolean;
|
|
573
577
|
|
|
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 };
|
|
578
|
+
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 };
|