onoma
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

GitHub license

onoma

a library for making web3 addresses more human-readable

installation

npm add onoma
yarn add onoma

usage

import { addressToName, addressToNameObject } from 'onoma'

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.

Package Sidebar

Install

npm i onoma

Weekly Downloads

2

Version

0.1.1

License

ISC

Unpacked Size

51.1 kB

Total Files

14

Last publish

Collaborators

  • metagame-xyz