@@ -0,0 +1,1154 @@
+package com.bitsofproof.supernode.api;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0Apublic class TransactionFactory%0A%7B%0A%09public static Transaction createCoinbase (long value, String receiver, int blockHeight, ChainParameter chain) throws ValidationException%0A%09%7B%0A%09%09Transaction coinbase = new Transaction ();%0A%09%09coinbase.setVersion (1);%0A%09%09coinbase.setLockTime (0);%0A%0A%09%09TransactionInput input = new TransactionInput ();%0A%09%09input.setSourceHash (Hash.ZERO_HASH_STRING);%0A%09%09input.setSequence (0xFFFFFFFFL);%0A%0A%09%09ScriptFormat.Writer writer = new ScriptFormat.Writer ();%0A%09%09writer.writeData (new ScriptFormat.Number (blockHeight).toByteArray ());%0A%09%09input.setScript (writer.toByteArray ());%0A%0A%09%09List%3CTransactionInput%3E inputs = new ArrayList%3CTransactionInput%3E ();%0A%09%09inputs.add (input);%0A%09%09coinbase.setInputs (inputs);%0A%0A%09%09TransactionOutput output = new TransactionOutput ();%0A%09%09output.setScript (ScriptFormat.getPayToAddressScript (AddressConverter.fromSatoshiStyle (receiver, chain)));%0A%09%09output.setValue (value);%0A%0A%09%09List%3CTransactionOutput%3E outputs = new ArrayList%3CTransactionOutput%3E ();%0A%09%09outputs.add (output);%0A%09%09coinbase.setOutputs (outputs);%0A%0A%09%09return coinbase;%0A%09%7D%0A%7D%0A

add transaction factory