@SuppressWarnings("serial")
@RooJavaBean(settersByDefault = false)
public class AddressAndAmount extends BaseClass {

	private String address;
	private BigDecimal amount;

	public AddressAndAmount(String address, BigDecimal amount) {
		this.address = address;
		this.amount = amount.setScale(BitcoindClient.SCALE);
	}

} @SuppressWarnings("serial")
@RooJavaBean(settersByDefault = false)
@JsonPropertyOrder({"txid", "vout"})
public class TransactionOutputRef extends BaseClass {

	@JsonProperty("txid")
	private String txId;
	
	@JsonProperty("vout")
	private Integer vout;

	/**
	 * Full constructor.
	 * 
	 * @param txId - transaction id.
	 * @param vout - output number.
	 */
	public TransactionOutputRef(@JsonProperty("txid") String txId, @JsonProperty("vout") Integer vout) {
		this.txId = txId;
		this.vout = vout;
	}

	
} public enum AddNodeAction {

	/**
	 * Add the given node.
	 */
	ADD("add"),

	/**
	 * Remove the given node.
	 */
	REMOVE("remove"),

	/**
	 * Try connecting to the given node once.
	 */
	ONE_TRY("onetry");

	private String value;

	private AddNodeAction(String value) {
		this.value = value;
	}

	@Override
	public String toString() {
		return value;
	}

} @SuppressWarnings("serial")
@RooJavaBean(settersByDefault = false)
public class TemplateRequest extends JsonExtra {

	private String[] capabilities;

	@JsonInclude(Include.NON_EMPTY)
	private String mode;

	/**
	 * Constructor.
	 *
	 * @param capabilities - SHOULD contain a list of the following, to indicate client-side support:
	 * "longpoll", "coinbasetxn", "coinbasevalue", "proposal", "serverlist",
	 * "workid", and any of the mutations (see {@link https://en.bitcoin.it/wiki/BIP_0022}).
	 * @param mode - MUST be "template" or omitted (null).
	 */
	public TemplateRequest(String[] capabilities, String mode) {
		this.capabilities = capabilities;
		this.mode = mode;
	}

} @SuppressWarnings("serial")
public class BigDecimalResponse extends BitcoindJsonRpcResponse<BigDecimal> {

} @SuppressWarnings("serial")
public class BooleanResponse extends BitcoindJsonRpcResponse<Boolean> {

} @SuppressWarnings("serial")
public class CreateMultiSigResponse extends BitcoindJsonRpcResponse<CreateMultiSigResult> {

} @SuppressWarnings("serial")
@RooJavaBean(settersByDefault = false)
public class DecodeRawTransactionResponse extends BitcoindJsonRpcResponse<DecodeRawTransactionResult> {

} @SuppressWarnings("serial")
@RooJavaBean(settersByDefault = false)
public class GetAddedNodeInfoResponse extends BitcoindJsonRpcResponse<AddedNodeInfo[]> {

} @SuppressWarnings("serial")
@RooJavaBean(settersByDefault = false)
public class GetBlockResponse extends BitcoindJsonRpcResponse<GetBlockResult> {

} @SuppressWarnings("serial")
@RooJavaBean(settersByDefault = false)
public class GetBlockTemplateResponse extends BitcoindJsonRpcResponse<GetBlockTemplateResult> {

} @SuppressWarnings("serial")
@RooJavaBean(settersByDefault = false)
public class GetInfoResponse extends BitcoindJsonRpcResponse<GetInfoResult> {

} @SuppressWarnings("serial")
@RooJavaBean(settersByDefault = false)
public class GetMiningInfoResponse extends BitcoindJsonRpcResponse<GetMiningInfoResult> {

} @SuppressWarnings("serial")
@RooJavaBean(settersByDefault = false)
public class GetPeerInfoResponse extends BitcoindJsonRpcResponse<PeerInfo[]> {

} @SuppressWarnings("serial")
@RooJavaBean(settersByDefault = false)
public class GetRawTransactionResponse extends BitcoindJsonRpcResponse<GetRawTransactionResult> {

} @SuppressWarnings("serial")
@RooJavaBean(settersByDefault = false)
public class GetTransactionResponse extends BitcoindJsonRpcResponse<GetTransactionResult> {

} @SuppressWarnings("serial")
@RooJavaBean(settersByDefault = false)
public class GetTxOutResponse extends BitcoindJsonRpcResponse<GetTxOutResult> {

} @SuppressWarnings("serial")
@RooJavaBean(settersByDefault = false)
public class GetTxOutSetInfoResponse extends BitcoindJsonRpcResponse<GetTxOutSetInfoResult> {

} @SuppressWarnings("serial")
@RooJavaBean(settersByDefault = false)
public class GetWorkResponse extends BitcoindJsonRpcResponse<GetWorkResult> {

} @SuppressWarnings("serial")
public class IntegerResponse extends BitcoindJsonRpcResponse<Integer> {

} @SuppressWarnings("serial")
public class ListAccountsResponse extends BitcoindJsonRpcResponse<ListAccountsResult> {

} @SuppressWarnings("serial")
@RooJavaBean(settersByDefault = false)
public class ListAddressGroupingsResponse extends BitcoindJsonRpcResponse<ListAddressGroupingsResult[]> {

} @SuppressWarnings("serial")
@RooJavaBean(settersByDefault = false)
public class ListLockUnspentResponse extends BitcoindJsonRpcResponse<TransactionOutputRef[]> {

} @SuppressWarnings("serial")
public class ListReceivedByAccountResponse extends BitcoindJsonRpcResponse<ListReceivedByAccountResult[]> {

} @SuppressWarnings("serial")
public class ListReceivedByAddressResponse extends BitcoindJsonRpcResponse<ListReceivedByAddressResult[]> {

} @SuppressWarnings("serial")
public class ListSinceBlockResponse extends BitcoindJsonRpcResponse<ListSinceBlockResult> {

} @SuppressWarnings("serial")
public class ListTransactionsResponse extends BitcoindJsonRpcResponse<TransactionData[]> {

} @SuppressWarnings("serial")
@RooJavaBean(settersByDefault = false)
public class ListUnspentResponse extends BitcoindJsonRpcResponse<ListUnspentResult[]> {

} @SuppressWarnings("serial")
@RooJavaBean(settersByDefault = false)
public class ListUnspentResult extends JsonExtra {

