@zkpassport/sdk 0.9.1 → 0.10.0
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/constants.cjs +1 -1
- package/dist/cjs/constants.d.cts +1 -1
- package/dist/cjs/index.cjs +95 -73
- package/dist/cjs/public-input-checker.cjs +5 -11
- package/dist/cjs/solidity-verifier.cjs +76 -50
- package/dist/esm/chunk-I7PGO4XY.js +2567 -0
- package/dist/esm/{chunk-VJZDMGW3.js → chunk-JG37KYXW.js} +1 -1
- package/dist/esm/{chunk-OOHOBXGU.js → chunk-O7ZONMCQ.js} +6 -12
- package/dist/esm/constants.d.ts +1 -1
- package/dist/esm/constants.js +1 -1
- package/dist/esm/index.js +16 -14
- package/dist/esm/public-input-checker.js +2 -2
- package/dist/esm/solidity-verifier.js +2 -2
- package/package.json +4 -4
- package/dist/esm/chunk-OTQ7QDA2.js +0 -2541
|
@@ -967,12 +967,6 @@ var PublicInputChecker = class {
|
|
|
967
967
|
};
|
|
968
968
|
}
|
|
969
969
|
const EXPECTED_ENVIRONMENT = "production";
|
|
970
|
-
console.log("facematchCommittedInputs.environment", facematchCommittedInputs.environment);
|
|
971
|
-
console.log("EXPECTED_ENVIRONMENT", EXPECTED_ENVIRONMENT);
|
|
972
|
-
console.log(
|
|
973
|
-
"facematchCommittedInputs.environment !== EXPECTED_ENVIRONMENT",
|
|
974
|
-
facematchCommittedInputs.environment !== EXPECTED_ENVIRONMENT
|
|
975
|
-
);
|
|
976
970
|
if (facematchCommittedInputs.environment !== EXPECTED_ENVIRONMENT) {
|
|
977
971
|
console.warn("Invalid facematch environment, it should be production");
|
|
978
972
|
isCorrect = false;
|
|
@@ -985,7 +979,7 @@ var PublicInputChecker = class {
|
|
|
985
979
|
}
|
|
986
980
|
};
|
|
987
981
|
}
|
|
988
|
-
if (facematchCommittedInputs.
|
|
982
|
+
if (facematchCommittedInputs.appIdHash !== ZKPASSPORT_IOS_APP_ID_HASH && facematchCommittedInputs.appIdHash !== ZKPASSPORT_ANDROID_APP_ID_HASH) {
|
|
989
983
|
console.warn(
|
|
990
984
|
"Invalid facematch app id hash, the attestation should be coming from the ZKPassport app"
|
|
991
985
|
);
|
|
@@ -994,7 +988,7 @@ var PublicInputChecker = class {
|
|
|
994
988
|
...queryResultErrors.facematch,
|
|
995
989
|
eq: {
|
|
996
990
|
expected: `${ZKPASSPORT_IOS_APP_ID_HASH} (iOS) or ${ZKPASSPORT_ANDROID_APP_ID_HASH} (Android)`,
|
|
997
|
-
received: facematchCommittedInputs.
|
|
991
|
+
received: facematchCommittedInputs.appIdHash,
|
|
998
992
|
message: "Invalid facematch app id hash, the attestation should be coming from the ZKPassport app"
|
|
999
993
|
}
|
|
1000
994
|
};
|
|
@@ -1436,12 +1430,12 @@ var PublicInputChecker = class {
|
|
|
1436
1430
|
const facematchParameterCommitment = isForEVM ? await (0, import_utils.getFacematchEvmParameterCommitment)(
|
|
1437
1431
|
BigInt(facematchCommittedInputs.rootKeyLeaf),
|
|
1438
1432
|
facematchCommittedInputs.environment === "development" ? 0n : 1n,
|
|
1439
|
-
BigInt(facematchCommittedInputs.
|
|
1433
|
+
BigInt(facematchCommittedInputs.appIdHash),
|
|
1440
1434
|
facematchCommittedInputs.mode === "regular" ? 1n : 2n
|
|
1441
1435
|
) : await (0, import_utils.getFacematchParameterCommitment)(
|
|
1442
1436
|
BigInt(facematchCommittedInputs.rootKeyLeaf),
|
|
1443
1437
|
facematchCommittedInputs.environment === "development" ? 0n : 1n,
|
|
1444
|
-
BigInt(facematchCommittedInputs.
|
|
1438
|
+
BigInt(facematchCommittedInputs.appIdHash),
|
|
1445
1439
|
facematchCommittedInputs.mode === "regular" ? 1n : 2n
|
|
1446
1440
|
);
|
|
1447
1441
|
if (!paramCommitments.includes(facematchParameterCommitment)) {
|
|
@@ -2031,7 +2025,7 @@ var PublicInputChecker = class {
|
|
|
2031
2025
|
const calculatedParamCommitment = await (0, import_utils.getFacematchParameterCommitment)(
|
|
2032
2026
|
BigInt(facematchCommittedInputs.rootKeyLeaf),
|
|
2033
2027
|
facematchCommittedInputs.environment === "development" ? 0n : 1n,
|
|
2034
|
-
BigInt(facematchCommittedInputs.
|
|
2028
|
+
BigInt(facematchCommittedInputs.appIdHash),
|
|
2035
2029
|
facematchCommittedInputs.mode === "regular" ? 1n : 2n
|
|
2036
2030
|
);
|
|
2037
2031
|
if (paramCommittment !== calculatedParamCommitment) {
|