# Usage

### **Getting Started:**

To integrate Certhis Wallet into your DAPP and provide users with login options, you must call the `run` function. This function requires parameters like the network ID, RPC URL, login window ID, custom class prefix, and an option to specify if the provider is expected or not. Here's an example:

```javascript
await certhis_wallet.run({
  rpc_id: rpc_id,
  rpc: rpc_link,
});
```

### **Email-Based Login:**

Certhis Wallet allows users to connect to their wallets through email. It generates a new wallet for the user if the email is not already linked to one. A code is sent to the user's email, which they can use to log in and interact with their wallet through the application.

### Wallet Infos:

To display wallet information and export the private key of the wallet in a pop-up window for email-based connections using Certhis Wallet, you can use the `walletInfos()` function. Here's an example of how to use it:

```javascript
certhis_wallet.walletInfos();
```

This function will show a pop-up window with wallet details, including the private key if applicable.

### **Popup Add Fund:**

For users with empty wallets, Certhis Wallet detects this and prompts them to add funds. This can be done through a transfer or credit card. Users can receive guidance on adding funds to their wallets seamlessly.

```javascript
await  certhis_wallet.addFundPopup(
functionGasFees,
address,
value,
chain_id,
transactionInformation = {
transactionInformation.title,
transactionInformation.description,
transactionInformation.image,
transactionInformation.nb_items,
transactionInformation.erc20_amount,
transactionInformation.smart_contract,
transactionInformation.erc20_contract,
transactionInformation.erc20_amount
},
force
);
```

### Signature:

To create a signature using Certhis Wallet, you can request a signature using the `provider.request` method. Here's an example:

```javascript
var sign = await provider.request({
  method: "personal_sign",
  params: [web3.utils.utf8ToHex("HELLO WORLD!"), current_address],
});
```

Certhis Wallet simplifies wallet integration in DAPPs, making it easier for users to access their wallets and interact with blockchain applications.


---

# 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.certhis.io/certhis-wallet/usage.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.
