Open ilyavf opened 6 years ago
API:
// buildTx :: (Tx, Options) -> Buffer
const tx = {
vin: [{
txid: '2d7a9f0534ddac231ef1978bda388791c32321f7e14e18e7df3bbed261615f54',
index: 1,
script: '', // ?
segwit: '' // ?
}],
vout: [{
value: 100000000,
address: 'tb1qw508d6qejxtdg4y5r3zarvary0c5xw7kxpjzsx'
segwit: 'P2WPKH' // << define the output script type here.
}, { ... }]
}
buildTx(tx)
Cases:
Steps:
Add an option for building SegWit transactions.
Sources:
Details:
Pay-to-Witness-Script-Hash (P2WSH) The second type of witness program corresponds to a Pay-to-Script-Hash (P2SH) script. Examples:
Transaction: