Polve/bitcoin-rpc-client

How can i convert List<Unspent> to List<TxInput>

pdrobek opened this issue · 1 comments

Hi

I have method Api_listUnspend

List<Unspent> Api_listUnspend(String account_id) {
        List<Unspent> list = new ArrayList();
        try {
            URL url = new URL("http://" + user + ':' + password + "@" + host + ":" + port + "/");
            BitcoinJSONRPCClient bitcoinClient = new BitcoinJSONRPCClient(url);
            list = bitcoinClient.listUnspent(6, 99999999, account_id);
        } catch (MalformedURLException e) {
            e.printStackTrace();
        }
        return list;
    }

i need to get tx from list and use it in createrawtransaction

Can anyone share, how to do that?

String raw = bitcoinClient.createRawTransaction(input, output);
return raw;

answer found in examples :)