@zkpassport/sdk 0.2.15 → 0.3.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.
@@ -1,11 +1,11 @@
1
- import { type DisclosableIDCredential, type IDCredential, type IDCredentialValue, type NumericalIDCredential, type ProofResult, type QueryResult } from "@zkpassport/utils";
1
+ import { type DisclosableIDCredential, type IDCredential, type IDCredentialValue, type NumericalIDCredential, type ProofResult, type QueryResult, ProofMode } from "@zkpassport/utils";
2
2
  export type QueryResultError<T> = {
3
3
  expected?: T;
4
4
  received?: T;
5
5
  message: string;
6
6
  };
7
7
  export type QueryResultErrors = {
8
- [key in IDCredential | "sig_check_dsc" | "sig_check_id_data" | "data_check_integrity" | "disclose"]: {
8
+ [key in IDCredential | "sig_check_dsc" | "sig_check_id_data" | "data_check_integrity" | "outer" | "disclose"]: {
9
9
  disclose?: QueryResultError<string | number | Date>;
10
10
  gte?: QueryResultError<number | Date>;
11
11
  lte?: QueryResultError<number | Date>;
@@ -19,6 +19,15 @@ export type QueryResultErrors = {
19
19
  certificate?: QueryResultError<string>;
20
20
  };
21
21
  };
22
+ export type SolidityVerifierParameters = {
23
+ vkeyHash: string;
24
+ proof: string;
25
+ publicInputs: string[];
26
+ committedInputs: string;
27
+ committedInputCounts: number[];
28
+ validityPeriodInDays: number;
29
+ };
30
+ export type EVMChain = "ethereum_sepolia" | "local_anvil";
22
31
  export type * from "@zkpassport/utils";
23
32
  export { SANCTIONED_COUNTRIES, EU_COUNTRIES, EEA_COUNTRIES, SCHENGEN_COUNTRIES, ASEAN_COUNTRIES, MERCOSUR_COUNTRIES, } from "@zkpassport/utils";
24
33
  export type QueryBuilderResult = {
@@ -185,11 +194,12 @@ export declare class ZKPassport {
185
194
  * @param validity How many days ago should have the ID been last scanned by the user?
186
195
  * @returns The query builder object.
187
196
  */
188
- request({ name, logo, purpose, scope, validity, topicOverride, keyPairOverride, }: {
197
+ request({ name, logo, purpose, scope, mode, validity, topicOverride, keyPairOverride, }: {
189
198
  name: string;
190
199
  logo: string;
191
200
  purpose: string;
192
201
  scope?: string;
202
+ mode?: ProofMode;
193
203
  validity?: number;
194
204
  topicOverride?: string;
195
205
  keyPairOverride?: {
@@ -197,6 +207,14 @@ export declare class ZKPassport {
197
207
  publicKey: Uint8Array;
198
208
  };
199
209
  }): Promise<QueryBuilder>;
210
+ private checkDiscloseBytesPublicInputs;
211
+ private checkAgePublicInputs;
212
+ private checkBirthdatePublicInputs;
213
+ private checkExpiryDatePublicInputs;
214
+ private checkNationalityExclusionPublicInputs;
215
+ private checkIssuingCountryExclusionPublicInputs;
216
+ private checkNationalityInclusionPublicInputs;
217
+ private checkIssuingCountryInclusionPublicInputs;
200
218
  private checkPublicInputs;
201
219
  /**
202
220
  * @notice Verify the proofs received from the mobile app.
@@ -215,6 +233,24 @@ export declare class ZKPassport {
215
233
  verified: boolean;
216
234
  queryResultErrors?: QueryResultErrors;
217
235
  }>;
236
+ getSolidityVerifierDetails(network: EVMChain): {
237
+ address: string;
238
+ abi: {
239
+ type: "function" | "event" | "constructor";
240
+ name: string;
241
+ inputs: {
242
+ name: string;
243
+ type: string;
244
+ internalType: string;
245
+ }[];
246
+ outputs: {
247
+ name: string;
248
+ type: string;
249
+ internalType: string;
250
+ }[];
251
+ }[];
252
+ };
253
+ getSolidityVerifierParameters(proof: ProofResult, validityPeriodInDays?: number): SolidityVerifierParameters;
218
254
  /**
219
255
  * @notice Returns the URL of the request.
220
256
  * @param requestId The request ID.