@zkpassport/sdk 0.18.3-beta.1 → 0.18.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.
@@ -1,4 +1,5 @@
1
1
  import { Query, IDCredential, IDCredentialValue, NumericalIDCredential, DisclosableIDCredential, BoundData, SupportedChain, SanctionsCountries, SanctionsLists, FacematchMode, ProofResult, QueryResult, NullifierType, CountryName, ProofMode, Service } from '@zkpassport/utils';
2
+ import { KeyPair } from '@obsidion/bridge';
2
3
  import { Alpha3Code } from 'i18n-iso-countries';
3
4
 
4
5
  type QueryResultError<T> = {
@@ -344,10 +345,12 @@ declare class ZKPassport {
344
345
  * @param mode The proof mode (e.g. "fast" / "compressed").
345
346
  * @param devMode Whether to enable dev mode. This will allow you to verify mock proofs (i.e. from ZKR)
346
347
  * @param verifierMode How the received proofs are verified: "local", "api" or "auto" (default).
348
+ * @param keyPairOverride A keypair from {@link getRequestKeyPair}, which keeps the request ID and bridge topic.
349
+ * @param replayMissedMessages Redelivers what was already sent on this topic, for a request resumed on a new page.
347
350
  * @param config Settings for verifying the received proofs, see {@link VerificationConfig}.
348
351
  * @returns The query builder object.
349
352
  */
350
- request({ name, logo, purpose, scope, projectID, mode, validity, devMode, uniqueIdentifierType, oprfKeyId, topicOverride, keyPairOverride, cloudProverUrl, bridgeUrl, returnDeepLink, verifierMode, config, overrides, }: {
353
+ request({ name, logo, purpose, scope, projectID, mode, validity, devMode, uniqueIdentifierType, oprfKeyId, topicOverride, keyPairOverride, replayMissedMessages, cloudProverUrl, bridgeUrl, returnDeepLink, verifierMode, config, overrides, }: {
351
354
  name?: string;
352
355
  logo?: string;
353
356
  purpose?: string;
@@ -359,10 +362,8 @@ declare class ZKPassport {
359
362
  uniqueIdentifierType?: RequestedNullifierType;
360
363
  oprfKeyId?: string;
361
364
  topicOverride?: string;
362
- keyPairOverride?: {
363
- privateKey: Uint8Array;
364
- publicKey: Uint8Array;
365
- };
365
+ keyPairOverride?: KeyPair;
366
+ replayMissedMessages?: boolean;
366
367
  cloudProverUrl?: string;
367
368
  bridgeUrl?: string;
368
369
  returnDeepLink?: string;
@@ -453,6 +454,13 @@ declare class ZKPassport {
453
454
  * @param requestId The request ID.
454
455
  */
455
456
  getServiceDetails(requestId: string): Service | undefined;
457
+ /**
458
+ * @notice Returns the bridge keypair of a request. A request ID is its public key, so passing the
459
+ * keypair back as `keyPairOverride` rebuilds the same request on the same bridge topic.
460
+ * @param requestId The request ID.
461
+ * @returns The keypair, or undefined once the request has been cancelled.
462
+ */
463
+ getRequestKeyPair(requestId: string): KeyPair | undefined;
456
464
  /**
457
465
  * @notice Cancels a request by closing the WebSocket connection and deleting the associated data.
458
466
  * @param requestId The request ID.