Package Exports
- web3-names
- web3-names/lib/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (web3-names) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
web3-names
a library for making web3 addresses more human-readable
installation
npm add web3-names
yarn add web3-names
usage
import { addressToName, addressToNameObject } from 'web3-names'
const address = '0x17A059B6B0C8af433032d554B0392995155452E6'
const name = addressToName(address)
console.log(name)
// Felicita Feeney
const nameObj = addressToNameObject(address)
console.log(nameObj)
/*
{
name: 'Felicita Feeney',
prefix: 'Miss',
firstName: 'Felicita',
middleName: 'Micah',
lastName: 'Feeney'
}
*/
notes
Currently only supports 40 char hexidecimal addresses (EVM wallet addresses). Would be great if someone wanted to add support for other types of addresses :)
It can handle addresses with or without the 0x
prefix, and both lowercase and uppercase.