Home

Awesome

bitcoin-spv-utils

NPM Package Build Status Coverage Status js-standard-style Dependency status

API

#####bits2buf(Number bits) -> Buffer

Unpack bits.

#####buf2bits(Buffer buf) -> Number

Pack bits.

#####getMaxTarget() -> {bits: Number, buf: Buffer}

Return max target. (bits -- 0x1d00ffff, hex -- 00000000ffff0000000000000000000000000000000000000000000000000000)

#####getTarget(Buffer first, Buffer last) -> {bits: Number, buf: Buffer}

Calculate target of next chunk.

#####verifyHeader(Buffer header, ?Buffer previous, Object target [, Boolean isTestnet = false]) -> Boolean

Verify given header.

#####verifyHeaders(Buffer[] headers, ?Buffer previous, Object target [, Boolean isTestnet = false] -> Boolean

Verify given headers.

License

This software is licensed under the MIT License.