public class BitcoinJSONRPCClient extends Object implements BitcoindRpcClient
| Modifier and Type | Class and Description |
|---|---|
class |
BitcoinJSONRPCClient.DecodedScriptImpl |
class |
BitcoinJSONRPCClient.NetTotalsImpl |
BitcoindRpcClient.Address, BitcoindRpcClient.AddressValidationResult, BitcoindRpcClient.BasicTxInput, BitcoindRpcClient.BasicTxOutput, BitcoindRpcClient.Block, BitcoindRpcClient.BlockChainInfo, BitcoindRpcClient.DecodedScript, BitcoindRpcClient.ExtendedTxInput, BitcoindRpcClient.Info, BitcoindRpcClient.MiningInfo, BitcoindRpcClient.MultiSig, BitcoindRpcClient.NetTotals, BitcoindRpcClient.Network, BitcoindRpcClient.NetworkInfo, BitcoindRpcClient.NodeInfo, BitcoindRpcClient.PeerInfoResult, BitcoindRpcClient.RawTransaction, BitcoindRpcClient.ReceivedAddress, BitcoindRpcClient.SmartFeeResult, BitcoindRpcClient.Transaction, BitcoindRpcClient.TransactionsSinceBlock, BitcoindRpcClient.TxInput, BitcoindRpcClient.TxOut, BitcoindRpcClient.TxOutput, BitcoindRpcClient.TxOutSetInfo, BitcoindRpcClient.Unspent, BitcoindRpcClient.WalletInfo| Modifier and Type | Field and Description |
|---|---|
static URL |
DEFAULT_JSONRPC_TESTNET_URL |
static URL |
DEFAULT_JSONRPC_URL |
static Charset |
QUERY_CHARSET |
URL |
rpcURL |
| Constructor and Description |
|---|
BitcoinJSONRPCClient() |
BitcoinJSONRPCClient(boolean testNet) |
BitcoinJSONRPCClient(String rpcUrl) |
BitcoinJSONRPCClient(URL rpc) |
public final URL rpcURL
public static final URL DEFAULT_JSONRPC_URL
public static final URL DEFAULT_JSONRPC_TESTNET_URL
public static final Charset QUERY_CHARSET
public BitcoinJSONRPCClient(String rpcUrl) throws MalformedURLException
MalformedURLExceptionpublic BitcoinJSONRPCClient(URL rpc)
public BitcoinJSONRPCClient(boolean testNet)
public BitcoinJSONRPCClient()
public HostnameVerifier getHostnameVerifier()
public void setHostnameVerifier(HostnameVerifier hostnameVerifier)
public SSLSocketFactory getSslSocketFactory()
public void setSslSocketFactory(SSLSocketFactory sslSocketFactory)
public Object loadResponse(InputStream in, Object expectedID, boolean close) throws IOException, GenericRpcException
IOExceptionGenericRpcExceptionpublic Object query(String method, Object... o) throws GenericRpcException
GenericRpcExceptionpublic String createRawTransaction(List<BitcoindRpcClient.TxInput> inputs, List<BitcoindRpcClient.TxOutput> outputs) throws GenericRpcException
createRawTransaction in interface BitcoindRpcClientGenericRpcExceptionpublic String dumpPrivKey(String address) throws GenericRpcException
dumpPrivKey in interface BitcoindRpcClientGenericRpcExceptionpublic String getAccount(String address) throws GenericRpcException
getAccount in interface BitcoindRpcClientGenericRpcExceptionpublic String getAccountAddress(String address) throws GenericRpcException
getAccountAddress in interface BitcoindRpcClientGenericRpcExceptionpublic List<String> getAddressesByAccount(String account) throws GenericRpcException
getAddressesByAccount in interface BitcoindRpcClientGenericRpcExceptionpublic double getBalance()
throws GenericRpcException
getBalance in interface BitcoindRpcClientGenericRpcExceptionpublic double getBalance(String account) throws GenericRpcException
getBalance in interface BitcoindRpcClientGenericRpcExceptionpublic double getBalance(String account, int minConf) throws GenericRpcException
getBalance in interface BitcoindRpcClientGenericRpcExceptionpublic BitcoindRpcClient.SmartFeeResult getEstimateSmartFee(int blocks)
getEstimateSmartFee in interface BitcoindRpcClientpublic BitcoindRpcClient.Block getBlock(int height) throws GenericRpcException
getBlock in interface BitcoindRpcClientGenericRpcExceptionpublic BitcoindRpcClient.Block getBlock(String blockHash) throws GenericRpcException
getBlock in interface BitcoindRpcClientGenericRpcExceptionpublic String getRawBlock(String blockHash) throws GenericRpcException
getRawBlock in interface BitcoindRpcClientGenericRpcExceptionpublic String getBlockHash(int height) throws GenericRpcException
getBlockHash in interface BitcoindRpcClientGenericRpcExceptionpublic BitcoindRpcClient.BlockChainInfo getBlockChainInfo() throws GenericRpcException
getBlockChainInfo in interface BitcoindRpcClientGenericRpcExceptionpublic int getBlockCount()
throws GenericRpcException
getBlockCount in interface BitcoindRpcClientGenericRpcExceptionpublic BitcoindRpcClient.Info getInfo() throws GenericRpcException
getInfo in interface BitcoindRpcClientGenericRpcExceptionpublic BitcoindRpcClient.TxOutSetInfo getTxOutSetInfo() throws GenericRpcException
getTxOutSetInfo in interface BitcoindRpcClientGenericRpcExceptionpublic BitcoindRpcClient.NetworkInfo getNetworkInfo() throws GenericRpcException
getNetworkInfo in interface BitcoindRpcClientGenericRpcExceptionpublic BitcoindRpcClient.MiningInfo getMiningInfo() throws GenericRpcException
getMiningInfo in interface BitcoindRpcClientGenericRpcExceptionpublic List<BitcoindRpcClient.NodeInfo> getAddedNodeInfo(boolean dummy, String node) throws GenericRpcException
getAddedNodeInfo in interface BitcoindRpcClientGenericRpcExceptionpublic BitcoindRpcClient.MultiSig createMultiSig(int nRequired, List<String> keys) throws GenericRpcException
createMultiSig in interface BitcoindRpcClientGenericRpcExceptionpublic BitcoindRpcClient.WalletInfo getWalletInfo()
getWalletInfo in interface BitcoindRpcClientpublic String getNewAddress() throws GenericRpcException
getNewAddress in interface BitcoindRpcClientGenericRpcExceptionpublic String getNewAddress(String account) throws GenericRpcException
getNewAddress in interface BitcoindRpcClientGenericRpcExceptionpublic List<String> getRawMemPool() throws GenericRpcException
getRawMemPool in interface BitcoindRpcClientGenericRpcExceptionpublic String getBestBlockHash() throws GenericRpcException
getBestBlockHash in interface BitcoindRpcClientGenericRpcExceptionpublic String getRawTransactionHex(String txId) throws GenericRpcException
getRawTransactionHex in interface BitcoindRpcClientGenericRpcExceptionpublic BitcoindRpcClient.RawTransaction getRawTransaction(String txId) throws GenericRpcException
getRawTransaction in interface BitcoindRpcClientGenericRpcExceptionpublic double getReceivedByAddress(String address) throws GenericRpcException
getReceivedByAddress in interface BitcoindRpcClientGenericRpcExceptionpublic double getReceivedByAddress(String address, int minConf) throws GenericRpcException
BitcoindRpcClientgetReceivedByAddress in interface BitcoindRpcClientGenericRpcExceptionpublic void importPrivKey(String bitcoinPrivKey) throws GenericRpcException
importPrivKey in interface BitcoindRpcClientGenericRpcExceptionpublic void importPrivKey(String bitcoinPrivKey, String label) throws GenericRpcException
importPrivKey in interface BitcoindRpcClientGenericRpcExceptionpublic void importPrivKey(String bitcoinPrivKey, String label, boolean rescan) throws GenericRpcException
importPrivKey in interface BitcoindRpcClientGenericRpcExceptionpublic Object importAddress(String address, String label, boolean rescan) throws GenericRpcException
importAddress in interface BitcoindRpcClientGenericRpcExceptionpublic Map<String,Number> listAccounts() throws GenericRpcException
BitcoindRpcClientlistAccounts in interface BitcoindRpcClientGenericRpcExceptionpublic Map<String,Number> listAccounts(int minConf) throws GenericRpcException
listAccounts in interface BitcoindRpcClientGenericRpcExceptionpublic List<BitcoindRpcClient.ReceivedAddress> listReceivedByAddress() throws GenericRpcException
listReceivedByAddress in interface BitcoindRpcClientGenericRpcExceptionpublic List<BitcoindRpcClient.ReceivedAddress> listReceivedByAddress(int minConf) throws GenericRpcException
listReceivedByAddress in interface BitcoindRpcClientGenericRpcExceptionpublic List<BitcoindRpcClient.ReceivedAddress> listReceivedByAddress(int minConf, boolean includeEmpty) throws GenericRpcException
listReceivedByAddress in interface BitcoindRpcClientGenericRpcExceptionpublic BitcoindRpcClient.TransactionsSinceBlock listSinceBlock() throws GenericRpcException
listSinceBlock in interface BitcoindRpcClientGenericRpcExceptionpublic BitcoindRpcClient.TransactionsSinceBlock listSinceBlock(String blockHash) throws GenericRpcException
listSinceBlock in interface BitcoindRpcClientGenericRpcExceptionpublic BitcoindRpcClient.TransactionsSinceBlock listSinceBlock(String blockHash, int targetConfirmations) throws GenericRpcException
listSinceBlock in interface BitcoindRpcClientGenericRpcExceptionpublic List<BitcoindRpcClient.Transaction> listTransactions() throws GenericRpcException
listTransactions in interface BitcoindRpcClientGenericRpcExceptionpublic List<BitcoindRpcClient.Transaction> listTransactions(String account) throws GenericRpcException
listTransactions in interface BitcoindRpcClientGenericRpcExceptionpublic List<BitcoindRpcClient.Transaction> listTransactions(String account, int count) throws GenericRpcException
listTransactions in interface BitcoindRpcClientGenericRpcExceptionpublic List<BitcoindRpcClient.Transaction> listTransactions(String account, int count, int from) throws GenericRpcException
listTransactions in interface BitcoindRpcClientGenericRpcExceptionpublic List<BitcoindRpcClient.Unspent> listUnspent() throws GenericRpcException
listUnspent in interface BitcoindRpcClientGenericRpcExceptionpublic List<BitcoindRpcClient.Unspent> listUnspent(int minConf) throws GenericRpcException
listUnspent in interface BitcoindRpcClientGenericRpcExceptionpublic List<BitcoindRpcClient.Unspent> listUnspent(int minConf, int maxConf) throws GenericRpcException
listUnspent in interface BitcoindRpcClientGenericRpcExceptionpublic List<BitcoindRpcClient.Unspent> listUnspent(int minConf, int maxConf, String... addresses) throws GenericRpcException
listUnspent in interface BitcoindRpcClientGenericRpcExceptionpublic boolean move(String fromAccount, String toBitcoinAddress, double amount) throws GenericRpcException
move in interface BitcoindRpcClientGenericRpcExceptionpublic boolean move(String fromAccount, String toBitcoinAddress, double amount, int minConf) throws GenericRpcException
move in interface BitcoindRpcClientGenericRpcExceptionpublic boolean move(String fromAccount, String toBitcoinAddress, double amount, int minConf, String comment) throws GenericRpcException
move in interface BitcoindRpcClientGenericRpcExceptionpublic String sendFrom(String fromAccount, String toBitcoinAddress, double amount) throws GenericRpcException
sendFrom in interface BitcoindRpcClientGenericRpcExceptionpublic String sendFrom(String fromAccount, String toBitcoinAddress, double amount, int minConf) throws GenericRpcException
sendFrom in interface BitcoindRpcClientGenericRpcExceptionpublic String sendFrom(String fromAccount, String toBitcoinAddress, double amount, int minConf, String comment) throws GenericRpcException
sendFrom in interface BitcoindRpcClientGenericRpcExceptionpublic String sendFrom(String fromAccount, String toBitcoinAddress, double amount, int minConf, String comment, String commentTo) throws GenericRpcException
BitcoindRpcClientsendFrom in interface BitcoindRpcClientamount - is a real and is rounded to 8 decimal placesGenericRpcExceptionpublic String sendRawTransaction(String hex) throws GenericRpcException
sendRawTransaction in interface BitcoindRpcClientGenericRpcExceptionpublic String sendToAddress(String toAddress, double amount) throws GenericRpcException
sendToAddress in interface BitcoindRpcClientGenericRpcExceptionpublic String sendToAddress(String toAddress, double amount, String comment) throws GenericRpcException
sendToAddress in interface BitcoindRpcClientGenericRpcExceptionpublic String sendToAddress(String toAddress, double amount, String comment, String commentTo) throws GenericRpcException
sendToAddress in interface BitcoindRpcClientamount - is a real and is rounded to 8 decimal placesGenericRpcExceptionpublic String signRawTransaction(String hex) throws GenericRpcException
GenericRpcExceptionpublic String signRawTransaction(String hex, List<BitcoindRpcClient.ExtendedTxInput> inputs, List<String> privateKeys) throws GenericRpcException
signRawTransaction in interface BitcoindRpcClientGenericRpcExceptionpublic String signRawTransaction(String hex, List<BitcoindRpcClient.ExtendedTxInput> inputs, List<String> privateKeys, String sigHashType)
public BitcoindRpcClient.RawTransaction decodeRawTransaction(String hex) throws GenericRpcException
GenericRpcExceptionpublic BitcoindRpcClient.AddressValidationResult validateAddress(String address) throws GenericRpcException
validateAddress in interface BitcoindRpcClientGenericRpcExceptionpublic void setGenerate(boolean b)
throws BitcoinRPCException
setGenerate in interface BitcoindRpcClientb - a boolean indicating if blocks must be generated with the
cpuBitcoinRPCExceptionpublic List<String> generate(int numBlocks) throws BitcoinRPCException
BitcoindRpcClientgenerate in interface BitcoindRpcClientnumBlocks - a boolean indicating if blocks must be generated with the
cpuBitcoinRPCExceptionpublic List<String> generate(int numBlocks, long maxTries) throws BitcoinRPCException
generate in interface BitcoindRpcClientBitcoinRPCExceptionpublic double getEstimateFee(int nBlocks)
throws GenericRpcException
getEstimateFee in interface BitcoindRpcClientGenericRpcExceptionpublic double getEstimatePriority(int nBlocks)
throws GenericRpcException
getEstimatePriority in interface BitcoindRpcClientGenericRpcExceptionpublic void invalidateBlock(String hash) throws GenericRpcException
BitcoindRpcClientinvalidateBlock in interface BitcoindRpcClientGenericRpcExceptionpublic void reconsiderBlock(String hash) throws GenericRpcException
BitcoindRpcClientreconsiderBlock in interface BitcoindRpcClientGenericRpcExceptionpublic List<BitcoindRpcClient.PeerInfoResult> getPeerInfo() throws GenericRpcException
getPeerInfo in interface BitcoindRpcClientGenericRpcExceptionpublic void stop()
stop in interface BitcoindRpcClientpublic String getRawChangeAddress() throws GenericRpcException
getRawChangeAddress in interface BitcoindRpcClientGenericRpcExceptionpublic long getConnectionCount()
throws GenericRpcException
getConnectionCount in interface BitcoindRpcClientGenericRpcExceptionpublic double getUnconfirmedBalance()
throws GenericRpcException
getUnconfirmedBalance in interface BitcoindRpcClientGenericRpcExceptionpublic double getDifficulty()
throws GenericRpcException
getDifficulty in interface BitcoindRpcClientGenericRpcExceptionpublic BitcoindRpcClient.NetTotals getNetTotals() throws GenericRpcException
getNetTotals in interface BitcoindRpcClientGenericRpcExceptionpublic BitcoindRpcClient.DecodedScript decodeScript(String hex) throws GenericRpcException
decodeScript in interface BitcoindRpcClientGenericRpcExceptionpublic void ping()
throws GenericRpcException
ping in interface BitcoindRpcClientGenericRpcExceptionpublic boolean getGenerate()
throws BitcoinRPCException
getGenerate in interface BitcoindRpcClientBitcoinRPCExceptionpublic double getNetworkHashPs()
throws GenericRpcException
getNetworkHashPs in interface BitcoindRpcClientGenericRpcExceptionpublic boolean setTxFee(BigDecimal amount) throws GenericRpcException
setTxFee in interface BitcoindRpcClientGenericRpcExceptionpublic void addNode(String node, String command) throws GenericRpcException
addNode in interface BitcoindRpcClientnode - example: "192.168.0.6:8333"command - must be either "add", "remove" or "onetry"GenericRpcExceptionpublic void backupWallet(String destination) throws GenericRpcException
backupWallet in interface BitcoindRpcClientGenericRpcExceptionpublic String signMessage(String bitcoinAdress, String message) throws GenericRpcException
signMessage in interface BitcoindRpcClientGenericRpcExceptionpublic void dumpWallet(String filename) throws GenericRpcException
dumpWallet in interface BitcoindRpcClientGenericRpcExceptionpublic void importWallet(String filename) throws GenericRpcException
importWallet in interface BitcoindRpcClientGenericRpcExceptionpublic void keyPoolRefill()
throws GenericRpcException
keyPoolRefill in interface BitcoindRpcClientGenericRpcExceptionpublic void keyPoolRefill(long size)
throws GenericRpcException
GenericRpcExceptionpublic BigDecimal getReceivedByAccount(String account) throws GenericRpcException
getReceivedByAccount in interface BitcoindRpcClientGenericRpcExceptionpublic BigDecimal getReceivedByAccount(String account, int minConf) throws GenericRpcException
GenericRpcExceptionpublic void encryptWallet(String passPhrase) throws GenericRpcException
encryptWallet in interface BitcoindRpcClientGenericRpcExceptionpublic void walletPassPhrase(String passPhrase, long timeOut) throws GenericRpcException
walletPassPhrase in interface BitcoindRpcClientGenericRpcExceptionpublic boolean verifyMessage(String bitcoinAddress, String signature, String message) throws GenericRpcException
verifyMessage in interface BitcoindRpcClientGenericRpcExceptionpublic String addMultiSigAddress(int nRequired, List<String> keyObject) throws GenericRpcException
addMultiSigAddress in interface BitcoindRpcClientGenericRpcExceptionpublic String addMultiSigAddress(int nRequired, List<String> keyObject, String account) throws GenericRpcException
addMultiSigAddress in interface BitcoindRpcClientGenericRpcExceptionpublic boolean verifyChain()
verifyChain in interface BitcoindRpcClientpublic boolean verifyChain(int checklevel,
int numblocks)
public void submitBlock(String hexData)
submitBlock in interface BitcoindRpcClienthexData - public BitcoindRpcClient.TxOut getTxOut(String txId, long vout) throws GenericRpcException
getTxOut in interface BitcoindRpcClientGenericRpcExceptionpublic BitcoindRpcClient.TxOut getTxOut(String txId, long vout, boolean includemempool) throws GenericRpcException
GenericRpcExceptionCopyright © 2018. All rights reserved.