# OpenPassportVerifier

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.

#### Parameters

| Parameter | Type     | Description                                                            |
| --------- | -------- | ---------------------------------------------------------------------- |
| `mode`    | `Mode`   | The mode of operation, determining the type of proof verification.     |
| `scope`   | `string` | An identifier for the application, used to distinguish different apps. |

#### Functions

| Function                     | Parameters                                                                                                         | Description                                                                                                                  | Output                                |
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- | ------------------------------------- |
| `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>` |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.openpassport.app/docs/technical-docs/sdk-class/openpassportverifier.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
