🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

ethereumjs-wallet

Package Overview
Dependencies
Maintainers
3
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ethereumjs-wallet

Utilities for handling Ethereum keys

1.0.2
latest
Source
npm
Version published
Weekly downloads
153K
34.93%
Maintainers
3
Weekly downloads
 
Created

What is ethereumjs-wallet?

The ethereumjs-wallet package is a JavaScript library that provides tools for creating and managing Ethereum wallets. It allows developers to generate new wallets, import wallets from private keys or mnemonic phrases, and manage wallet data securely.

What are ethereumjs-wallet's main functionalities?

Generate a new wallet

This feature allows you to generate a new Ethereum wallet. The code sample demonstrates how to create a new wallet instance and retrieve its address.

const Wallet = require('ethereumjs-wallet').default;
const wallet = Wallet.generate();
console.log(wallet.getAddressString());

Import wallet from private key

This feature allows you to import an Ethereum wallet using a private key. The code sample shows how to create a wallet instance from a given private key and retrieve its address.

const Wallet = require('ethereumjs-wallet').default;
const privateKey = Buffer.from('yourprivatekeyhex', 'hex');
const wallet = Wallet.fromPrivateKey(privateKey);
console.log(wallet.getAddressString());

Export wallet to JSON

This feature allows you to export a wallet to a JSON format, which can be used for secure storage. The code sample demonstrates how to export a wallet to a JSON object using a password for encryption.

const Wallet = require('ethereumjs-wallet').default;
const wallet = Wallet.generate();
const json = wallet.toV3('password');
console.log(json);

Other packages similar to ethereumjs-wallet

Keywords

ethereum

FAQs

Package last updated on 08 Oct 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts