Class: DvrModuleClient

Client class for the DVR module, accessing the DVR module functions

Table of contents

Constructors

Properties

Methods

Constructors

constructor

  • new DvrModuleClient(config): DvrModuleClient

Constructs a new instance of the DvrModuleClient.

Parameters

Returns

DvrModuleClient

Properties

credentials

  • private credentials: PrivacyAppCredentialsStruct

The credentials structure containing authentication details for the Privacy App Client, including base URL, API key, and secret API key.


library

The loaded library instance containing the foreign function interface (FFI) definitions for DVR module functions.


PACKAGE_NAME

  • private PACKAGE_NAME: "@zkpass/dvr-client-ts" : string

The NPM package name for the DVR client TypeScript library.


LIBRARY_NAME

  • private LIBRARY_NAME: "libdvr_client.so" : string

The name of the shared library file that contains the DVR client implementation.

Methods

loadLibrary

▸ private loadLibrary(): Object

Loads the specified library and defines the foreign function interface (FFI) for the DVR module.

Returns

Object - An object representing the loaded library with the defined FFI functions

The following functions are defined in the FFI:

  • dvr_generate_user_data_token

  • dvr_generate_query_token

  • dvr_generate_zkpass_proof

  • dvr_verify_zkpass_proof


callDvrGenerateUserDataToken

▸ callDvrGenerateUserDataToken(signingKey, stringifiedUserData, verifyingKeyOptionParam): string

Generates a user data JWS token using the provided signing key, user data, and public key option.

Parameters

Returns

string - The generated user data token, or throws an error if generation fails


callDvrGenerateQueryToken

▸ callDvrGenerateQueryToken(signingKey, dvrData): string

Generates a DVR query JWS token using the provided signing key and DVR data.

Parameters

Returns

string - The generated DVR query token, or throws an error if generation fails


callDvrGenerateZkPassProof

▸ callDvrGenerateZkPassProof(stringifiedUserDataTokens, dvrtoken): string

Parameters

Returns

string - The generated zkPass proof, or throws an error if generation fails


callDvrVerifyZkPassProof

▸ callDvrVerifyZkPassProof(zkvm, zkPassProofToken, expectedMetaData): VerifyZkPassProofResult

Parameters

Returns

VerifyZkPassProofResult - The output committed into the zkPass proof, and the zkPass proof data

Last updated