Wondering what’s next for npm?Check out our public roadmap! »

bip21-b4bcoin

1.0.0 • Public • Published

bip21-b4bcoin

Version

A BIP21 compatible URL encoding library for B4Bcoin.

Example

var bip21 = require('bip21-b4bcoin')
 
var decoded = bip21.decode('b4bcoin:BBgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH?amount=20.3&label=Foobar')
 
console.log(decoded)
// { address: 'BBgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH',
//   options: {
//     amount: 20.3,
//     label: 'Foobar' }
// }
//
// WARNING: Remember to error check the `.address`!
 
console.log(bip21.encode('BBgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH'))
// => b4bcoin:BBgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH
 
console.log(bip21.encode('BBgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH', {
    amount: 20.3,
    label: 'Foobar'
}))
// => b4bcoin:BBgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH?amount=20.3&label=Foobar

License MIT

Install

npm i bip21-b4bcoin

DownloadsWeekly Downloads

3

Version

1.0.0

License

MIT

Unpacked Size

10.3 kB

Total Files

8

Last publish

Collaborators

  • avatar