Created
January 8, 2015 15:24
-
-
Save orweinberger/3bd7dfdc574be58539c5 to your computer and use it in GitHub Desktop.
Generate a raw transaction using bitcoinjs-lib
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var bitcoin = require(‘bitcoinjs-lib’); | |
var key = bitcoin.ECKey.fromWIF("L1Kzcyy88LyckShYdvoLFg1FYpB5ce1JmTYtieHrhkN65GhVoq73"); | |
var tx = new bitcoin.TransactionBuilder(); | |
tx.addInput("d18e7106e5492baf8f3929d2d573d27d89277f3825d3836aa86ea1d843b5158b", 1); | |
tx.addOutput("12idKQBikRgRuZEbtxXQ4WFYB7Wa3hZzhT", 149000); | |
tx.sign(0, key); | |
console.log(tx.build().toHex()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment