@zkpassport/sdk 0.3.2 → 0.3.4
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.js +8 -0
- package/dist/esm/index.js +8 -0
- package/package.json +3 -3
- package/src/index.ts +8 -0
package/dist/cjs/index.js
CHANGED
|
@@ -1910,6 +1910,14 @@ class ZKPassport {
|
|
|
1910
1910
|
* and a boolean indicating whether the proofs were successfully verified.
|
|
1911
1911
|
*/
|
|
1912
1912
|
async verify({ proofs, queryResult, validity, scope, devMode = false, }) {
|
|
1913
|
+
// If no proofs were generated, the results can't be trusted.
|
|
1914
|
+
// We still return it but verified will be false
|
|
1915
|
+
if (!proofs || proofs.length === 0) {
|
|
1916
|
+
return {
|
|
1917
|
+
uniqueIdentifier: undefined,
|
|
1918
|
+
verified: false,
|
|
1919
|
+
};
|
|
1920
|
+
}
|
|
1913
1921
|
const formattedResult = queryResult;
|
|
1914
1922
|
// Make sure to reconvert the dates to Date objects
|
|
1915
1923
|
if (formattedResult.birthdate && formattedResult.birthdate.disclose) {
|
package/dist/esm/index.js
CHANGED
|
@@ -1900,6 +1900,14 @@ export class ZKPassport {
|
|
|
1900
1900
|
* and a boolean indicating whether the proofs were successfully verified.
|
|
1901
1901
|
*/
|
|
1902
1902
|
async verify({ proofs, queryResult, validity, scope, devMode = false, }) {
|
|
1903
|
+
// If no proofs were generated, the results can't be trusted.
|
|
1904
|
+
// We still return it but verified will be false
|
|
1905
|
+
if (!proofs || proofs.length === 0) {
|
|
1906
|
+
return {
|
|
1907
|
+
uniqueIdentifier: undefined,
|
|
1908
|
+
verified: false,
|
|
1909
|
+
};
|
|
1910
|
+
}
|
|
1903
1911
|
const formattedResult = queryResult;
|
|
1904
1912
|
// Make sure to reconvert the dates to Date objects
|
|
1905
1913
|
if (formattedResult.birthdate && formattedResult.birthdate.disclose) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zkpassport/sdk",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
4
4
|
"description": "Privacy-preserving identity verification using passports and ID cards",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"@noble/ciphers": "^1.2.1",
|
|
43
43
|
"@noble/hashes": "^1.7.2",
|
|
44
44
|
"@noble/secp256k1": "^2.2.3",
|
|
45
|
-
"@zkpassport/registry": "^0.1.
|
|
46
|
-
"@zkpassport/utils": "^0.7.
|
|
45
|
+
"@zkpassport/registry": "^0.1.9",
|
|
46
|
+
"@zkpassport/utils": "^0.7.4",
|
|
47
47
|
"buffer": "^6.0.3",
|
|
48
48
|
"i18n-iso-countries": "^7.12.0",
|
|
49
49
|
"pako": "^2.1.0",
|
package/src/index.ts
CHANGED
|
@@ -2666,6 +2666,14 @@ export class ZKPassport {
|
|
|
2666
2666
|
verified: boolean
|
|
2667
2667
|
queryResultErrors?: QueryResultErrors
|
|
2668
2668
|
}> {
|
|
2669
|
+
// If no proofs were generated, the results can't be trusted.
|
|
2670
|
+
// We still return it but verified will be false
|
|
2671
|
+
if (!proofs || proofs.length === 0) {
|
|
2672
|
+
return {
|
|
2673
|
+
uniqueIdentifier: undefined,
|
|
2674
|
+
verified: false,
|
|
2675
|
+
}
|
|
2676
|
+
}
|
|
2669
2677
|
const formattedResult: QueryResult = queryResult
|
|
2670
2678
|
// Make sure to reconvert the dates to Date objects
|
|
2671
2679
|
if (formattedResult.birthdate && formattedResult.birthdate.disclose) {
|