# @certhis/certhis-wallet

> Certhis Wallet

Latest version **1.9.0** (published 2024-10-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install @certhis/certhis-wallet
pnpm add @certhis/certhis-wallet
yarn add @certhis/certhis-wallet
bun add @certhis/certhis-wallet
```

## Health

**Score 25/100 (F)** — status: maintenance-mode.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.9.0 |
| Published | 2024-10-10 |
| First published | 2023-01-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 10 |
| Unpacked size | 191.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9 |
| Author | CERTHIS |
| Maintainers | ruben-certhis |
| Keywords | certhis, wallet, web3, wallet, email |

## Links

- npm: https://www.npmjs.com/package/@certhis/certhis-wallet
- Repository: https://github.com/certhis/CERTHIS-WALLET
- Homepage: https://github.com/certhis/CERTHIS-WALLET#readme
- Issues: https://github.com/certhis/CERTHIS-WALLET/issues
- npm.io page: https://npm.io/package/@certhis/certhis-wallet

## Dependencies (10)

- [web3](https://npm.io/package/web3.md) ^4.1.0
- [axios](https://npm.io/package/axios.md) ^1.3.0
- [browser](https://npm.io/package/browser.md) ^0.2.6
- [process](https://npm.io/package/process.md) ^0.11.10
- [crypto-js](https://npm.io/package/crypto-js.md) ^4.1.1
- [eth-sig-util](https://npm.io/package/eth-sig-util.md) ^3.0.1
- [ethereumjs-util](https://npm.io/package/ethereumjs-util.md) ^7.1.5
- [@coinbase/wallet-sdk](https://npm.io/package/@coinbase/wallet-sdk.md) ^3.7.1
- [@walletconnect/modal](https://npm.io/package/@walletconnect/modal.md) ^2.4.7
- [@walletconnect/ethereum-provider](https://npm.io/package/@walletconnect/ethereum-provider.md) ^2.8.1

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 1.9.0 (latest) — 2024-10-10
- 1.8.9 — 2024-08-16
- 1.8.8 — 2024-08-15
- 1.8.6 — 2024-08-15
- 1.8.5 — 2024-07-28
- 1.8.4 — 2024-06-18
- 1.8.3 — 2024-06-02
- 1.8.2 — 2024-04-16
- 1.8.1 — 2024-04-16
- 1.8.0 — 2024-04-15
- 1.7.9 — 2024-04-15
- 1.7.6 — 2024-02-06
- 1.7.5 — 2024-02-06
- 1.7.4 — 2024-02-05
- 1.7.3 — 2024-02-04
- … 58 more at https://npm.io/package/@certhis/certhis-wallet/versions

## README

# Certhis Wallet

**Live Example :** [here](https://codesandbox.io/s/certhis-wallet-react-lhuddn?file=/src/App.js)

Certhis Wallet is a javascript package that makes it easy to integrate a wallet connection system by providing various login options, including email and using wallets like Metamask, Wallet Connect, and Coinbase Wallet in your DAPP and enables users to interact with their WEB3 wallets.

![enter image description here](https://i.ibb.co/bdJZJDc/Capture-d-e-cran-2023-09-19-a-14-26-52.png)

## Installation

To install Certhis Wallet, open your terminal and run the following command:

```sh

$ npm i @certhis/certhis-wallet

```

## Initialization

To use Certhis Wallet, you must first initialize it by importing the necessary libraries and calling the `init` function of `certhis-wallet`

```js
const CerthisWallet = require("@certhis/certhis-wallet");
const certhis_wallet = CerthisWallet.init();
const Web3 = certhis_wallet.getWeb3();
```

## Usage

To display the login window or to retrieve the provider if the user is logged in, you must call the `run` function of `certhis-wallet` by passing in the network ID, RPC URL, login window ID, custom class prefix, and an option to specify if the provider is expected or not.

```js
await certhis_wallet.run({
  rpc_id: rpc_id,
  rpc: rpc_link,
  force_sign: false,
  notif: true, //notif user of new wallet

  auto_logout: false, //auto logout
  store_key: false, //store key in local storage and prevent the user to sign out with multiple session
  //custom connexion (optional)
  active_custom: false, //active a custom connexion
  connect_btn: "#connect_btn", //custom_form_btn
  email_input: "#email_input", //custom_form_email
  error_message: "#error_message", //custom_form_error,
  google: "#google", //google connexion url
  success_function_email: async function (success) {
    //email valid
  },
  error_function_email: async function (error) {
    //email invalid
  },
  input_code: ".code_input", //5 code input,
  code_btn: ".valid_code", //valid_code,
  resend_code: ".resend_code", //resend_code,
  error_message_code: ".error_message_code", //error_message_code,
  success_function_code: async function (success) {
    //code valid
  },
  error_function_code: async function (error) {
    //code invalid
  },
});
```

Certhis Wallet allows user to connect to their wallet through email, which 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 and they can use it to log in and interact with their wallet through the application.

## Wallet Infos

Additionally, there is a function that can be used to display the wallet information and export the private key of the wallet in a pop-up window for email-based connections:

```js
certhis_wallet.walletInfos();
```

## Disconnect

This function disconnect the current wallet

```js
certhis_wallet.disconnect();
```

## Popup Add Fund

There is also a function that detects if the user has any funds and prompts them to add funds to their wallet through a transfer or credit card

```js

await  certhis_wallet.addFundPopup(
functionGasFees,
address,
value,
chain_id,
transactionInformation = {
transactionInformation.paytweed:{
  chain_id,collection_address,wallet,nft_id,nb_mint
},
transactionInformation.title,
transactionInformation.description,
transactionInformation.image,
transactionInformation.nb_items,
transactionInformation.erc20_amount,
transactionInformation.smart_contract,
transactionInformation.erc20_contract,
transactionInformation.erc20_amount
},
force
);

```

## Signature

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

## SendOnHash

```js
await certhis_wallet
  .SendOnhash({ hash, chain_id })
  .on("transactionHash", function (hash) {})
  .on("receipt", async function (receipt) {});
```

## Wallet by email

Also, there is an endpoint provided by Certhis Wallet:

`https://wallet-api.certhis.io/wallet?email=email@exemple.com`

This endpoint allows for generating or retrieving a wallet linked to an email.

In summary, Certhis Wallet is a javascript package that provides an easy-to-use interface for connecting to various types of wallets and includes a unique email-based login feature, as well as functions for displaying wallet information and adding funds.

```

```

---
_Source: https://npm.io/package/@certhis/certhis-wallet · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
