@zkpassport/sdk 0.5.1 → 0.5.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.
@@ -246,13 +246,14 @@ export declare class ZKPassport {
246
246
  * @returns An object containing the unique identifier associated to the user
247
247
  * and a boolean indicating whether the proofs were successfully verified.
248
248
  */
249
- verify({ proofs, queryResult, validity, scope, evmChain, devMode, }: {
249
+ verify({ proofs, queryResult, validity, scope, evmChain, devMode, crsPath, }: {
250
250
  proofs: Array<ProofResult>;
251
251
  queryResult: QueryResult;
252
252
  validity?: number;
253
253
  scope?: string;
254
254
  evmChain?: EVMChain;
255
255
  devMode?: boolean;
256
+ crsPath?: string;
256
257
  }): Promise<{
257
258
  uniqueIdentifier: string | undefined;
258
259
  verified: boolean;
package/dist/cjs/index.js CHANGED
@@ -13,7 +13,7 @@ const utils_3 = require("@noble/hashes/utils");
13
13
  const ZKPassportVerifier_json_1 = tslib_1.__importDefault(require("./assets/abi/ZKPassportVerifier.json"));
14
14
  const registry_1 = require("@zkpassport/registry");
15
15
  const bridge_1 = require("@obsidion/bridge");
16
- const VERSION = "0.5.0";
16
+ const VERSION = "0.5.2";
17
17
  const DEFAULT_DATE_VALUE = new Date(1111, 10, 11);
18
18
  // If Buffer is not defined, then we use the Buffer from the buffer package
19
19
  if (typeof globalThis.Buffer === "undefined") {
@@ -2028,7 +2028,7 @@ class ZKPassport {
2028
2028
  * @returns An object containing the unique identifier associated to the user
2029
2029
  * and a boolean indicating whether the proofs were successfully verified.
2030
2030
  */
2031
- async verify({ proofs, queryResult, validity, scope, evmChain, devMode = false, }) {
2031
+ async verify({ proofs, queryResult, validity, scope, evmChain, devMode = false, crsPath, }) {
2032
2032
  // If no proofs were generated, the results can't be trusted.
2033
2033
  // We still return it but verified will be false
2034
2034
  if (!proofs || proofs.length === 0) {
@@ -2046,7 +2046,9 @@ class ZKPassport {
2046
2046
  formattedResult.expiry_date.disclose.result = new Date(formattedResult.expiry_date.disclose.result);
2047
2047
  }
2048
2048
  const { BarretenbergVerifier } = await Promise.resolve().then(() => tslib_1.__importStar(require("@aztec/bb.js")));
2049
- const verifier = new BarretenbergVerifier();
2049
+ const verifier = new BarretenbergVerifier({
2050
+ crsPath,
2051
+ });
2050
2052
  let verified = true;
2051
2053
  let uniqueIdentifier;
2052
2054
  let queryResultErrors;
@@ -246,13 +246,14 @@ export declare class ZKPassport {
246
246
  * @returns An object containing the unique identifier associated to the user
247
247
  * and a boolean indicating whether the proofs were successfully verified.
248
248
  */
249
- verify({ proofs, queryResult, validity, scope, evmChain, devMode, }: {
249
+ verify({ proofs, queryResult, validity, scope, evmChain, devMode, crsPath, }: {
250
250
  proofs: Array<ProofResult>;
251
251
  queryResult: QueryResult;
252
252
  validity?: number;
253
253
  scope?: string;
254
254
  evmChain?: EVMChain;
255
255
  devMode?: boolean;
256
+ crsPath?: string;
256
257
  }): Promise<{
257
258
  uniqueIdentifier: string | undefined;
258
259
  verified: boolean;
package/dist/esm/index.js CHANGED
@@ -9,7 +9,7 @@ import { hexToBytes } from "@noble/hashes/utils";
9
9
  import ZKPassportVerifierAbi from "./assets/abi/ZKPassportVerifier.json";
10
10
  import { RegistryClient } from "@zkpassport/registry";
11
11
  import { Bridge } from "@obsidion/bridge";
12
- const VERSION = "0.5.0";
12
+ const VERSION = "0.5.2";
13
13
  const DEFAULT_DATE_VALUE = new Date(1111, 10, 11);
14
14
  // If Buffer is not defined, then we use the Buffer from the buffer package
15
15
  if (typeof globalThis.Buffer === "undefined") {
@@ -2018,7 +2018,7 @@ export class ZKPassport {
2018
2018
  * @returns An object containing the unique identifier associated to the user
2019
2019
  * and a boolean indicating whether the proofs were successfully verified.
2020
2020
  */
2021
- async verify({ proofs, queryResult, validity, scope, evmChain, devMode = false, }) {
2021
+ async verify({ proofs, queryResult, validity, scope, evmChain, devMode = false, crsPath, }) {
2022
2022
  // If no proofs were generated, the results can't be trusted.
2023
2023
  // We still return it but verified will be false
2024
2024
  if (!proofs || proofs.length === 0) {
@@ -2036,7 +2036,9 @@ export class ZKPassport {
2036
2036
  formattedResult.expiry_date.disclose.result = new Date(formattedResult.expiry_date.disclose.result);
2037
2037
  }
2038
2038
  const { BarretenbergVerifier } = await import("@aztec/bb.js");
2039
- const verifier = new BarretenbergVerifier();
2039
+ const verifier = new BarretenbergVerifier({
2040
+ crsPath,
2041
+ });
2040
2042
  let verified = true;
2041
2043
  let uniqueIdentifier;
2042
2044
  let queryResultErrors;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zkpassport/sdk",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
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",
package/src/index.ts CHANGED
@@ -76,7 +76,7 @@ import ZKPassportVerifierAbi from "./assets/abi/ZKPassportVerifier.json"
76
76
  import { RegistryClient } from "@zkpassport/registry"
77
77
  import { Bridge, BridgeInterface } from "@obsidion/bridge"
78
78
 
79
- const VERSION = "0.5.0"
79
+ const VERSION = "0.5.2"
80
80
 
81
81
  const DEFAULT_DATE_VALUE = new Date(1111, 10, 11)
82
82
 
@@ -2792,6 +2792,7 @@ export class ZKPassport {
2792
2792
  scope,
2793
2793
  evmChain,
2794
2794
  devMode = false,
2795
+ crsPath,
2795
2796
  }: {
2796
2797
  proofs: Array<ProofResult>
2797
2798
  queryResult: QueryResult
@@ -2799,6 +2800,7 @@ export class ZKPassport {
2799
2800
  scope?: string
2800
2801
  evmChain?: EVMChain
2801
2802
  devMode?: boolean
2803
+ crsPath?: string
2802
2804
  }): Promise<{
2803
2805
  uniqueIdentifier: string | undefined
2804
2806
  verified: boolean
@@ -2826,7 +2828,9 @@ export class ZKPassport {
2826
2828
  }
2827
2829
 
2828
2830
  const { BarretenbergVerifier } = await import("@aztec/bb.js")
2829
- const verifier = new BarretenbergVerifier()
2831
+ const verifier = new BarretenbergVerifier({
2832
+ crsPath,
2833
+ })
2830
2834
  let verified = true
2831
2835
  let uniqueIdentifier: string | undefined
2832
2836
  let queryResultErrors: QueryResultErrors | undefined