Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Jun 17, 2021. It is now read-only.

v7.0.5 - New Address Type

Compare
Choose a tag to compare
Loading
@holgerd77 holgerd77 released this 10 Sep 08:40
· 57 commits to master since this release
d8b8e44

This release adds a new module address - see README - with a new Address class and type which can be used for creating and representing Ethereum addresses.

Example usage:

import { Address } from 'ethereumjs-util'

const pubKey = Buffer.from(
  '3a443d8381a6798a70c6ff9304bdc8cb0163c23211d11628fae52ef9e0dca11a001cf066d56a8156fc201cd5df8a36ef694eecd258903fca7086c1fae7441e1d',
  'hex',
)
const address = Address.fromPublicKey(pubKey)

In TypeScript the associated Address type can be used to more strictly enforce type checks (e.g. on the length of an address) on function parameters expecting an address input. So you can declare a function like the following: myAddressRelatedFunction(address: Address) to get more assurance that the address input is correct.

See PR #186

Morty Proxy This is a proxified and sanitized view of the page, visit original site.