@exodus/eip55
TypeScript icon, indicating that this package has built-in type declarations

2.1.1-exodus.0 • Public • Published

eip55

build status Version

An EIP55 compatible address encoding library.

Example

let eip55 = require('eip55')

eip55.encode('0xfb6916095ca1df60bb79ce92ce3ea74c37c5d359')
// => 0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359

eip55.verify('0xAcA128edBD274F2aBa534d67DD55Ebf67767B9A5')
// => true

eip55.verify('0xaca128edbd274f2aba534d67dd55ebf67767b9a5')
// => false

// The second argument of verify allows for single case addresses
// In this case it will only verify the leading 0x and length
// therefore the above example returns true instead of false

// lower case
eip55.verify('0xaca128edbd274f2aba534d67dd55ebf67767b9a5', true)
// => true

// upper case
eip55.verify('0xACA128EDBD274F2ABA534D67DD55EBF67767B9A5', true)
// => true

// EIP-1191 chainId support has been added
// pass the optional chainId to get the casing for that network

// Encode for RSK Mainnet (chainId 30) (notice the difference from above)
eip55.encode('0xfb6916095ca1df60bb79ce92ce3ea74c37c5d359', 30)
// => 0xFb6916095cA1Df60bb79ce92cE3EA74c37c5d359

eip55.verify('0xFb6916095cA1Df60bb79ce92cE3EA74c37c5d359')
// => false (we need to pass the chainId)

// Note: the second argument is allowOneCase (default: false)
eip55.verify('0xFb6916095cA1Df60bb79ce92cE3EA74c37c5d359', false, 30)
// => true

License MIT

Package Sidebar

Install

npm i @exodus/eip55

Weekly Downloads

811

Version

2.1.1-exodus.0

License

MIT

Unpacked Size

5.59 kB

Total Files

5

Last publish

Collaborators

  • aspino
  • cawfree
  • markoexodus
  • ismamz
  • exojo
  • doguhan
  • ronaldcrb
  • nantoaqui
  • bekatd
  • atemafac-nd
  • frankliexodus
  • ale-exo
  • davidexodus
  • geoffreyrousset
  • marcos.kichel
  • kryptkeep
  • andrewtoth-exodus
  • mmehta-10
  • tunguyennnnn
  • cdotta-exodus
  • awesomeniko
  • mbaraniak-exodus
  • hasakura
  • shehryar6
  • rec
  • awilson-rs
  • ggabarrin-rs
  • r4vn
  • exorich
  • cryptosgr
  • mol0d
  • yevhenii_molodyk
  • yilmazbahadir
  • muratso
  • exoleo
  • 633kh4ck
  • ossel
  • clarkexo
  • james-gre
  • juraex
  • ralph.ba
  • angelloz
  • joshuabot
  • jamiemaw
  • exodus-justin.za
  • javiexodus
  • rg911
  • alex.alexandrius
  • filipexodus
  • ryansquared-npm
  • andrescarreon
  • florianmathieu
  • janwe
  • fboucquez
  • skapala
  • umito
  • lanahizzle
  • iaacek
  • ps.mcnally
  • akinncar
  • voltagebots
  • kwwood
  • sergii_bo
  • alexandrbbm
  • danh.t.vo
  • ezenwankwogabriel
  • meniem
  • mzndako
  • kevva
  • feri42
  • jprichardson
  • farisissa
  • ryanzim
  • headfire
  • gutenye
  • mosesbot
  • roccomuso
  • dcastagnoli
  • sonaye
  • ves
  • tenaciousmv
  • asyakost
  • bulgakovk
  • chalker
  • andrejb
  • jaydp17
  • olistic
  • joepie91
  • merlz
  • vbonini
  • devopsrobot
  • jenish-sojitra
  • nachoalvarez
  • giovannirco
  • diegomura
  • lanre-mark
  • sunilagrawal
  • guillecura
  • mariosvlad
  • federico-po