@zkpassport/sdk 0.10.0 → 0.11.0-beta.2
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/cjs/index.cjs +386 -854
- package/dist/cjs/public-input-checker.cjs +164 -84
- package/dist/cjs/public-input-checker.d.cts +1 -0
- package/dist/cjs/solidity-verifier.cjs +218 -767
- package/dist/cjs/types.d.cts +11 -2
- package/dist/esm/{chunk-O7ZONMCQ.js → chunk-6IK5VUOR.js} +168 -87
- package/dist/esm/chunk-CFGZMKF7.js +2019 -0
- package/dist/esm/index.js +6 -5
- package/dist/esm/public-input-checker.d.ts +1 -0
- package/dist/esm/public-input-checker.js +1 -1
- package/dist/esm/solidity-verifier.js +1 -1
- package/dist/esm/types.d.ts +11 -2
- package/package.json +3 -3
- package/dist/esm/chunk-I7PGO4XY.js +0 -2567
package/dist/esm/index.js
CHANGED
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-AFLQN3AC.js";
|
|
4
4
|
import {
|
|
5
5
|
PublicInputChecker
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-6IK5VUOR.js";
|
|
7
7
|
import {
|
|
8
8
|
SolidityVerifier
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-CFGZMKF7.js";
|
|
10
10
|
import {
|
|
11
11
|
DEFAULT_VALIDITY,
|
|
12
12
|
VERSION
|
|
@@ -309,7 +309,7 @@ var ZKPassport = class {
|
|
|
309
309
|
};
|
|
310
310
|
return this.getZkPassportRequest(topic);
|
|
311
311
|
},
|
|
312
|
-
sanctions: (countries = "all", lists = "all") => {
|
|
312
|
+
sanctions: (countries = "all", lists = "all", options = { strict: false }) => {
|
|
313
313
|
this.topicToConfig[topic].sanctions = {
|
|
314
314
|
...this.topicToConfig[topic].sanctions,
|
|
315
315
|
countries: countries === "all" ? "all" : Array.isArray(countries) ? [
|
|
@@ -319,7 +319,8 @@ var ZKPassport = class {
|
|
|
319
319
|
...this.topicToConfig[topic].sanctions?.countries ?? [],
|
|
320
320
|
countries
|
|
321
321
|
],
|
|
322
|
-
lists: lists === "all" ? "all" : Array.isArray(lists) ? [...this.topicToConfig[topic].sanctions?.lists ?? [], ...lists] : [...this.topicToConfig[topic].sanctions?.lists ?? [], lists]
|
|
322
|
+
lists: lists === "all" ? "all" : Array.isArray(lists) ? [...this.topicToConfig[topic].sanctions?.lists ?? [], ...lists] : [...this.topicToConfig[topic].sanctions?.lists ?? [], lists],
|
|
323
|
+
strict: options.strict ?? false
|
|
323
324
|
};
|
|
324
325
|
return this.getZkPassportRequest(topic);
|
|
325
326
|
},
|
|
@@ -575,7 +576,7 @@ var ZKPassport = class {
|
|
|
575
576
|
);
|
|
576
577
|
const pubkey = this.topicToPublicKey[requestId];
|
|
577
578
|
const timestamp = Math.floor(Date.now() / 1e3) - this.topicToLocalConfig[requestId].validity;
|
|
578
|
-
return `https://zkpassport.id/r?d=${this.domain}&t=${requestId}&c=${base64Config}&s=${base64Service}&p=${pubkey}&m=${this.topicToLocalConfig[requestId].mode}&v=${VERSION}&dt=${timestamp}`;
|
|
579
|
+
return `https://zkpassport.id/r?d=${this.domain}&t=${requestId}&c=${base64Config}&s=${base64Service}&p=${pubkey}&m=${this.topicToLocalConfig[requestId].mode}&v=${VERSION}&dt=${timestamp}&dev=${this.topicToLocalConfig[requestId].devMode ? "1" : "0"}`;
|
|
579
580
|
}
|
|
580
581
|
/**
|
|
581
582
|
* @notice Returns the URL of the request.
|
|
@@ -58,6 +58,7 @@ declare class PublicInputChecker {
|
|
|
58
58
|
isCorrect: boolean;
|
|
59
59
|
queryResultErrors: Partial<QueryResultErrors>;
|
|
60
60
|
}>;
|
|
61
|
+
private static checkCurrentDate;
|
|
61
62
|
static checkPublicInputs(domain: string, proofs: Array<ProofResult>, queryResult: QueryResult, validity?: number, scope?: string): Promise<{
|
|
62
63
|
isCorrect: boolean;
|
|
63
64
|
uniqueIdentifier: string | undefined;
|
package/dist/esm/types.d.ts
CHANGED
|
@@ -175,8 +175,17 @@ type QueryBuilder = {
|
|
|
175
175
|
* e.g. "US", ["US", "GB", "CH", "EU"], "all"
|
|
176
176
|
* @param lists The specific lists from a given country to check against. Defaults to "all".
|
|
177
177
|
* e.g. ["OFAC_SDN"], "all"
|
|
178
|
-
|
|
179
|
-
|
|
178
|
+
* @param options The options to use for the sanction check.
|
|
179
|
+
* @param options.strict Whether to use a strict sanction check. Defaults to false.
|
|
180
|
+
*
|
|
181
|
+
* If set to true, this means the checks will be done against just the lastname and firstname,
|
|
182
|
+
* while when set to false, matches will need to include either the date of birth and name or
|
|
183
|
+
* the passport number and nationality.
|
|
184
|
+
* Strict mode has therefore a higher false positive rate but is harder to evade.
|
|
185
|
+
*/
|
|
186
|
+
sanctions: (countries?: SanctionsCountries, lists?: SanctionsLists, options?: {
|
|
187
|
+
strict?: boolean;
|
|
188
|
+
}) => QueryBuilder;
|
|
180
189
|
/**
|
|
181
190
|
* This feature is not available yet in the public release of the app.
|
|
182
191
|
* Requires that the ID holder's face matches the photo on the ID.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zkpassport/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0-beta.2",
|
|
4
4
|
"description": "Privacy-preserving identity verification using passports and ID cards",
|
|
5
5
|
"author": "ZKPassport",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
"@noble/ciphers": "^1.2.1",
|
|
36
36
|
"@noble/hashes": "^1.7.2",
|
|
37
37
|
"@noble/secp256k1": "^2.2.3",
|
|
38
|
-
"@obsidion/bridge": "^0.
|
|
38
|
+
"@obsidion/bridge": "^0.11.1",
|
|
39
39
|
"@zkpassport/registry": "0.11.1",
|
|
40
|
-
"@zkpassport/utils": "0.
|
|
40
|
+
"@zkpassport/utils": "0.29.2",
|
|
41
41
|
"buffer": "^6.0.3",
|
|
42
42
|
"i18n-iso-countries": "^7.12.0",
|
|
43
43
|
"pako": "^2.1.0",
|