Last active
August 29, 2015 13:57
-
-
Save matiu/9833812 to your computer and use it in GitHub Desktop.
Proposed TransactionBuilder Interfase.
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
/* create and sign */ | |
var tx = TransactionBuilder.init(opts) | |
.addUtxos(utxos) | |
.addOutputs(outs) | |
.addKeys(keys) | |
.build(); | |
broadcast(tx.serialize()); | |
/* create and sign later */ | |
var builder = TransactionBuilder.init(opts) | |
.addUtxos(utxos) | |
.addOutputs(outs); | |
var tx = builder.build(); | |
/*..later..*/ | |
var tx = builder.addKeys(keys).build(); | |
while ( tx.isComplete() ) { | |
/*...get new keys ..*/ | |
tx = builder.addKeys(keys).build(); | |
} | |
broadcast(tx.serialize()); | |
/* opts for init: fee (fixed), remainderAddress, spendUnconfirmed, locktime, signhash, */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment