@worldcoin/idkit-core 4.0.5 → 4.0.7
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 +14 -1
- package/dist/idkit_wasm_bg.wasm +0 -0
- package/dist/index.cjs +68 -44
- package/dist/index.d.cts +32 -3
- package/dist/index.d.ts +32 -3
- package/dist/index.js +68 -45
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -56,7 +56,20 @@ const request = await IDKit.request({
|
|
|
56
56
|
const qrUrl = request.connectorURI;
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
-
**Available presets:** `orbLegacy`, `documentLegacy`, `secureDocumentLegacy`
|
|
59
|
+
**Available presets:** `orbLegacy`, `documentLegacy`, `secureDocumentLegacy`, `selfieCheck`
|
|
60
|
+
|
|
61
|
+
Selfie check preset example:
|
|
62
|
+
|
|
63
|
+
```typescript
|
|
64
|
+
import { IDKit, selfieCheck } from "@worldcoin/idkit-core";
|
|
65
|
+
|
|
66
|
+
const request = await IDKit.request({
|
|
67
|
+
app_id: "app_xxxxx",
|
|
68
|
+
action: "my-action",
|
|
69
|
+
rp_context: rpContext,
|
|
70
|
+
allow_legacy_proofs: false,
|
|
71
|
+
}).preset(selfieCheck({ signal: "user-123" }));
|
|
72
|
+
```
|
|
60
73
|
|
|
61
74
|
## Handling the Result
|
|
62
75
|
|
package/dist/idkit_wasm_bg.wasm
CHANGED
|
Binary file
|
package/dist/index.cjs
CHANGED
|
@@ -392,14 +392,14 @@ function hashSignal(signal) {
|
|
|
392
392
|
wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
|
|
393
393
|
}
|
|
394
394
|
}
|
|
395
|
-
function
|
|
396
|
-
wasm.
|
|
395
|
+
function __wasm_bindgen_func_elem_605(arg0, arg1) {
|
|
396
|
+
wasm.__wasm_bindgen_func_elem_605(arg0, arg1);
|
|
397
397
|
}
|
|
398
|
-
function
|
|
399
|
-
wasm.
|
|
398
|
+
function __wasm_bindgen_func_elem_968(arg0, arg1, arg2) {
|
|
399
|
+
wasm.__wasm_bindgen_func_elem_968(arg0, arg1, addHeapObject(arg2));
|
|
400
400
|
}
|
|
401
|
-
function
|
|
402
|
-
wasm.
|
|
401
|
+
function __wasm_bindgen_func_elem_1353(arg0, arg1, arg2, arg3) {
|
|
402
|
+
wasm.__wasm_bindgen_func_elem_1353(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
403
403
|
}
|
|
404
404
|
var __wbindgen_enum_RequestCache = ["default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached"];
|
|
405
405
|
var __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
|
|
@@ -1562,7 +1562,7 @@ function __wbg_get_imports() {
|
|
|
1562
1562
|
const a = state0.a;
|
|
1563
1563
|
state0.a = 0;
|
|
1564
1564
|
try {
|
|
1565
|
-
return
|
|
1565
|
+
return __wasm_bindgen_func_elem_1353(a, state0.b, arg02, arg12);
|
|
1566
1566
|
} finally {
|
|
1567
1567
|
state0.a = a;
|
|
1568
1568
|
}
|
|
@@ -1771,12 +1771,12 @@ function __wbg_get_imports() {
|
|
|
1771
1771
|
const ret = getObject(arg0).versions;
|
|
1772
1772
|
return addHeapObject(ret);
|
|
1773
1773
|
};
|
|
1774
|
-
imports.wbg.
|
|
1775
|
-
const ret =
|
|
1774
|
+
imports.wbg.__wbindgen_cast_02740531cfdb05fe = function(arg0, arg1) {
|
|
1775
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_604, __wasm_bindgen_func_elem_605);
|
|
1776
1776
|
return addHeapObject(ret);
|
|
1777
1777
|
};
|
|
1778
|
-
imports.wbg.
|
|
1779
|
-
const ret =
|
|
1778
|
+
imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
|
|
1779
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
1780
1780
|
return addHeapObject(ret);
|
|
1781
1781
|
};
|
|
1782
1782
|
imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
|
|
@@ -1787,10 +1787,6 @@ function __wbg_get_imports() {
|
|
|
1787
1787
|
const ret = arg0;
|
|
1788
1788
|
return addHeapObject(ret);
|
|
1789
1789
|
};
|
|
1790
|
-
imports.wbg.__wbindgen_cast_b8b1061c2d0ea705 = function(arg0, arg1) {
|
|
1791
|
-
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_598, __wasm_bindgen_func_elem_599);
|
|
1792
|
-
return addHeapObject(ret);
|
|
1793
|
-
};
|
|
1794
1790
|
imports.wbg.__wbindgen_cast_cb9088102bce6b30 = function(arg0, arg1) {
|
|
1795
1791
|
const ret = getArrayU8FromWasm0(arg0, arg1);
|
|
1796
1792
|
return addHeapObject(ret);
|
|
@@ -1799,6 +1795,10 @@ function __wbg_get_imports() {
|
|
|
1799
1795
|
const ret = arg0;
|
|
1800
1796
|
return addHeapObject(ret);
|
|
1801
1797
|
};
|
|
1798
|
+
imports.wbg.__wbindgen_cast_f23235b6472d5cf3 = function(arg0, arg1) {
|
|
1799
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_967, __wasm_bindgen_func_elem_968);
|
|
1800
|
+
return addHeapObject(ret);
|
|
1801
|
+
};
|
|
1802
1802
|
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
|
|
1803
1803
|
const ret = getObject(arg0);
|
|
1804
1804
|
return addHeapObject(ret);
|
|
@@ -2060,55 +2060,73 @@ var NativeVerifyError = class extends Error {
|
|
|
2060
2060
|
}
|
|
2061
2061
|
};
|
|
2062
2062
|
function nativeResultToIDKitResult(payload, config, signalHashes) {
|
|
2063
|
+
const p = payload;
|
|
2063
2064
|
const rpNonce = config.rp_context?.nonce ?? "";
|
|
2064
|
-
if ("responses" in
|
|
2065
|
-
const
|
|
2065
|
+
if ("responses" in p && Array.isArray(p.responses)) {
|
|
2066
|
+
const items = p.responses;
|
|
2067
|
+
if (p.session_id) {
|
|
2068
|
+
return {
|
|
2069
|
+
protocol_version: "4.0",
|
|
2070
|
+
nonce: p.nonce ?? rpNonce,
|
|
2071
|
+
action_description: p.action_description,
|
|
2072
|
+
session_id: p.session_id,
|
|
2073
|
+
responses: items.map((item) => ({
|
|
2074
|
+
identifier: item.identifier,
|
|
2075
|
+
signal_hash: signalHashes[item.identifier],
|
|
2076
|
+
proof: item.proof,
|
|
2077
|
+
session_nullifier: item.session_nullifier,
|
|
2078
|
+
issuer_schema_id: item.issuer_schema_id,
|
|
2079
|
+
expires_at_min: item.expires_at_min
|
|
2080
|
+
})),
|
|
2081
|
+
environment: config.environment ?? "production"
|
|
2082
|
+
};
|
|
2083
|
+
}
|
|
2066
2084
|
return {
|
|
2067
|
-
protocol_version:
|
|
2068
|
-
nonce:
|
|
2069
|
-
action:
|
|
2070
|
-
action_description:
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2085
|
+
protocol_version: "4.0",
|
|
2086
|
+
nonce: p.nonce ?? rpNonce,
|
|
2087
|
+
action: p.action ?? config.action ?? "",
|
|
2088
|
+
action_description: p.action_description,
|
|
2089
|
+
responses: items.map((item) => ({
|
|
2090
|
+
identifier: item.identifier,
|
|
2091
|
+
signal_hash: signalHashes[item.identifier],
|
|
2092
|
+
proof: item.proof,
|
|
2093
|
+
nullifier: item.nullifier,
|
|
2094
|
+
issuer_schema_id: item.issuer_schema_id,
|
|
2095
|
+
expires_at_min: item.expires_at_min
|
|
2075
2096
|
})),
|
|
2076
|
-
environment:
|
|
2097
|
+
environment: config.environment ?? "production"
|
|
2077
2098
|
};
|
|
2078
2099
|
}
|
|
2079
|
-
if ("verifications" in
|
|
2080
|
-
const
|
|
2100
|
+
if ("verifications" in p && Array.isArray(p.verifications)) {
|
|
2101
|
+
const verifications = p.verifications;
|
|
2081
2102
|
return {
|
|
2082
|
-
protocol_version: "
|
|
2103
|
+
protocol_version: "3.0",
|
|
2083
2104
|
nonce: rpNonce,
|
|
2084
2105
|
action: config.action ?? "",
|
|
2085
|
-
responses:
|
|
2106
|
+
responses: verifications.map((v) => ({
|
|
2086
2107
|
identifier: v.verification_level,
|
|
2087
2108
|
signal_hash: v.signal_hash ?? signalHashes[v.verification_level],
|
|
2088
|
-
proof:
|
|
2089
|
-
nullifier: v.nullifier_hash,
|
|
2109
|
+
proof: v.proof,
|
|
2090
2110
|
merkle_root: v.merkle_root,
|
|
2091
|
-
|
|
2092
|
-
expires_at_min: 0
|
|
2111
|
+
nullifier: v.nullifier_hash
|
|
2093
2112
|
})),
|
|
2094
|
-
environment: "production"
|
|
2113
|
+
environment: config.environment ?? "production"
|
|
2095
2114
|
};
|
|
2096
2115
|
}
|
|
2097
|
-
const single = payload;
|
|
2098
2116
|
return {
|
|
2099
2117
|
protocol_version: "3.0",
|
|
2100
2118
|
nonce: rpNonce,
|
|
2101
2119
|
action: config.action ?? "",
|
|
2102
2120
|
responses: [
|
|
2103
2121
|
{
|
|
2104
|
-
identifier:
|
|
2105
|
-
signal_hash:
|
|
2106
|
-
proof:
|
|
2107
|
-
merkle_root:
|
|
2108
|
-
nullifier:
|
|
2122
|
+
identifier: p.verification_level,
|
|
2123
|
+
signal_hash: p.signal_hash ?? signalHashes[p.verification_level],
|
|
2124
|
+
proof: p.proof,
|
|
2125
|
+
merkle_root: p.merkle_root,
|
|
2126
|
+
nullifier: p.nullifier_hash
|
|
2109
2127
|
}
|
|
2110
2128
|
],
|
|
2111
|
-
environment: "production"
|
|
2129
|
+
environment: config.environment ?? "production"
|
|
2112
2130
|
};
|
|
2113
2131
|
}
|
|
2114
2132
|
|
|
@@ -2162,6 +2180,9 @@ function secureDocumentLegacy(opts = {}) {
|
|
|
2162
2180
|
function documentLegacy(opts = {}) {
|
|
2163
2181
|
return { type: "DocumentLegacy", signal: opts.signal };
|
|
2164
2182
|
}
|
|
2183
|
+
function selfieCheck(opts = {}) {
|
|
2184
|
+
return { type: "SelfieCheck", signal: opts.signal };
|
|
2185
|
+
}
|
|
2165
2186
|
function createWasmBuilderFromConfig(config) {
|
|
2166
2187
|
if (!config.rp_context) {
|
|
2167
2188
|
throw new Error("rp_context is required for WASM bridge transport");
|
|
@@ -2243,7 +2264,7 @@ var IDKitBuilder2 = class {
|
|
|
2243
2264
|
* Presets provide a simplified way to create requests with predefined
|
|
2244
2265
|
* credential configurations.
|
|
2245
2266
|
*
|
|
2246
|
-
* @param preset - A preset object from orbLegacy(), secureDocumentLegacy(), or
|
|
2267
|
+
* @param preset - A preset object from orbLegacy(), secureDocumentLegacy(), documentLegacy(), or selfieCheck()
|
|
2247
2268
|
* @returns A new IDKitRequest instance
|
|
2248
2269
|
*
|
|
2249
2270
|
* @example
|
|
@@ -2319,7 +2340,9 @@ var IDKit = {
|
|
|
2319
2340
|
/** Create a SecureDocumentLegacy preset for World ID 3.0 legacy support */
|
|
2320
2341
|
secureDocumentLegacy,
|
|
2321
2342
|
/** Create a DocumentLegacy preset for World ID 3.0 legacy support */
|
|
2322
|
-
documentLegacy
|
|
2343
|
+
documentLegacy,
|
|
2344
|
+
/** Create a SelfieCheck preset for face verification */
|
|
2345
|
+
selfieCheck
|
|
2323
2346
|
};
|
|
2324
2347
|
|
|
2325
2348
|
// src/lib/platform.ts
|
|
@@ -2366,3 +2389,4 @@ exports.isReactNative = isReactNative;
|
|
|
2366
2389
|
exports.isWeb = isWeb;
|
|
2367
2390
|
exports.orbLegacy = orbLegacy;
|
|
2368
2391
|
exports.secureDocumentLegacy = secureDocumentLegacy;
|
|
2392
|
+
exports.selfieCheck = selfieCheck;
|
package/dist/index.d.cts
CHANGED
|
@@ -98,7 +98,13 @@ interface DocumentLegacyPreset {
|
|
|
98
98
|
signal?: string;
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
|
|
101
|
+
interface SelfieCheckPreset {
|
|
102
|
+
/** Preview: Selfie Check is currently in preview. Contact us if you need it enabled. */
|
|
103
|
+
type: "SelfieCheck";
|
|
104
|
+
signal?: string;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
type Preset = OrbLegacyPreset | SecureDocumentLegacyPreset | DocumentLegacyPreset | SelfieCheckPreset;
|
|
102
108
|
|
|
103
109
|
|
|
104
110
|
|
|
@@ -384,6 +390,27 @@ declare function secureDocumentLegacy(opts?: {
|
|
|
384
390
|
declare function documentLegacy(opts?: {
|
|
385
391
|
signal?: string;
|
|
386
392
|
}): DocumentLegacyPreset;
|
|
393
|
+
/**
|
|
394
|
+
* Creates a SelfieCheck preset for face verification
|
|
395
|
+
*
|
|
396
|
+
* Preview: Selfie Check is currently in preview.
|
|
397
|
+
* Contact us if you need it enabled.
|
|
398
|
+
*
|
|
399
|
+
* This preset requests face credentials in v4 constraints.
|
|
400
|
+
* In legacy compatibility fields, it maps to verification level "face".
|
|
401
|
+
*
|
|
402
|
+
* @param opts - Optional configuration with signal
|
|
403
|
+
* @returns A SelfieCheck preset
|
|
404
|
+
*
|
|
405
|
+
* @example
|
|
406
|
+
* ```typescript
|
|
407
|
+
* const request = await IDKit.request({ app_id, action, rp_context, allow_legacy_proofs: false })
|
|
408
|
+
* .preset(selfieCheck({ signal: 'user-123' }))
|
|
409
|
+
* ```
|
|
410
|
+
*/
|
|
411
|
+
declare function selfieCheck(opts?: {
|
|
412
|
+
signal?: string;
|
|
413
|
+
}): SelfieCheckPreset;
|
|
387
414
|
/**
|
|
388
415
|
* Builder for IDKit requests
|
|
389
416
|
*
|
|
@@ -413,7 +440,7 @@ declare class IDKitBuilder {
|
|
|
413
440
|
* Presets provide a simplified way to create requests with predefined
|
|
414
441
|
* credential configurations.
|
|
415
442
|
*
|
|
416
|
-
* @param preset - A preset object from orbLegacy(), secureDocumentLegacy(), or
|
|
443
|
+
* @param preset - A preset object from orbLegacy(), secureDocumentLegacy(), documentLegacy(), or selfieCheck()
|
|
417
444
|
* @returns A new IDKitRequest instance
|
|
418
445
|
*
|
|
419
446
|
* @example
|
|
@@ -493,6 +520,8 @@ declare const IDKit: {
|
|
|
493
520
|
secureDocumentLegacy: typeof secureDocumentLegacy;
|
|
494
521
|
/** Create a DocumentLegacy preset for World ID 3.0 legacy support */
|
|
495
522
|
documentLegacy: typeof documentLegacy;
|
|
523
|
+
/** Create a SelfieCheck preset for face verification */
|
|
524
|
+
selfieCheck: typeof selfieCheck;
|
|
496
525
|
};
|
|
497
526
|
|
|
498
527
|
/**
|
|
@@ -517,4 +546,4 @@ declare const isWeb: () => boolean;
|
|
|
517
546
|
*/
|
|
518
547
|
declare const isNode: () => boolean;
|
|
519
548
|
|
|
520
|
-
export { type AbiEncodedValue, type ConstraintNode, type CredentialRequestType, type CredentialType, 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 Status$1 as Status, type WaitOptions, documentLegacy, isNode, isReactNative, isWeb, orbLegacy, secureDocumentLegacy };
|
|
549
|
+
export { type AbiEncodedValue, type ConstraintNode, type CredentialRequestType, type CredentialType, 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 SelfieCheckPreset, type Status$1 as Status, type WaitOptions, documentLegacy, isNode, isReactNative, isWeb, orbLegacy, secureDocumentLegacy, selfieCheck };
|
package/dist/index.d.ts
CHANGED
|
@@ -98,7 +98,13 @@ interface DocumentLegacyPreset {
|
|
|
98
98
|
signal?: string;
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
|
|
101
|
+
interface SelfieCheckPreset {
|
|
102
|
+
/** Preview: Selfie Check is currently in preview. Contact us if you need it enabled. */
|
|
103
|
+
type: "SelfieCheck";
|
|
104
|
+
signal?: string;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
type Preset = OrbLegacyPreset | SecureDocumentLegacyPreset | DocumentLegacyPreset | SelfieCheckPreset;
|
|
102
108
|
|
|
103
109
|
|
|
104
110
|
|
|
@@ -384,6 +390,27 @@ declare function secureDocumentLegacy(opts?: {
|
|
|
384
390
|
declare function documentLegacy(opts?: {
|
|
385
391
|
signal?: string;
|
|
386
392
|
}): DocumentLegacyPreset;
|
|
393
|
+
/**
|
|
394
|
+
* Creates a SelfieCheck preset for face verification
|
|
395
|
+
*
|
|
396
|
+
* Preview: Selfie Check is currently in preview.
|
|
397
|
+
* Contact us if you need it enabled.
|
|
398
|
+
*
|
|
399
|
+
* This preset requests face credentials in v4 constraints.
|
|
400
|
+
* In legacy compatibility fields, it maps to verification level "face".
|
|
401
|
+
*
|
|
402
|
+
* @param opts - Optional configuration with signal
|
|
403
|
+
* @returns A SelfieCheck preset
|
|
404
|
+
*
|
|
405
|
+
* @example
|
|
406
|
+
* ```typescript
|
|
407
|
+
* const request = await IDKit.request({ app_id, action, rp_context, allow_legacy_proofs: false })
|
|
408
|
+
* .preset(selfieCheck({ signal: 'user-123' }))
|
|
409
|
+
* ```
|
|
410
|
+
*/
|
|
411
|
+
declare function selfieCheck(opts?: {
|
|
412
|
+
signal?: string;
|
|
413
|
+
}): SelfieCheckPreset;
|
|
387
414
|
/**
|
|
388
415
|
* Builder for IDKit requests
|
|
389
416
|
*
|
|
@@ -413,7 +440,7 @@ declare class IDKitBuilder {
|
|
|
413
440
|
* Presets provide a simplified way to create requests with predefined
|
|
414
441
|
* credential configurations.
|
|
415
442
|
*
|
|
416
|
-
* @param preset - A preset object from orbLegacy(), secureDocumentLegacy(), or
|
|
443
|
+
* @param preset - A preset object from orbLegacy(), secureDocumentLegacy(), documentLegacy(), or selfieCheck()
|
|
417
444
|
* @returns A new IDKitRequest instance
|
|
418
445
|
*
|
|
419
446
|
* @example
|
|
@@ -493,6 +520,8 @@ declare const IDKit: {
|
|
|
493
520
|
secureDocumentLegacy: typeof secureDocumentLegacy;
|
|
494
521
|
/** Create a DocumentLegacy preset for World ID 3.0 legacy support */
|
|
495
522
|
documentLegacy: typeof documentLegacy;
|
|
523
|
+
/** Create a SelfieCheck preset for face verification */
|
|
524
|
+
selfieCheck: typeof selfieCheck;
|
|
496
525
|
};
|
|
497
526
|
|
|
498
527
|
/**
|
|
@@ -517,4 +546,4 @@ declare const isWeb: () => boolean;
|
|
|
517
546
|
*/
|
|
518
547
|
declare const isNode: () => boolean;
|
|
519
548
|
|
|
520
|
-
export { type AbiEncodedValue, type ConstraintNode, type CredentialRequestType, type CredentialType, 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 Status$1 as Status, type WaitOptions, documentLegacy, isNode, isReactNative, isWeb, orbLegacy, secureDocumentLegacy };
|
|
549
|
+
export { type AbiEncodedValue, type ConstraintNode, type CredentialRequestType, type CredentialType, 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 SelfieCheckPreset, type Status$1 as Status, type WaitOptions, documentLegacy, isNode, isReactNative, isWeb, orbLegacy, secureDocumentLegacy, selfieCheck };
|
package/dist/index.js
CHANGED
|
@@ -389,14 +389,14 @@ function hashSignal(signal) {
|
|
|
389
389
|
wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
|
|
390
390
|
}
|
|
391
391
|
}
|
|
392
|
-
function
|
|
393
|
-
wasm.
|
|
392
|
+
function __wasm_bindgen_func_elem_605(arg0, arg1) {
|
|
393
|
+
wasm.__wasm_bindgen_func_elem_605(arg0, arg1);
|
|
394
394
|
}
|
|
395
|
-
function
|
|
396
|
-
wasm.
|
|
395
|
+
function __wasm_bindgen_func_elem_968(arg0, arg1, arg2) {
|
|
396
|
+
wasm.__wasm_bindgen_func_elem_968(arg0, arg1, addHeapObject(arg2));
|
|
397
397
|
}
|
|
398
|
-
function
|
|
399
|
-
wasm.
|
|
398
|
+
function __wasm_bindgen_func_elem_1353(arg0, arg1, arg2, arg3) {
|
|
399
|
+
wasm.__wasm_bindgen_func_elem_1353(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
400
400
|
}
|
|
401
401
|
var __wbindgen_enum_RequestCache = ["default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached"];
|
|
402
402
|
var __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
|
|
@@ -1559,7 +1559,7 @@ function __wbg_get_imports() {
|
|
|
1559
1559
|
const a = state0.a;
|
|
1560
1560
|
state0.a = 0;
|
|
1561
1561
|
try {
|
|
1562
|
-
return
|
|
1562
|
+
return __wasm_bindgen_func_elem_1353(a, state0.b, arg02, arg12);
|
|
1563
1563
|
} finally {
|
|
1564
1564
|
state0.a = a;
|
|
1565
1565
|
}
|
|
@@ -1768,12 +1768,12 @@ function __wbg_get_imports() {
|
|
|
1768
1768
|
const ret = getObject(arg0).versions;
|
|
1769
1769
|
return addHeapObject(ret);
|
|
1770
1770
|
};
|
|
1771
|
-
imports.wbg.
|
|
1772
|
-
const ret =
|
|
1771
|
+
imports.wbg.__wbindgen_cast_02740531cfdb05fe = function(arg0, arg1) {
|
|
1772
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_604, __wasm_bindgen_func_elem_605);
|
|
1773
1773
|
return addHeapObject(ret);
|
|
1774
1774
|
};
|
|
1775
|
-
imports.wbg.
|
|
1776
|
-
const ret =
|
|
1775
|
+
imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
|
|
1776
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
1777
1777
|
return addHeapObject(ret);
|
|
1778
1778
|
};
|
|
1779
1779
|
imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
|
|
@@ -1784,10 +1784,6 @@ function __wbg_get_imports() {
|
|
|
1784
1784
|
const ret = arg0;
|
|
1785
1785
|
return addHeapObject(ret);
|
|
1786
1786
|
};
|
|
1787
|
-
imports.wbg.__wbindgen_cast_b8b1061c2d0ea705 = function(arg0, arg1) {
|
|
1788
|
-
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_598, __wasm_bindgen_func_elem_599);
|
|
1789
|
-
return addHeapObject(ret);
|
|
1790
|
-
};
|
|
1791
1787
|
imports.wbg.__wbindgen_cast_cb9088102bce6b30 = function(arg0, arg1) {
|
|
1792
1788
|
const ret = getArrayU8FromWasm0(arg0, arg1);
|
|
1793
1789
|
return addHeapObject(ret);
|
|
@@ -1796,6 +1792,10 @@ function __wbg_get_imports() {
|
|
|
1796
1792
|
const ret = arg0;
|
|
1797
1793
|
return addHeapObject(ret);
|
|
1798
1794
|
};
|
|
1795
|
+
imports.wbg.__wbindgen_cast_f23235b6472d5cf3 = function(arg0, arg1) {
|
|
1796
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_967, __wasm_bindgen_func_elem_968);
|
|
1797
|
+
return addHeapObject(ret);
|
|
1798
|
+
};
|
|
1799
1799
|
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
|
|
1800
1800
|
const ret = getObject(arg0);
|
|
1801
1801
|
return addHeapObject(ret);
|
|
@@ -2057,55 +2057,73 @@ var NativeVerifyError = class extends Error {
|
|
|
2057
2057
|
}
|
|
2058
2058
|
};
|
|
2059
2059
|
function nativeResultToIDKitResult(payload, config, signalHashes) {
|
|
2060
|
+
const p = payload;
|
|
2060
2061
|
const rpNonce = config.rp_context?.nonce ?? "";
|
|
2061
|
-
if ("responses" in
|
|
2062
|
-
const
|
|
2062
|
+
if ("responses" in p && Array.isArray(p.responses)) {
|
|
2063
|
+
const items = p.responses;
|
|
2064
|
+
if (p.session_id) {
|
|
2065
|
+
return {
|
|
2066
|
+
protocol_version: "4.0",
|
|
2067
|
+
nonce: p.nonce ?? rpNonce,
|
|
2068
|
+
action_description: p.action_description,
|
|
2069
|
+
session_id: p.session_id,
|
|
2070
|
+
responses: items.map((item) => ({
|
|
2071
|
+
identifier: item.identifier,
|
|
2072
|
+
signal_hash: signalHashes[item.identifier],
|
|
2073
|
+
proof: item.proof,
|
|
2074
|
+
session_nullifier: item.session_nullifier,
|
|
2075
|
+
issuer_schema_id: item.issuer_schema_id,
|
|
2076
|
+
expires_at_min: item.expires_at_min
|
|
2077
|
+
})),
|
|
2078
|
+
environment: config.environment ?? "production"
|
|
2079
|
+
};
|
|
2080
|
+
}
|
|
2063
2081
|
return {
|
|
2064
|
-
protocol_version:
|
|
2065
|
-
nonce:
|
|
2066
|
-
action:
|
|
2067
|
-
action_description:
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2082
|
+
protocol_version: "4.0",
|
|
2083
|
+
nonce: p.nonce ?? rpNonce,
|
|
2084
|
+
action: p.action ?? config.action ?? "",
|
|
2085
|
+
action_description: p.action_description,
|
|
2086
|
+
responses: items.map((item) => ({
|
|
2087
|
+
identifier: item.identifier,
|
|
2088
|
+
signal_hash: signalHashes[item.identifier],
|
|
2089
|
+
proof: item.proof,
|
|
2090
|
+
nullifier: item.nullifier,
|
|
2091
|
+
issuer_schema_id: item.issuer_schema_id,
|
|
2092
|
+
expires_at_min: item.expires_at_min
|
|
2072
2093
|
})),
|
|
2073
|
-
environment:
|
|
2094
|
+
environment: config.environment ?? "production"
|
|
2074
2095
|
};
|
|
2075
2096
|
}
|
|
2076
|
-
if ("verifications" in
|
|
2077
|
-
const
|
|
2097
|
+
if ("verifications" in p && Array.isArray(p.verifications)) {
|
|
2098
|
+
const verifications = p.verifications;
|
|
2078
2099
|
return {
|
|
2079
|
-
protocol_version: "
|
|
2100
|
+
protocol_version: "3.0",
|
|
2080
2101
|
nonce: rpNonce,
|
|
2081
2102
|
action: config.action ?? "",
|
|
2082
|
-
responses:
|
|
2103
|
+
responses: verifications.map((v) => ({
|
|
2083
2104
|
identifier: v.verification_level,
|
|
2084
2105
|
signal_hash: v.signal_hash ?? signalHashes[v.verification_level],
|
|
2085
|
-
proof:
|
|
2086
|
-
nullifier: v.nullifier_hash,
|
|
2106
|
+
proof: v.proof,
|
|
2087
2107
|
merkle_root: v.merkle_root,
|
|
2088
|
-
|
|
2089
|
-
expires_at_min: 0
|
|
2108
|
+
nullifier: v.nullifier_hash
|
|
2090
2109
|
})),
|
|
2091
|
-
environment: "production"
|
|
2110
|
+
environment: config.environment ?? "production"
|
|
2092
2111
|
};
|
|
2093
2112
|
}
|
|
2094
|
-
const single = payload;
|
|
2095
2113
|
return {
|
|
2096
2114
|
protocol_version: "3.0",
|
|
2097
2115
|
nonce: rpNonce,
|
|
2098
2116
|
action: config.action ?? "",
|
|
2099
2117
|
responses: [
|
|
2100
2118
|
{
|
|
2101
|
-
identifier:
|
|
2102
|
-
signal_hash:
|
|
2103
|
-
proof:
|
|
2104
|
-
merkle_root:
|
|
2105
|
-
nullifier:
|
|
2119
|
+
identifier: p.verification_level,
|
|
2120
|
+
signal_hash: p.signal_hash ?? signalHashes[p.verification_level],
|
|
2121
|
+
proof: p.proof,
|
|
2122
|
+
merkle_root: p.merkle_root,
|
|
2123
|
+
nullifier: p.nullifier_hash
|
|
2106
2124
|
}
|
|
2107
2125
|
],
|
|
2108
|
-
environment: "production"
|
|
2126
|
+
environment: config.environment ?? "production"
|
|
2109
2127
|
};
|
|
2110
2128
|
}
|
|
2111
2129
|
|
|
@@ -2159,6 +2177,9 @@ function secureDocumentLegacy(opts = {}) {
|
|
|
2159
2177
|
function documentLegacy(opts = {}) {
|
|
2160
2178
|
return { type: "DocumentLegacy", signal: opts.signal };
|
|
2161
2179
|
}
|
|
2180
|
+
function selfieCheck(opts = {}) {
|
|
2181
|
+
return { type: "SelfieCheck", signal: opts.signal };
|
|
2182
|
+
}
|
|
2162
2183
|
function createWasmBuilderFromConfig(config) {
|
|
2163
2184
|
if (!config.rp_context) {
|
|
2164
2185
|
throw new Error("rp_context is required for WASM bridge transport");
|
|
@@ -2240,7 +2261,7 @@ var IDKitBuilder2 = class {
|
|
|
2240
2261
|
* Presets provide a simplified way to create requests with predefined
|
|
2241
2262
|
* credential configurations.
|
|
2242
2263
|
*
|
|
2243
|
-
* @param preset - A preset object from orbLegacy(), secureDocumentLegacy(), or
|
|
2264
|
+
* @param preset - A preset object from orbLegacy(), secureDocumentLegacy(), documentLegacy(), or selfieCheck()
|
|
2244
2265
|
* @returns A new IDKitRequest instance
|
|
2245
2266
|
*
|
|
2246
2267
|
* @example
|
|
@@ -2316,7 +2337,9 @@ var IDKit = {
|
|
|
2316
2337
|
/** Create a SecureDocumentLegacy preset for World ID 3.0 legacy support */
|
|
2317
2338
|
secureDocumentLegacy,
|
|
2318
2339
|
/** Create a DocumentLegacy preset for World ID 3.0 legacy support */
|
|
2319
|
-
documentLegacy
|
|
2340
|
+
documentLegacy,
|
|
2341
|
+
/** Create a SelfieCheck preset for face verification */
|
|
2342
|
+
selfieCheck
|
|
2320
2343
|
};
|
|
2321
2344
|
|
|
2322
2345
|
// src/lib/platform.ts
|
|
@@ -2350,4 +2373,4 @@ function isValidHex(s) {
|
|
|
2350
2373
|
return /^[0-9a-fA-F]+$/.test(s);
|
|
2351
2374
|
}
|
|
2352
2375
|
|
|
2353
|
-
export { IDKit, IDKitErrorCodes, documentLegacy, hashSignal2 as hashSignal, isNode, isReactNative, isWeb, orbLegacy, secureDocumentLegacy };
|
|
2376
|
+
export { IDKit, IDKitErrorCodes, documentLegacy, hashSignal2 as hashSignal, isNode, isReactNative, isWeb, orbLegacy, secureDocumentLegacy, selfieCheck };
|