Blockchain data utility methods
npm install @alexbosworth/blockchainUtility methods for working with Blockchain data
Convert a compact integer to a regular number
{
encoded:
[start]:
}
@returns
{
bytes:
number:
}
Example:
``node
const {compactIntAsNumber} = require('@alexbosworth/blockchain');
// Decode the plain number from the encoded compact int bytes
const {number} = compactIntAsNumber({encoded: Buffer.from('fdfd00', 'hex')});
``
Get the components of a hex-encoded transaction
{
transaction:
}
@throws
@returns
{
inputs: [{
id:
script:
sequence:
vout:
[witness]: [