Skip to content

Instantly share code, notes, and snippets.

@matiu
Last active August 29, 2015 13:57
Show Gist options
  • Save matiu/9833812 to your computer and use it in GitHub Desktop.
Save matiu/9833812 to your computer and use it in GitHub Desktop.
Proposed TransactionBuilder Interfase.
/* 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