Package Exports
- convert-bech32-address
- convert-bech32-address/convert-bech32-address.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 (convert-bech32-address) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
convert-bech32-address
Zero dependancy bech32 address converter for node.js, including browser javascript version.
Derives an address with a custom prefix, from a source BIP32 HD wallet address
Install
From npm repo:
npm install convert-bech32-addressOR clone from GitHub repo:
git clone https://github.com/jasbanza/convert-bech32-address.gitNode.js Usage:
var converter = require('./convert-bech32-address.js');
var newAddress = converter.lookup('cosmos1r5qkmvn9hnv0pugejr73639w07d2mughnm7qxa','juno');
console.log(newAddress);Node.js Test:
node example.js cosmos1r5qkmvn9hnv0pugejr73639w07d2mughnm7qxa junoOutput:
juno1r5qkmvn9hnv0pugejr73639w07d2mugh9famppBrowser Usage:
- include the 3 javascript source files (OR the minified version:
script.min.js) found in thesrcfolder, - calling the function:
lookup(address,prefix)(found insrc\address.js) will generate an address with a prefix derived from the source address
Live Browser Example:
- view https://jasbanza.github.io/convert-bech32-address/ or git clone this repo, and open
index.htmlin your browser. - Enter any wallet address, e.g.
cosmos1aaaaa...zzzzand the prefix of the target address, e.g.akash - Click
Convertand your target address will be generated:akash1aaaaa...yyyy