Skip to content

A BIP68 relative lock-time encoding library.

License

Notifications You must be signed in to change notification settings

staketechnologies/bip68

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bip68

NPM Package Build Status js-standard-style

A BIP68 relative lock-time encoding library.

Example

let bip68 = require('bip68')

bip68.encode({ seconds: 2048 })
// => 0x00400004

bip68.encode({ seconds: 102 })
// => TypeError: Expected Number seconds as a multiple of 512 (as per the BIP)

bip68.encode({ blocks: 54 })
// => 0x00000036

bip68.encode({ blocks: 200 })
// => 0x000000c8

bip68.decode(0x03ffffff)
// => { seconds: 33553920 }

bip68.decode(0x0100fffe) // safely ignores extension bits
// => { blocks: 65534 }

bip68.decode(0xffffffff) // final sequence
// => {}

LICENSE ISC

About

A BIP68 relative lock-time encoding library.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%