	@JsonUnwrapped
	private TransactionOutputRef txRef;

	private String scriptPubKey;
	private BigDecimal amount;
	private Integer confirmations;

} @SuppressWarnings("serial")
public class LongResponse extends BitcoindJsonRpcResponse<Long> {

} @SuppressWarnings("serial")
@RooJavaBean(settersByDefault = false)
public class SignRawTransactionResponse extends BitcoindJsonRpcResponse<SignRawTransactionResult> {

} @SuppressWarnings("serial")
public class StringArrayResponse extends BitcoindJsonRpcResponse<String[]> {

} @SuppressWarnings("serial")
public class StringResponse extends BitcoindJsonRpcResponse<String> {

} @SuppressWarnings("serial")
@RooJavaBean(settersByDefault = false)
public class ValidateAddressResponse extends BitcoindJsonRpcResponse<ValidateAddressResult> {

} @SuppressWarnings("serial")
public class VoidResponse extends BitcoindJsonRpcResponse<Object> {

}
import static dk.clanie.collections.CollectionFactory.newArrayList;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.List;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import com.fasterxml.jackson.databind.ObjectMapper;
import dk.clanie.bitcoin.AddressAndAmount;
import dk.clanie.bitcoin.TransactionOutputRef;
import dk.clanie.bitcoin.client.request.AddNodeAction;
import dk.clanie.bitcoin.client.request.TemplateRequest;
import dk.clanie.bitcoin.client.response.BigDecimalResponse;
import dk.clanie.bitcoin.client.response.BooleanResponse;
import dk.clanie.bitcoin.client.response.CreateMultiSigResponse;
import dk.clanie.bitcoin.client.response.DecodeRawTransactionResponse;
import dk.clanie.bitcoin.client.response.GetAddedNodeInfoResponse;
import dk.clanie.bitcoin.client.response.GetBlockResponse;
import dk.clanie.bitcoin.client.response.GetBlockTemplateResponse;
import dk.clanie.bitcoin.client.response.GetInfoResponse;
import dk.clanie.bitcoin.client.response.GetMiningInfoResponse;
import dk.clanie.bitcoin.client.response.GetPeerInfoResponse;
import dk.clanie.bitcoin.client.response.GetRawTransactionResponse;
import dk.clanie.bitcoin.client.response.GetTransactionResponse;
import dk.clanie.bitcoin.client.response.GetTxOutResponse;
import dk.clanie.bitcoin.client.response.GetTxOutSetInfoResponse;
import dk.clanie.bitcoin.client.response.GetWorkResponse;
import dk.clanie.bitcoin.client.response.IntegerResponse;
import dk.clanie.bitcoin.client.response.ListAccountsResponse;
import dk.clanie.bitcoin.client.response.ListAddressGroupingsResponse;
import dk.clanie.bitcoin.client.response.ListLockUnspentResponse;
import dk.clanie.bitcoin.client.response.ListReceivedByAccountResponse;
import dk.clanie.bitcoin.client.response.ListReceivedByAddressResponse;
import dk.clanie.bitcoin.client.response.ListSinceBlockResponse;
import dk.clanie.bitcoin.client.response.ListTransactionsResponse;
import dk.clanie.bitcoin.client.response.ListUnspentResponse;
import dk.clanie.bitcoin.client.response.ListUnspentResult;
import dk.clanie.bitcoin.client.response.LongResponse;
import dk.clanie.bitcoin.client.response.SignRawTransactionResponse;
import dk.clanie.bitcoin.client.response.StringArrayResponse;
import dk.clanie.bitcoin.client.response.StringResponse;
import dk.clanie.bitcoin.client.response.ValidateAddressResponse;
import dk.clanie.bitcoin.client.response.VoidResponse;
	public void testDumpPrivateKey() throws Exception {
		StringResponse dumpPrivateKeyResponse = bc.dumpPrivateKey("mxphxiG4Ggjb3bKFbeFnsuK2qde3541S93");
		print(dumpPrivateKeyResponse);
	}


	@Test
	public void testEncryptWallet() throws Exception {
		VoidResponse encryptWalletResponse = bc.encryptWallet("popidop");
		print(encryptWalletResponse);
	}


	@Test
	public void testGetAccount() throws Exception {
		StringResponse getAccountResponse = bc.getAccount("mof5U4zusfjigWYwwjf6c88Qn77KEafStx");
		print(getAccountResponse);
	}


	@Test
	public void testGetAccountAddress() throws Exception {
		StringResponse accountAddressResponse = bc.getAccountAddress("cocoo");
		print(accountAddressResponse);
	}


	@Test
	public void testGetAddedNodeInfo() throws Exception {
		GetAddedNodeInfoResponse addedNodeInfoResponse = bc.getAddedNodeInfo(true, "faucet.bitcoin.st");
		print(addedNodeInfoResponse);
	}


	@Test
	public void testGetAddedNodeInfo_noDns() throws Exception {
		GetAddedNodeInfoResponse addedNodeInfoResponse = bc.getAddedNodeInfo(false, "faucet.bitcoin.st");
		print(addedNodeInfoResponse);
	}


	@Test
	public void testGetAddressesByAccount() throws Exception {
		StringArrayResponse addressesByAccount = bc.getAddressesByAccount("clanie");
		print(addressesByAccount);
	}


	@Test
	public void testGetBalance() throws Exception {
		BigDecimalResponse balance = bc.getBalance("clanie", null);
		print(balance);
	}


	@Test
	public void testGetBlock() throws Exception {
		GetBlockResponse block = bc.getBlock("00000000d0ef0ae127a9371bf7657a1dbd597a6e7dc9e46eea68b74e68602ffb");
		print(block);
	}


	@Test
	public void testGetBlockCount() throws Exception {
		LongResponse count = bc.getBlockCount();
		print(count);
	}


	@Test
	public void testGetBlockHash() throws Exception {
		StringResponse hash = bc.getBlockHash(4L);
		print(hash);
	}


	@Test
	public void testGetBlockTemplate() throws Exception {
		GetBlockTemplateResponse blockTemplate = bc.getBlockTemplate(new TemplateRequest(new String[]{"longpoll",  "coinbasetxn", "coinbasevalue", "proposal", "serverlist", "workid"}, "template"));
		print(blockTemplate);
	}


	@Test
	public void testGetConnectionCount() throws Exception {
		IntegerResponse count = bc.getConnectionCount();
		print(count);
	}


	@Test
	public void testGetDifficulty() throws Exception {
		IntegerResponse count = bc.getDifficulty();
		print(count);
	}


	@Test
	public void testGetGenerate() throws Exception {
		BooleanResponse generate = bc.getGenerate();
		print(generate);
	}


	@Test
	public void testGetHashesPerSecond() throws Exception {
		LongResponse hps = bc.getHashesPerSecond();
		print(hps);
	}


	@Test
	public void testGetInfo() throws Exception {
		GetInfoResponse info = bc.getInfo();
		print(info);
	}


	@Test
	public void testGetMiningInfo() throws Exception {
		GetMiningInfoResponse info = bc.getMiningInfo();