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

1.0.9 • Public • Published

bech32-converting

This library is designed to convert bech32 addresses to hex and vice versa.

You can use any prefix and address, it will match bech32 address on blockchain node.

Installation

npm install bech32-converting

Usage

import converter from "bech32-converting"

converter('prefix').toHex('address')
converter('prefix').toBech32('address')

// Example

converter('eth').toBech32('0xf9e0bd5927557a39e246f88774e6b209389731db')
// eth1l8st6kf824arncjxlzrhfe4jpyufwvwm5f5cyp

converter('eth').toHex('eth1l8st6kf824arncjxlzrhfe4jpyufwvwm5f5cyp')
// 0xf9e0bd5927557a39e246f88774e6b209389731db

Package Sidebar

Install

npm i bech32-converting

Weekly Downloads

1,385

Version

1.0.9

License

MIT

Unpacked Size

4.09 kB

Total Files

5

Last publish

Collaborators

  • hojttaler