wifgrs
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/wifgrs package

4.0.0 • Public • Published

WIFGRS

TRAVIS NPM

js-standard-style

Groestlcoin Wallet Import Format encoding/decoding module.

Example

var wif = require('wifgrs')
var privateKey = Buffer.from('0000000000000000000000000000000000000000000000000000000000000001', 'hex')
var key = wif.encode(128, privateKey, true) // for the testnet use: wif.encode(239, ...
// => KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU73sVHnoWn

var obj = wif.decode(key)
// => {
//	version: 128,
//	privateKey: <Buffer 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01>,
//	compressed: true
//}

wif.decode(key, 0x09)
// => Error: Invalid network version

// alternative syntax
wif.encode(obj)
// => KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU73sVHnoWn

LICENSE MIT

Package Sidebar

Install

npm i wifgrs

Weekly Downloads

270

Version

4.0.0

License

MIT

Unpacked Size

4.73 kB

Total Files

4

Last publish

Collaborators

  • gruve-p