# eth-local-wallet

> A lightweight ethereumjs-wallet implementation that makes creating a local Ethereum wallet easy and safe!

Latest version **1.0.2** (published 2021-05-21) · ISC license · 0 weekly downloads

## Install

```sh
npm install eth-local-wallet
pnpm add eth-local-wallet
yarn add eth-local-wallet
bun add eth-local-wallet
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2021-05-21 |
| First published | 2021-05-21 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 4.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | sle |
| Maintainers | helixious |
| Keywords | ethereum, wallet |

## Links

- npm: https://www.npmjs.com/package/eth-local-wallet
- Repository: https://github.com/helixious/eth-local-wallet
- Homepage: https://github.com/helixious/eth-local-wallet#readme
- Issues: https://github.com/helixious/eth-local-wallet/issues
- npm.io page: https://npm.io/package/eth-local-wallet

## Dependencies (1)

- [ethereumjs-wallet](https://npm.io/package/ethereumjs-wallet.md) ^1.0.1

## Recent versions

- 1.0.2 (latest) — 2021-05-21
- 1.0.1 — 2021-05-21
- 1.0.0 — 2021-05-21

## README

# eth-local-wallet

A lightweight ethereumjs-wallet implementation that makes creating a local Ethereum wallet easy and safe!

## Installation

Use the package manager [npm](https://npmjs.org) to install eth-local-wallet.

```bash
npm install eth-local-wallet
```

## Example
Dapps need wallets to interface with the UI. However, not every client has access to the Metamask browser extension, nor do many know how to set one up. This module uses ethereumjs-wallet to setup up a local wallet that could be used inside the browser and can also be safely stored inside localStorage.

``` node
const Wallet = require('eth-local-wallet');

(async() => {
    // 0. initiates new wallet
    const localWallet = new Wallet();

    // 1. safely export wallet with password encryption
    let password = '12345678';
    let secureWallet = await localWallet.exportWallet(password);

    // 2. import wallet. Overides existing localwallet variables
    await localWallet.importWallet(secureWallet, password);

    console.log(localWallet.publicKey); //0xa782f......
    console.log(localWallet.privateKey); //0x5fd4......

    // 3. adhoc generate public, private, and wallet instance parameters. This does NOT override existing localwallet variables
    let {publicKey, privateKey, instance} = localWallet.generate();
})();
```

## methods


##### `localWallet`.importWallet(secureWallet<wallet/string>, password<string>);
Extracts and mounts imported wallet params to `localWallet`

##### `localWallet`.exportWallet(password);
Returns encrypted wallet

##### `localWallet`.generate();
Returns new wallet

# license

MIT,

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