OpenPassportVerifier
Last updated
Last updated
The OpenPassportVerifier
class is designed to facilitate the verification of user credentials and disclosures in applications using the OpenPassport system. It supports various modes of operation, allowing for both on-chain and off-chain proof verification. The class provides methods to configure verification parameters such as minimum age, nationality, and OFAC checks, and to generate intents for user interactions.
Parameter | Type | Description |
---|---|---|
Function | Parameters | Description | Output |
---|---|---|---|
mode
Mode
The mode of operation, determining the type of proof verification.
scope
string
An identifier for the application, used to distinguish different apps.
setMinimumAge
age: number
Sets the minimum age requirement for verification. Throws an error if age is less than 10 or more than 100.
this
setNationality
country: (typeof countryNames)[number]
Sets the nationality requirement for verification.
this
discloseNationality
None
Sets nationality to 'Any', allowing disclosure of any nationality.
this
excludeCountries
...countries: (typeof countryNames)[number][]
Excludes specified countries from verification.
this
enableOFACCheck
None
Enables OFAC (Office of Foreign Assets Control) check for verification.
this
setModalServerUrl
modalServerUrl: string
Sets the URL for the modal server used in verification.
this
setCommitmentMerkleTreeUrl
commitmentMerkleTreeUrl: string
Sets the URL for the commitment Merkle tree, required for 'register' mode.
this
setRpcUrl
rpcUrl: string
Sets the RPC URL for on-chain operations.
this
allowMockPassports
None
Enables the use of mock passports for testing purposes.
this
getIntent
appName: string, userId: string, userIdType: UserIdType, sessionId: string, websocketUrl: string = WEBSOCKET_URL
Generates an intent string for user interaction, encoding the necessary verification parameters. Used by OpenPassportQRcode.
string
verifyProof
proof: OpenPassportAttestation
Verifies a proof against the configured verification parameters.
Promise<OpenPassportVerifierReport>