Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ethereumjs-account

Package Overview
Dependencies
Maintainers
4
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ethereumjs-account

Encoding, decoding and validation of Ethereum's Account schema

  • 3.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
125K
decreased by-1.66%
Maintainers
4
Weekly downloads
 
Created

What is ethereumjs-account?

The ethereumjs-account package is a JavaScript library for managing Ethereum accounts. It provides functionalities for creating, manipulating, and serializing Ethereum accounts, making it easier to handle account-related operations in Ethereum-based applications.

What are ethereumjs-account's main functionalities?

Creating a new account

This feature allows you to create a new Ethereum account. The code sample demonstrates how to create a new account instance using the Account class from the ethereumjs-account package.

const { Account } = require('ethereumjs-account');
const newAccount = new Account();
console.log(newAccount);

Serializing an account

This feature allows you to serialize an Ethereum account into a buffer. The code sample shows how to serialize an account and convert it to a hexadecimal string.

const { Account } = require('ethereumjs-account');
const account = new Account();
const serialized = account.serialize();
console.log(serialized.toString('hex'));

Deserializing an account

This feature allows you to deserialize a buffer back into an Ethereum account. The code sample demonstrates how to deserialize a hexadecimal string buffer into an account instance.

const { Account } = require('ethereumjs-account');
const serialized = Buffer.from('...', 'hex');
const account = Account.deserialize(serialized);
console.log(account);

Updating account balance

This feature allows you to update the balance of an Ethereum account. The code sample shows how to set the balance of an account to 2 ETH (in wei).

const { Account } = require('ethereumjs-account');
const account = new Account();
account.balance = '0x1bc16d674ec80000'; // 2 ETH in wei
console.log(account.balance.toString('hex'));

Other packages similar to ethereumjs-account

Keywords

FAQs

Package last updated on 14 Jan 2019

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc