@zkpassport/sdk 0.8.5 → 0.8.6
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 +8 -8
- package/dist/esm/index.js +3 -2
- package/package.json +2 -2
package/dist/cjs/index.cjs
CHANGED
|
@@ -3270,19 +3270,19 @@ var ZKPassport = class {
|
|
|
3270
3270
|
).map((x) => x.toString(16).padStart(2, "0")).join("");
|
|
3271
3271
|
} else if (circuitName === "compare_age_evm") {
|
|
3272
3272
|
const value = proof.committedInputs[circuitName];
|
|
3273
|
-
const currentDateBytes = Array.from((0,
|
|
3273
|
+
const currentDateBytes = Array.from((0, import_utils.numberToBytesBE)(value.currentDateTimestamp, 8));
|
|
3274
3274
|
compressedCommittedInputs2 = import_utils.ProofType.AGE.toString(16).padStart(2, "0") + currentDateBytes.map((x) => x.toString(16).padStart(2, "0")).join("") + value.minAge.toString(16).padStart(2, "0") + value.maxAge.toString(16).padStart(2, "0");
|
|
3275
3275
|
} else if (circuitName === "compare_birthdate_evm") {
|
|
3276
3276
|
const value = proof.committedInputs[circuitName];
|
|
3277
|
-
const currentDateBytes = Array.from((0,
|
|
3278
|
-
const minDateBytes = Array.from((0,
|
|
3279
|
-
const maxDateBytes = Array.from((0,
|
|
3277
|
+
const currentDateBytes = Array.from((0, import_utils.numberToBytesBE)(value.currentDateTimestamp, 8));
|
|
3278
|
+
const minDateBytes = Array.from((0, import_utils.numberToBytesBE)(value.minDateTimestamp, 8));
|
|
3279
|
+
const maxDateBytes = Array.from((0, import_utils.numberToBytesBE)(value.maxDateTimestamp, 8));
|
|
3280
3280
|
compressedCommittedInputs2 = import_utils.ProofType.BIRTHDATE.toString(16).padStart(2, "0") + currentDateBytes.map((x) => x.toString(16).padStart(2, "0")).join("") + minDateBytes.map((x) => x.toString(16).padStart(2, "0")).join("") + maxDateBytes.map((x) => x.toString(16).padStart(2, "0")).join("");
|
|
3281
3281
|
} else if (circuitName === "compare_expiry_evm") {
|
|
3282
3282
|
const value = proof.committedInputs[circuitName];
|
|
3283
|
-
const currentDateBytes = Array.from((0,
|
|
3284
|
-
const minDateBytes = Array.from((0,
|
|
3285
|
-
const maxDateBytes = Array.from((0,
|
|
3283
|
+
const currentDateBytes = Array.from((0, import_utils.numberToBytesBE)(value.currentDateTimestamp, 8));
|
|
3284
|
+
const minDateBytes = Array.from((0, import_utils.numberToBytesBE)(value.minDateTimestamp, 8));
|
|
3285
|
+
const maxDateBytes = Array.from((0, import_utils.numberToBytesBE)(value.maxDateTimestamp, 8));
|
|
3286
3286
|
compressedCommittedInputs2 = import_utils.ProofType.EXPIRY_DATE.toString(16).padStart(2, "0") + currentDateBytes.map((x) => x.toString(16).padStart(2, "0")).join("") + minDateBytes.map((x) => x.toString(16).padStart(2, "0")).join("") + maxDateBytes.map((x) => x.toString(16).padStart(2, "0")).join("");
|
|
3287
3287
|
} else if (circuitName === "disclose_bytes_evm") {
|
|
3288
3288
|
const value = proof.committedInputs[circuitName];
|
|
@@ -3292,7 +3292,7 @@ var ZKPassport = class {
|
|
|
3292
3292
|
compressedCommittedInputs2 = import_utils.ProofType.BIND.toString(16).padStart(2, "0") + (0, import_utils.rightPadArrayWithZeros)((0, import_utils.formatBoundData)(value.data), 500).map((x) => x.toString(16).padStart(2, "0")).join("");
|
|
3293
3293
|
} else if (circuitName === "exclusion_check_sanctions_evm") {
|
|
3294
3294
|
const value = proof.committedInputs[circuitName];
|
|
3295
|
-
compressedCommittedInputs2 = import_utils.ProofType.SANCTIONS_EXCLUSION.toString(16).padStart(2, "0") + Array.from((0,
|
|
3295
|
+
compressedCommittedInputs2 = import_utils.ProofType.SANCTIONS_EXCLUSION.toString(16).padStart(2, "0") + Array.from((0, import_utils.numberToBytesBE)(BigInt(value.rootHash), 32)).map((x) => x.toString(16).padStart(2, "0")).join("");
|
|
3296
3296
|
} else {
|
|
3297
3297
|
throw new Error(`Unsupported circuit for EVM verification: ${circuitName}`);
|
|
3298
3298
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -52,9 +52,10 @@ import {
|
|
|
52
52
|
getBirthdateMinDateTimestamp,
|
|
53
53
|
getBirthdateMaxDateTimestamp,
|
|
54
54
|
SanctionsBuilder,
|
|
55
|
-
SECONDS_BETWEEN_1900_AND_1970
|
|
55
|
+
SECONDS_BETWEEN_1900_AND_1970,
|
|
56
|
+
numberToBytesBE
|
|
56
57
|
} from "@zkpassport/utils";
|
|
57
|
-
import { bytesToHex
|
|
58
|
+
import { bytesToHex } from "@noble/ciphers/utils";
|
|
58
59
|
import i18en from "i18n-iso-countries/langs/en.json";
|
|
59
60
|
import { Buffer } from "buffer/";
|
|
60
61
|
import { sha256 } from "@noble/hashes/sha2";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zkpassport/sdk",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.6",
|
|
4
4
|
"description": "Privacy-preserving identity verification using passports and ID cards",
|
|
5
5
|
"author": "ZKPassport",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@noble/secp256k1": "^2.2.3",
|
|
38
38
|
"@obsidion/bridge": "^0.10.4",
|
|
39
39
|
"@zkpassport/registry": "0.10.2",
|
|
40
|
-
"@zkpassport/utils": "0.22.
|
|
40
|
+
"@zkpassport/utils": "0.22.12",
|
|
41
41
|
"buffer": "^6.0.3",
|
|
42
42
|
"i18n-iso-countries": "^7.12.0",
|
|
43
43
|
"pako": "^2.1.0",
|