Bitcoinjs-lib: How to decode rawtransaction?

Created on 7 Mar 2017  路  1Comment  路  Source: bitcoinjs/bitcoinjs-lib

I often use bitcoind command "decoderawtransaction".
I want to decode TX hex code on web browser standalone.
How to do?
I edit PaperWallet https://walletgenerator.net/

how to / question / docs

Most helpful comment

create a transaction object from a hex string

var bitcoin = require('bitcoinjs-lib');
var tx = bitcoin.Transaction.fromHex(rawtx);
var txid = tx.getId();
console.log(txid);

I have sample code to show details.
There may be easier ways, but I do not know

https://github.com/you21979/node-multisig-wallet/blob/master/lib/txdecoder.js

>All comments

create a transaction object from a hex string

var bitcoin = require('bitcoinjs-lib');
var tx = bitcoin.Transaction.fromHex(rawtx);
var txid = tx.getId();
console.log(txid);

I have sample code to show details.
There may be easier ways, but I do not know

https://github.com/you21979/node-multisig-wallet/blob/master/lib/txdecoder.js

Was this page helpful?
0 / 5 - 0 ratings

Related issues

junderw picture junderw  路  19Comments

Katafalkas picture Katafalkas  路  24Comments

caffeinum picture caffeinum  路  50Comments

dcousens picture dcousens  路  45Comments

mc-tracker picture mc-tracker  路  28Comments