Title: How can I get previous hash to tx.addInput (BitcoinJS)? Post by: DKH on March 02, 2015, 07:50:57 PM Hello everyone,
may I ask, how can I get this variable? Should I get it from spent tx or receive tx or unspent tx? Which hash of listed transaction should I use? I am new in this and I would like to know, how to create raw transaction. Thanks a lot for all replies. Title: Re: How can I get previous hash to tx.addInput (BitcoinJS)? Post by: ca333 on March 05, 2015, 02:04:04 PM Hello everyone, may I ask, how can I get this variable? Should I get it from spent tx or receive tx or unspent tx? Which hash of listed transaction should I use? I am new in this and I would like to know, how to create raw transaction. Thanks a lot for all replies. Hello, you must create transaction which spends your declared inputs (this is object contains transaction outputs (unspent) so you can spend in this rawtx. like: tx.addInput(unspent.txHash, unspent.index) and this you can get with for example from local btc-node or also can get unspent outputs and transaction history from blockchain.info like i do always. also here are some urls with usefull information on how to make raw tx in bitcoinjs: https://gist.github.com/orweinberger/3bd7dfdc574be58539c5 https://medium.com/@orweinberger/how-to-create-a-raw-transaction-using-bitcoinjs-lib-1347a502a3a hope this help. thank you |