SelfBackendVerifier
The SelfBackendVerifier
class is designed to facilitate the verification of user credentials and disclosures in applications using the Self system. It supports various modes of operation, allowing for both onchain and offchain 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.
Parameters
scope
string
An identifier for the application, used to distinguish different apps.
endpoint
string
The endpoint of the backend verifier.
user_identifier_type
UserIdType
The type of the user identifier. Hex denotes on chain addresses.
mockPassport
boolean
The passport type - false if the backend is verifying real passports.
Functions
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
excludeCountries
...countries: (typeof countryNames)[number][]
Excludes specified countries from verification.
this
enablePassportNoOfacCheck
Checks for the passport number in the OFAC list.
this
enableNameAndDobOfacCheck
Checks for the name and DOB (hashed together) in the OFAC list.
this
enableNameAndYobOfacCheck
Checks for the name and year of birth (hashed together) in the OFAC list.
this
verify
proof: OpenPassportAttestation
Verifies a proof against the configured verification parameters.
Promise<OpenPassportVerifierReport>
Last updated