Package wf.bitcoin.javabitcoindrpcclient
Class BitcoinJSONRPCClient
- java.lang.Object
-
- wf.bitcoin.javabitcoindrpcclient.BitcoinJSONRPCClient
-
- All Implemented Interfaces:
BitcoindRpcClient
public class BitcoinJSONRPCClient extends java.lang.Object implements BitcoindRpcClient
- Author:
- Mikhail Yevchenko m.ṥῥẚɱ.ѓѐḿởύḙ at azazar.com Small modifications by Alessandro Polverini polverini at gmail.com
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface wf.bitcoin.javabitcoindrpcclient.BitcoindRpcClient
BitcoindRpcClient.Address, BitcoindRpcClient.AddressBalance, BitcoindRpcClient.AddressInfo, BitcoindRpcClient.AddressInfoLabel, BitcoindRpcClient.AddressUtxo, BitcoindRpcClient.AddressValidationResult, BitcoindRpcClient.BasicTxInput, BitcoindRpcClient.BasicTxOutput, BitcoindRpcClient.Block, BitcoindRpcClient.BlockChainInfo, BitcoindRpcClient.DecodedScript, BitcoindRpcClient.ExtendedTxInput, BitcoindRpcClient.LockedUnspent, BitcoindRpcClient.MiningInfo, BitcoindRpcClient.MultiSig, BitcoindRpcClient.NetTotals, BitcoindRpcClient.Network, BitcoindRpcClient.NetworkInfo, BitcoindRpcClient.NodeInfo, BitcoindRpcClient.PeerInfoResult, BitcoindRpcClient.RawTransaction, BitcoindRpcClient.RawTransactionSigningOrVerificationError, BitcoindRpcClient.ReceivedAddress, BitcoindRpcClient.ScanObject, BitcoindRpcClient.SignedRawTransaction, BitcoindRpcClient.SmartFeeResult, BitcoindRpcClient.Transaction, BitcoindRpcClient.TransactionsSinceBlock, BitcoindRpcClient.TxInput, BitcoindRpcClient.TxOut, BitcoindRpcClient.TxOutput, BitcoindRpcClient.TxOutSetInfo, BitcoindRpcClient.Unspent, BitcoindRpcClient.UnspentTxOutput, BitcoindRpcClient.UtxoSet, BitcoindRpcClient.WalletInfo
-
-
Field Summary
Fields Modifier and Type Field Description static intCONNECT_TIMEOUTstatic java.net.URLDEFAULT_JSONRPC_REGTEST_URLstatic java.net.URLDEFAULT_JSONRPC_TESTNET_URLstatic java.net.URLDEFAULT_JSONRPC_URLstatic java.nio.charset.CharsetQUERY_CHARSETstatic intREAD_TIMEOUTjava.net.URLrpcURL
-
Constructor Summary
Constructors Constructor Description BitcoinJSONRPCClient()BitcoinJSONRPCClient(boolean testNet)BitcoinJSONRPCClient(java.lang.String rpcUrl)BitcoinJSONRPCClient(java.net.URL rpc)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.BooleanabortScanTxOutSet()Aborts the current scanBitcoindRpcClient.MultiSigaddMultiSigAddress(int nRequired, java.util.List<java.lang.String> keyObject)The addmultisigaddress RPC adds a P2SH multisig address to the wallet.BitcoindRpcClient.MultiSigaddMultiSigAddress(int nRequired, java.util.List<java.lang.String> keyObject, java.lang.String account)The addmultisigaddress RPC adds a P2SH multisig address to the wallet.voidaddNode(java.lang.String node, java.lang.String command)The addnode RPC attempts to add or remove a node from the addnode list, or to try a connection to a node once.voidbackupWallet(java.lang.String destination)The backupwallet RPC safely copies wallet.dat to the specified file, which can be a directory or a path with filename.java.lang.ObjectbatchQuery(java.lang.String method, java.util.List<wf.bitcoin.javabitcoindrpcclient.BitcoinJSONRPCClient.BatchParam> batchParams)BitcoindRpcClient.MultiSigcreateMultiSig(int nRequired, java.util.List<java.lang.String> keys)The createmultisig RPC creates a P2SH multi-signature address.java.lang.StringcreateRawTransaction(java.util.List<BitcoindRpcClient.TxInput> inputs, java.util.List<BitcoindRpcClient.TxOutput> outputs)The createrawtransaction RPC creates an unsigned serialized transaction that spends a previous output to a new output with a P2PKH or P2SH address.BitcoindRpcClient.RawTransactiondecodeRawTransaction(java.lang.String hex)BitcoindRpcClient.DecodedScriptdecodeScript(java.lang.String hex)The decodescript RPC decodes a hex-encoded P2SH redeem script.java.lang.StringdumpPrivKey(java.lang.String address)The dumpprivkey RPC returns the wallet-import-format (WIF) private key corresponding to an address.voiddumpWallet(java.lang.String filename)The dumpwallet RPC creates or overwrites a file with all wallet keys in a human-readable format.voidencryptWallet(java.lang.String passPhrase)The encryptwallet RPC encrypts the wallet with a passphrase.java.math.BigDecimalestimateFee(int nBlocks)The estimatefee RPC estimates the transaction fee per kilobyte that needs to be paid for a transaction to be included within a certain number of blocks.BitcoindRpcClient.SmartFeeResultestimateSmartFee(int blocks)Estimates the approximate fee per kilobyte needed for a transaction to begin confirmation within conf_target blocks if possible and return the number of blocks for which the estimate is valid.java.util.List<java.lang.String>generate(int numBlocks)Deprecated.java.util.List<java.lang.String>generate(int numBlocks, long maxTries)Deprecated.java.util.List<java.lang.String>generateToAddress(int numBlocks, java.lang.String address)The generatetoaddress RPC mines blocks immediately to a specified address.java.util.List<java.lang.String>generateToAddress(int numBlocks, java.lang.String address, long maxTries)The generatetoaddress RPC mines blocks immediately to a specified address.java.lang.StringgetAccount(java.lang.String address)The getaccount RPC returns the name of the account associated with the given address.java.lang.StringgetAccountAddress(java.lang.String account)The getaccountaddress RPC returns the current Bitcoin address for receiving payments to this account.java.util.List<BitcoindRpcClient.NodeInfo>getAddedNodeInfo(boolean dummy, java.lang.String node)The getaddednodeinfo RPC returns information about the given added node, or all added nodes (except onetry nodes).BitcoindRpcClient.AddressBalancegetAddressBalance(java.lang.String address)java.util.List<java.lang.String>getAddressesByAccount(java.lang.String account)The getaddressesbyaccount RPC returns a list of every address assigned to a particular account.BitcoindRpcClient.AddressInfogetAddressInfo(java.lang.String address)java.util.List<BitcoindRpcClient.AddressUtxo>getAddressUtxo(java.lang.String address)java.math.BigDecimalgetBalance()The getbalance RPC gets the balance in decimal bitcoins for the default account.java.math.BigDecimalgetBalance(java.lang.String account)The getbalance RPC gets the balance in decimal bitcoins across all accounts or for a particular account.java.math.BigDecimalgetBalance(java.lang.String account, int minConf)The getbalance RPC gets the balance in decimal bitcoins across all accounts or for a particular account.java.lang.StringgetBestBlockHash()The getbestblockhash RPC returns the header hash of the most recent block on the best block chain.BitcoindRpcClient.BlockgetBlock(int height)Gets a block at the given height from the local block database.BitcoindRpcClient.BlockgetBlock(java.lang.String blockHash)The getblock RPC gets a block with a particular header hash from the local block database either as a JSON object or as a serialized block.BitcoindRpcClient.BlockChainInfogetBlockChainInfo()The getblockchaininfo RPC provides information about the current state of the block chain.intgetBlockCount()The getblockcount RPC returns the number of blocks in the local best block chain.java.lang.StringgetBlockHash(int height)The getblockhash RPC returns the header hash of a block at the given height in the local best block chain.longgetConnectionCount()The getconnectioncount RPC returns the number of connections to other nodes.java.math.BigDecimalgetDifficulty()The getdifficulty RPCjavax.net.ssl.HostnameVerifiergetHostnameVerifier()BitcoindRpcClient.MiningInfogetMiningInfo()The getmininginfo RPC returns various mining-related information.BitcoindRpcClient.NetTotalsgetNetTotals()The getnettotals RPC returns information about network traffic, including bytes in, bytes out, and the current time.java.math.BigDecimalgetNetworkHashPs()The getnetworkhashps RPC returns the estimated current or historical network hashes per second based on the last n blocks.BitcoindRpcClient.NetworkInfogetNetworkInfo()The getnetworkinfo RPC returns information about the node’s connection to the network.java.lang.StringgetNewAddress()The getnewaddress RPC returns a new Bitcoin address for receiving payments.java.lang.StringgetNewAddress(java.lang.String account)The getnewaddress RPC returns a new Bitcoin address for receiving payments.java.lang.StringgetNewAddress(java.lang.String account, java.lang.String addressType)The getnewaddress RPC returns a new Bitcoin address for receiving payments.java.util.List<BitcoindRpcClient.PeerInfoResult>getPeerInfo()The getpeerinfo RPC returns data about each connected network node.java.lang.StringgetRawBlock(java.lang.String blockHash)The getblock RPC gets a block with a particular header hash from the local block database as a serialized block.java.lang.StringgetRawChangeAddress()The getrawchangeaddress RPC returns a new Bitcoin address for receiving change.java.util.List<java.lang.String>getRawMemPool()The getrawmempool RPC returns all transaction identifiers (TXIDs) in the memory pool as a JSON array, or detailed information about each transaction in the memory pool as a JSON object.BitcoindRpcClient.RawTransactiongetRawTransaction(java.lang.String txId)The getrawtransaction RPC gets a hex-encoded serialized transaction or a JSON object describing the transaction.java.lang.StringgetRawTransactionHex(java.lang.String txId)The getrawtransaction RPC gets a hex-encoded serialized transaction.java.util.List<BitcoindRpcClient.RawTransaction>getRawTransactions(java.util.List<java.lang.String> txIds)Get list of raw transactionsjava.math.BigDecimalgetReceivedByAccount(java.lang.String account)The getreceivedbyaccount RPC returns the total amount received by addresses in a particular account from transactions with the specified number of confirmations.java.math.BigDecimalgetReceivedByAccount(java.lang.String account, int minConf)java.math.BigDecimalgetReceivedByAddress(java.lang.String address)The getreceivedbyaddress RPC returns the total amount received by the specified address in transactions with the specified number of confirmations.java.math.BigDecimalgetReceivedByAddress(java.lang.String address, int minConf)The getreceivedbyaddress RPC returns the total amount received by the specified address in transactions with the specified number of confirmations.javax.net.ssl.SSLSocketFactorygetSslSocketFactory()BitcoindRpcClient.TransactiongetTransaction(java.lang.String txId)The gettransaction RPC gets detailed information about an in-wallet transaction.BitcoindRpcClient.TxOutgetTxOut(java.lang.String txId, long vout)The gettxout RPC returns details about an unspent transaction output (UTXO).BitcoindRpcClient.TxOutgetTxOut(java.lang.String txId, long vout, boolean includemempool)BitcoindRpcClient.TxOutSetInfogetTxOutSetInfo()The gettxoutsetinfo RPC returns statistics about the confirmed unspent transaction output (UTXO) set.java.math.BigDecimalgetUnconfirmedBalance()The getunconfirmedbalance RPC returns the wallet’s total unconfirmed balance.BitcoindRpcClient.WalletInfogetWalletInfo()The getwalletinfo RPC provides information about the wallet.java.lang.ObjectimportAddress(java.lang.String address, java.lang.String label, boolean rescan)The importaddress RPC adds an address or pubkey script to the wallet without the associated private key, allowing you to watch for transactions affecting that address or pubkey script without being able to spend any of its outputs.voidimportPrivKey(java.lang.String bitcoinPrivKey)The importprivkey RPC adds a private key to your wallet.voidimportPrivKey(java.lang.String bitcoinPrivKey, java.lang.String label)The importprivkey RPC adds a private key to your wallet.voidimportPrivKey(java.lang.String bitcoinPrivKey, java.lang.String label, boolean rescan)The importprivkey RPC adds a private key to your wallet.voidimportWallet(java.lang.String filename)The importwallet RPC imports private keys from a file in wallet dump file format (see the dumpwallet RPC).voidinvalidateBlock(java.lang.String hash)Permanently marks a block as invalid, as if it violated a consensus rule.voidkeyPoolRefill()The keypoolrefill RPC fills the cache of unused pre-generated keys (the keypool).voidkeyPoolRefill(long size)java.util.Map<java.lang.String,java.lang.Number>listAccounts()The listaccounts RPC lists accounts and their balances.java.util.Map<java.lang.String,java.lang.Number>listAccounts(int minConf)The listaccounts RPC lists accounts and their balances.java.util.Map<java.lang.String,java.lang.Number>listAccounts(int minConf, boolean watchonly)The listaccounts RPC lists accounts and their balances.java.util.List<BitcoindRpcClient.LockedUnspent>listLockUnspent()The listlockunspent RPC returns a list of temporarily unspendable (locked) outputs.java.util.List<BitcoindRpcClient.ReceivedAddress>listReceivedByAddress()The listreceivedbyaddress RPC lists the total number of bitcoins received by each address.java.util.List<BitcoindRpcClient.ReceivedAddress>listReceivedByAddress(int minConf)The listreceivedbyaddress RPC lists the total number of bitcoins received by each address.java.util.List<BitcoindRpcClient.ReceivedAddress>listReceivedByAddress(int minConf, boolean includeEmpty)The listreceivedbyaddress RPC lists the total number of bitcoins received by each address.BitcoindRpcClient.TransactionsSinceBlocklistSinceBlock()The listsinceblock RPC gets all transactions affecting the wallet which have occurred since a particular block, plus the header hash of a block at a particular depth.BitcoindRpcClient.TransactionsSinceBlocklistSinceBlock(java.lang.String blockHash)The listsinceblock RPC gets all transactions affecting the wallet which have occurred since a particular block, plus the header hash of a block at a particular depth.BitcoindRpcClient.TransactionsSinceBlocklistSinceBlock(java.lang.String blockHash, int targetConfirmations)The listsinceblock RPC gets all transactions affecting the wallet which have occurred since a particular block, plus the header hash of a block at a particular depth.BitcoindRpcClient.TransactionsSinceBlocklistSinceBlock(java.lang.String blockHash, int targetConfirmations, boolean includeWatchOnly)The listsinceblock RPC gets all transactions affecting the wallet which have occurred since a particular block, plus the header hash of a block at a particular depth.java.util.List<BitcoindRpcClient.Transaction>listTransactions()The listtransactions RPC returns the most recent transactions that affect the wallet.java.util.List<BitcoindRpcClient.Transaction>listTransactions(java.lang.String account)The listtransactions RPC returns the most recent transactions that affect the wallet.java.util.List<BitcoindRpcClient.Transaction>listTransactions(java.lang.String account, int count)The listtransactions RPC returns the most recent transactions that affect the wallet.java.util.List<BitcoindRpcClient.Transaction>listTransactions(java.lang.String account, int count, int skip)The listtransactions RPC returns the most recent transactions that affect the wallet.java.util.List<BitcoindRpcClient.Unspent>listUnspent()The listunspent RPC returns an array of unspent transaction outputs belonging to this wallet.java.util.List<BitcoindRpcClient.Unspent>listUnspent(int minConf)The listunspent RPC returns an array of unspent transaction outputs belonging to this wallet.java.util.List<BitcoindRpcClient.Unspent>listUnspent(int minConf, int maxConf)The listunspent RPC returns an array of unspent transaction outputs belonging to this wallet.java.util.List<BitcoindRpcClient.Unspent>listUnspent(int minConf, int maxConf, java.lang.String... addresses)The listunspent RPC returns an array of unspent transaction outputs belonging to this wallet.java.lang.ObjectloadBatchResponse(java.io.InputStream in, java.util.List<wf.bitcoin.javabitcoindrpcclient.BitcoinJSONRPCClient.BatchParam> batchParams, boolean close)java.lang.ObjectloadResponse(java.io.InputStream in, java.lang.Object expectedID, boolean close)booleanlockUnspent(boolean unlock, java.lang.String txid, int vout)The lockunspent RPC temporarily locks or unlocks specified transaction outputs.booleanmove(java.lang.String fromAccount, java.lang.String toAddress, java.math.BigDecimal amount)The move RPC moves a specified amount from one account in your wallet to another using an off-block-chain transaction.booleanmove(java.lang.String fromAccount, java.lang.String toAddress, java.math.BigDecimal amount, int minConf)booleanmove(java.lang.String fromAccount, java.lang.String toAddress, java.math.BigDecimal amount, int minConf, java.lang.String comment)booleanmove(java.lang.String fromAccount, java.lang.String toAddress, java.math.BigDecimal amount, java.lang.String comment)The move RPC moves a specified amount from one account in your wallet to another using an off-block-chain transaction.voidping()The ping RPC sends a P2P ping message to all connected nodes to measure ping time.protected byte[]prepareBatchRequest(java.lang.String method, java.util.List<wf.bitcoin.javabitcoindrpcclient.BitcoinJSONRPCClient.BatchParam> paramsList)protected byte[]prepareRequest(java.lang.String method, java.lang.Object... params)java.lang.Objectquery(java.lang.String method, java.lang.Object... o)voidreconsiderBlock(java.lang.String hash)Removes invalidity status of a block and its descendants, reconsider them for activation.BitcoindRpcClient.UtxoSetscanTxOutSet(java.util.List<BitcoindRpcClient.ScanObject> scanObjects)The scantxoutset RPC scans the unspent transaction output set for entries that match certain output descriptors.BitcoindRpcClient.UtxoSetscanTxOutSetAddresses(java.util.List<java.lang.String> addresses)Convenience method for retrieving UTXO SET for a list of addresses.BitcoindRpcClient.UtxoSetscanTxOutSetPubKey(java.lang.String pubkey, int range)Convenience method for retrieving UTXO SET (P2PK, P2PKH, P2WPKH, and P2SH-P2WPKH outputs) for a given pubkey.java.lang.IntegerscanTxOutSetStatus()Returns the status for progress report (in %) of the current scan.java.lang.StringsendFrom(java.lang.String fromAccount, java.lang.String toAddress, java.math.BigDecimal amount)The sendfrom RPC spends an amount from a local account to a bitcoin address.java.lang.StringsendFrom(java.lang.String fromAccount, java.lang.String toAddress, java.math.BigDecimal amount, int minConf)The sendfrom RPC spends an amount from a local account to a bitcoin address.java.lang.StringsendFrom(java.lang.String fromAccount, java.lang.String toAddress, java.math.BigDecimal amount, int minConf, java.lang.String comment)The sendfrom RPC spends an amount from a local account to a bitcoin address.java.lang.StringsendFrom(java.lang.String fromAccount, java.lang.String toAddress, java.math.BigDecimal amount, int minConf, java.lang.String comment, java.lang.String commentTo)The sendfrom RPC spends an amount from a local account to a bitcoin address.java.lang.StringsendRawTransaction(java.lang.String hex)The sendrawtransaction RPC validates a transaction and broadcasts it to the peer-to-peer network.java.lang.StringsendToAddress(java.lang.String toAddress, java.math.BigDecimal amount)The sendtoaddress RPC spends an amount to a given address.java.lang.StringsendToAddress(java.lang.String toAddress, java.math.BigDecimal amount, java.lang.String comment)The sendtoaddress RPC spends an amount to a given address.java.lang.StringsendToAddress(java.lang.String toAddress, java.math.BigDecimal amount, java.lang.String comment, java.lang.String commentTo)The sendtoaddress RPC spends an amount to a given address.voidsetHostnameVerifier(javax.net.ssl.HostnameVerifier hostnameVerifier)voidsetSslSocketFactory(javax.net.ssl.SSLSocketFactory sslSocketFactory)booleansetTxFee(java.math.BigDecimal amount)The settxfee RPC sets the transaction fee per kilobyte paid by transactions created by this wallet.java.lang.StringsignMessage(java.lang.String bitcoinAdress, java.lang.String message)The signmessage RPC signs a message with the private key of an address.java.lang.StringsignRawTransaction(java.lang.String hex)Deprecated.java.lang.StringsignRawTransaction(java.lang.String hex, java.util.List<? extends BitcoindRpcClient.TxInput> inputs, java.util.List<java.lang.String> privateKeys)Deprecated.java.lang.StringsignRawTransaction(java.lang.String hex, java.util.List<? extends BitcoindRpcClient.TxInput> inputs, java.util.List<java.lang.String> privateKeys, java.lang.String sigHashType)Deprecated.BitcoindRpcClient.SignedRawTransactionsignRawTransactionWithKey(java.lang.String hex, java.util.List<java.lang.String> privateKeys, java.util.List<? extends BitcoindRpcClient.TxInput> prevTxs, SignatureHashType sigHashType)The signrawtransactionwithkey RPC sign inputs for raw transaction (serialized, hex-encoded).voidstop()The stop RPC safely shuts down the Bitcoin Core server.voidsubmitBlock(java.lang.String hexData)Attempts to submit new block to network.BitcoindRpcClient.AddressValidationResultvalidateAddress(java.lang.String address)The validateaddress RPC returns information about the given Bitcoin address.booleanverifyChain()The verifychain RPC verifies each entry in the local block chain database.booleanverifyChain(int checklevel, int numblocks)booleanverifyMessage(java.lang.String bitcoinAddress, java.lang.String signature, java.lang.String message)The verifymessage RPC verifies a signed message.voidwalletPassPhrase(java.lang.String passPhrase, long timeOut)The walletpassphrase RPC stores the wallet decryption key in memory for the indicated number of seconds.
-
-
-
Field Detail
-
DEFAULT_JSONRPC_URL
public static final java.net.URL DEFAULT_JSONRPC_URL
-
DEFAULT_JSONRPC_TESTNET_URL
public static final java.net.URL DEFAULT_JSONRPC_TESTNET_URL
-
DEFAULT_JSONRPC_REGTEST_URL
public static final java.net.URL DEFAULT_JSONRPC_REGTEST_URL
-
QUERY_CHARSET
public static final java.nio.charset.Charset QUERY_CHARSET
-
CONNECT_TIMEOUT
public static final int CONNECT_TIMEOUT
-
READ_TIMEOUT
public static final int READ_TIMEOUT
-
rpcURL
public final java.net.URL rpcURL
-
-
Constructor Detail
-
BitcoinJSONRPCClient
public BitcoinJSONRPCClient(java.lang.String rpcUrl) throws java.net.MalformedURLException- Throws:
java.net.MalformedURLException
-
BitcoinJSONRPCClient
public BitcoinJSONRPCClient(java.net.URL rpc)
-
BitcoinJSONRPCClient
public BitcoinJSONRPCClient(boolean testNet)
-
BitcoinJSONRPCClient
public BitcoinJSONRPCClient()
-
-
Method Detail
-
getHostnameVerifier
public javax.net.ssl.HostnameVerifier getHostnameVerifier()
-
setHostnameVerifier
public void setHostnameVerifier(javax.net.ssl.HostnameVerifier hostnameVerifier)
-
getSslSocketFactory
public javax.net.ssl.SSLSocketFactory getSslSocketFactory()
-
setSslSocketFactory
public void setSslSocketFactory(javax.net.ssl.SSLSocketFactory sslSocketFactory)
-
prepareRequest
protected byte[] prepareRequest(java.lang.String method, java.lang.Object... params)
-
prepareBatchRequest
protected byte[] prepareBatchRequest(java.lang.String method, java.util.List<wf.bitcoin.javabitcoindrpcclient.BitcoinJSONRPCClient.BatchParam> paramsList)
-
loadResponse
public java.lang.Object loadResponse(java.io.InputStream in, java.lang.Object expectedID, boolean close) throws java.io.IOException, GenericRpcException- Throws:
java.io.IOExceptionGenericRpcException
-
loadBatchResponse
public java.lang.Object loadBatchResponse(java.io.InputStream in, java.util.List<wf.bitcoin.javabitcoindrpcclient.BitcoinJSONRPCClient.BatchParam> batchParams, boolean close) throws java.io.IOException, GenericRpcException- Throws:
java.io.IOExceptionGenericRpcException
-
query
public java.lang.Object query(java.lang.String method, java.lang.Object... o) throws GenericRpcException- Throws:
GenericRpcException
-
batchQuery
public java.lang.Object batchQuery(java.lang.String method, java.util.List<wf.bitcoin.javabitcoindrpcclient.BitcoinJSONRPCClient.BatchParam> batchParams) throws GenericRpcException- Throws:
GenericRpcException
-
createRawTransaction
public java.lang.String createRawTransaction(java.util.List<BitcoindRpcClient.TxInput> inputs, java.util.List<BitcoindRpcClient.TxOutput> outputs) throws GenericRpcException
Description copied from interface:BitcoindRpcClientThe createrawtransaction RPC creates an unsigned serialized transaction that spends a previous output to a new output with a P2PKH or P2SH address. The transaction is not stored in the wallet or transmitted to the network.- Specified by:
createRawTransactionin interfaceBitcoindRpcClient- Parameters:
inputs- An array of objects, each one to be used as an input to the transactionoutputs- The addresses and amounts to pay- Returns:
- The resulting unsigned raw transaction in serialized transaction format encoded as hex.
- Throws:
GenericRpcException- See Also:
- createrawtransaction
-
dumpPrivKey
public java.lang.String dumpPrivKey(java.lang.String address) throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe dumpprivkey RPC returns the wallet-import-format (WIF) private key corresponding to an address. (But does not remove it from the wallet.)- Specified by:
dumpPrivKeyin interfaceBitcoindRpcClient- Parameters:
address- The P2PKH address corresponding to the private key you want returned.- Throws:
GenericRpcException- See Also:
- dumpprivkey
-
getAccount
public java.lang.String getAccount(java.lang.String address) throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe getaccount RPC returns the name of the account associated with the given address.- Specified by:
getAccountin interfaceBitcoindRpcClient- Parameters:
address- A P2PKH or P2SH Bitcoin address belonging either to a specific account or the default account- Returns:
- The name of an account, or an empty string
- Throws:
GenericRpcException- See Also:
- getaccount
-
getAccountAddress
public java.lang.String getAccountAddress(java.lang.String account) throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe getaccountaddress RPC returns the current Bitcoin address for receiving payments to this account. If the account doesn’t exist, it creates both the account and a new address for receiving payment. Once a payment has been received to an address, future calls to this RPC for the same account will return a different address.- Specified by:
getAccountAddressin interfaceBitcoindRpcClient- Parameters:
account- The name of an account.- Returns:
- An address, belonging to the account specified, which has not yet received any payments
- Throws:
GenericRpcException- See Also:
- getaccountaddress
-
getAddressesByAccount
public java.util.List<java.lang.String> getAddressesByAccount(java.lang.String account) throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe getaddressesbyaccount RPC returns a list of every address assigned to a particular account.- Specified by:
getAddressesByAccountin interfaceBitcoindRpcClient- Parameters:
account- The name of an account to get the balance for.- Throws:
GenericRpcException- See Also:
- getaddressesbyaccount
-
getBalance
public java.math.BigDecimal getBalance() throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe getbalance RPC gets the balance in decimal bitcoins for the default account.- Specified by:
getBalancein interfaceBitcoindRpcClient- Throws:
GenericRpcException- See Also:
- getbalance
-
getBalance
public java.math.BigDecimal getBalance(java.lang.String account) throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe getbalance RPC gets the balance in decimal bitcoins across all accounts or for a particular account.- Specified by:
getBalancein interfaceBitcoindRpcClient- Parameters:
account- The name of an account to get the balance for.- Throws:
GenericRpcException- See Also:
- getbalance
-
getBalance
public java.math.BigDecimal getBalance(java.lang.String account, int minConf) throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe getbalance RPC gets the balance in decimal bitcoins across all accounts or for a particular account.- Specified by:
getBalancein interfaceBitcoindRpcClient- Parameters:
account- The name of an account to get the balance for.minConf- The minimum number of confirmations- Throws:
GenericRpcException- See Also:
- getbalance
-
estimateSmartFee
public BitcoindRpcClient.SmartFeeResult estimateSmartFee(int blocks)
Description copied from interface:BitcoindRpcClientEstimates the approximate fee per kilobyte needed for a transaction to begin confirmation within conf_target blocks if possible and return the number of blocks for which the estimate is valid. Uses virtual transaction size as defined in BIP 141 (witness data is discounted).- Specified by:
estimateSmartFeein interfaceBitcoindRpcClient- Parameters:
blocks- Confirmation target in blocks- Returns:
- estimate fee rate in BTC/kB [TODO] Add to https://bitcoin.org/en/developer-reference
-
getBlock
public BitcoindRpcClient.Block getBlock(int height) throws GenericRpcException
Description copied from interface:BitcoindRpcClientGets a block at the given height from the local block database. This is a convenience method as a combination ofBitcoindRpcClient.getBlockHash(int)andBitcoindRpcClient.getBlock(String).- Specified by:
getBlockin interfaceBitcoindRpcClient- Throws:
GenericRpcException- See Also:
- getblockhash, getblock
-
getBlock
public BitcoindRpcClient.Block getBlock(java.lang.String blockHash) throws GenericRpcException
Description copied from interface:BitcoindRpcClientThe getblock RPC gets a block with a particular header hash from the local block database either as a JSON object or as a serialized block.- Specified by:
getBlockin interfaceBitcoindRpcClient- Parameters:
blockHash- The hash of the header of the block to get, encoded as hex in RPC byte order- Throws:
GenericRpcException- See Also:
- getblock
-
getRawBlock
public java.lang.String getRawBlock(java.lang.String blockHash) throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe getblock RPC gets a block with a particular header hash from the local block database as a serialized block.- Specified by:
getRawBlockin interfaceBitcoindRpcClient- Parameters:
blockHash- The hash of the header of the block to get, encoded as hex in RPC byte order- Throws:
GenericRpcException- See Also:
- getblock
-
getBlockHash
public java.lang.String getBlockHash(int height) throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe getblockhash RPC returns the header hash of a block at the given height in the local best block chain.- Specified by:
getBlockHashin interfaceBitcoindRpcClient- Parameters:
height- The height of the block whose header hash should be returned.- Returns:
- The hash of the block at the requested height, encoded as hex in RPC byte order, or JSON null if an error occurred
- Throws:
GenericRpcException- See Also:
- getblockhash
-
getBlockChainInfo
public BitcoindRpcClient.BlockChainInfo getBlockChainInfo() throws GenericRpcException
Description copied from interface:BitcoindRpcClientThe getblockchaininfo RPC provides information about the current state of the block chain.- Specified by:
getBlockChainInfoin interfaceBitcoindRpcClient- Returns:
- Information about the current state of the local block chain
- Throws:
GenericRpcException- See Also:
- getblockchaininfo
-
getAddressInfo
public BitcoindRpcClient.AddressInfo getAddressInfo(java.lang.String address) throws GenericRpcException
- Specified by:
getAddressInfoin interfaceBitcoindRpcClient- Parameters:
address- The bitcoin address to get the information of- Returns:
- Return information about the given bitcoin address. Some information requires the address to be in the wallet
- Throws:
GenericRpcException- See Also:
- getaddressinfo
-
getBlockCount
public int getBlockCount() throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe getblockcount RPC returns the number of blocks in the local best block chain.- Specified by:
getBlockCountin interfaceBitcoindRpcClient- Returns:
- The number of blocks in the local best block chain.
- Throws:
GenericRpcException- See Also:
- getblockcount
-
getTxOutSetInfo
public BitcoindRpcClient.TxOutSetInfo getTxOutSetInfo() throws GenericRpcException
Description copied from interface:BitcoindRpcClientThe gettxoutsetinfo RPC returns statistics about the confirmed unspent transaction output (UTXO) set. Note that this call may take some time and that it only counts outputs from confirmed transactions—it does not count outputs from the memory pool.- Specified by:
getTxOutSetInfoin interfaceBitcoindRpcClient- Returns:
- Information about the UTXO set
- Throws:
GenericRpcException- See Also:
- gettxoutsetinfo
-
getNetworkInfo
public BitcoindRpcClient.NetworkInfo getNetworkInfo() throws GenericRpcException
Description copied from interface:BitcoindRpcClientThe getnetworkinfo RPC returns information about the node’s connection to the network.- Specified by:
getNetworkInfoin interfaceBitcoindRpcClient- Returns:
- Information about this node’s connection to the network
- Throws:
GenericRpcException- See Also:
- getnetworkinfo
-
getMiningInfo
public BitcoindRpcClient.MiningInfo getMiningInfo() throws GenericRpcException
Description copied from interface:BitcoindRpcClientThe getmininginfo RPC returns various mining-related information.- Specified by:
getMiningInfoin interfaceBitcoindRpcClient- Returns:
- Various mining-related information
- Throws:
GenericRpcException- See Also:
- getmininginfo
-
getAddedNodeInfo
public java.util.List<BitcoindRpcClient.NodeInfo> getAddedNodeInfo(boolean dummy, java.lang.String node) throws GenericRpcException
Description copied from interface:BitcoindRpcClientThe getaddednodeinfo RPC returns information about the given added node, or all added nodes (except onetry nodes). Only nodes which have been manually added using the addnode RPC will have their information displayed.- Specified by:
getAddedNodeInfoin interfaceBitcoindRpcClient- Parameters:
dummy- Removed in Bitcoin Core 0.14.0node- The node to get information about in the same: format as the addnode RPC. - Returns:
- An array containing objects describing each added node.
- Throws:
GenericRpcException- See Also:
- getaddednodeinfo
-
createMultiSig
public BitcoindRpcClient.MultiSig createMultiSig(int nRequired, java.util.List<java.lang.String> keys) throws GenericRpcException
Description copied from interface:BitcoindRpcClientThe createmultisig RPC creates a P2SH multi-signature address.- Specified by:
createMultiSigin interfaceBitcoindRpcClient- Parameters:
nRequired- The minimum (m) number of signatures required to spend this m-of-n multisig scriptkeys- An array of strings with each string being a public key or address- Throws:
GenericRpcException- See Also:
- createmultisig
-
getWalletInfo
public BitcoindRpcClient.WalletInfo getWalletInfo()
Description copied from interface:BitcoindRpcClientThe getwalletinfo RPC provides information about the wallet.- Specified by:
getWalletInfoin interfaceBitcoindRpcClient- Returns:
- An object describing the wallet
- See Also:
- getwalletinfo
-
getNewAddress
public java.lang.String getNewAddress() throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe getnewaddress RPC returns a new Bitcoin address for receiving payments.- Specified by:
getNewAddressin interfaceBitcoindRpcClient- Throws:
GenericRpcException- See Also:
- getnewaddress
-
getNewAddress
public java.lang.String getNewAddress(java.lang.String account) throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe getnewaddress RPC returns a new Bitcoin address for receiving payments. If an account is specified, payments received with the address will be credited to that account.- Specified by:
getNewAddressin interfaceBitcoindRpcClient- Throws:
GenericRpcException- See Also:
- getnewaddress
-
getNewAddress
public java.lang.String getNewAddress(java.lang.String account, java.lang.String addressType) throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe getnewaddress RPC returns a new Bitcoin address for receiving payments. If an account is specified, payments received with the address will be credited to that account. The address type to use. Options are "legacy", "p2sh-segwit", and "bech32".- Specified by:
getNewAddressin interfaceBitcoindRpcClient- Throws:
GenericRpcException- See Also:
- getnewaddress
-
getRawMemPool
public java.util.List<java.lang.String> getRawMemPool() throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe getrawmempool RPC returns all transaction identifiers (TXIDs) in the memory pool as a JSON array, or detailed information about each transaction in the memory pool as a JSON object.- Specified by:
getRawMemPoolin interfaceBitcoindRpcClient- Returns:
- An array of TXIDs belonging to transactions in the memory pool.
- Throws:
GenericRpcException- See Also:
- getrawmempool
-
getBestBlockHash
public java.lang.String getBestBlockHash() throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe getbestblockhash RPC returns the header hash of the most recent block on the best block chain.- Specified by:
getBestBlockHashin interfaceBitcoindRpcClient- Throws:
GenericRpcException- See Also:
- getbestblockhash
-
getRawTransactionHex
public java.lang.String getRawTransactionHex(java.lang.String txId) throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe getrawtransaction RPC gets a hex-encoded serialized transaction.- Specified by:
getRawTransactionHexin interfaceBitcoindRpcClient- Parameters:
txId- The TXID of the transaction to get, encoded as hex in RPC byte order- Throws:
GenericRpcException- See Also:
- getrawtransaction
-
getRawTransaction
public BitcoindRpcClient.RawTransaction getRawTransaction(java.lang.String txId) throws GenericRpcException
Description copied from interface:BitcoindRpcClientThe getrawtransaction RPC gets a hex-encoded serialized transaction or a JSON object describing the transaction. By default, Bitcoin Core only stores complete transaction data for UTXOs and your own transactions, so the RPC may fail on historic transactions unless you use the non-default txindex=1 in your Bitcoin Core startup settings.- Specified by:
getRawTransactionin interfaceBitcoindRpcClient- Parameters:
txId- The TXID of the transaction to get, encoded as hex in RPC byte order- Throws:
GenericRpcException- See Also:
- getrawtransaction
-
getRawTransactions
public java.util.List<BitcoindRpcClient.RawTransaction> getRawTransactions(java.util.List<java.lang.String> txIds) throws GenericRpcException
Description copied from interface:BitcoindRpcClientGet list of raw transactions- Specified by:
getRawTransactionsin interfaceBitcoindRpcClient- Parameters:
txIds- The TXIDs of the transactions to get, encoded as hex in RPC byte order- Throws:
GenericRpcException- See Also:
for details
-
getReceivedByAddress
public java.math.BigDecimal getReceivedByAddress(java.lang.String address) throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe getreceivedbyaddress RPC returns the total amount received by the specified address in transactions with the specified number of confirmations. It does not count coinbase transactions.- Specified by:
getReceivedByAddressin interfaceBitcoindRpcClient- Parameters:
address- The address whose transactions should be tallied- Returns:
- The number of bitcoins received by the address
- Throws:
GenericRpcException- See Also:
- getreceivedbyaddress
-
getReceivedByAddress
public java.math.BigDecimal getReceivedByAddress(java.lang.String address, int minConf) throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe getreceivedbyaddress RPC returns the total amount received by the specified address in transactions with the specified number of confirmations. It does not count coinbase transactions.- Specified by:
getReceivedByAddressin interfaceBitcoindRpcClient- Parameters:
address- The address whose transactions should be talliedminConf- The minimum number of confirmations- Returns:
- The number of bitcoins received by the address
- Throws:
GenericRpcException- See Also:
- getreceivedbyaddress
-
importPrivKey
public void importPrivKey(java.lang.String bitcoinPrivKey) throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe importprivkey RPC adds a private key to your wallet. The key should be formatted in the wallet import format created by the dumpprivkey RPC.- Specified by:
importPrivKeyin interfaceBitcoindRpcClient- Parameters:
bitcoinPrivKey- The private key to import into the wallet encoded in base58check using wallet import format (WIF)- Throws:
GenericRpcException- See Also:
- importprivkey
-
importPrivKey
public void importPrivKey(java.lang.String bitcoinPrivKey, java.lang.String label) throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe importprivkey RPC adds a private key to your wallet. The key should be formatted in the wallet import format created by the dumpprivkey RPC.- Specified by:
importPrivKeyin interfaceBitcoindRpcClient- Parameters:
bitcoinPrivKey- The private key to import into the wallet encoded in base58check using wallet import format (WIF)label- The name of an account to which transactions involving the key should be assigned.- Throws:
GenericRpcException- See Also:
- importprivkey
-
importPrivKey
public void importPrivKey(java.lang.String bitcoinPrivKey, java.lang.String label, boolean rescan) throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe importprivkey RPC adds a private key to your wallet. The key should be formatted in the wallet import format created by the dumpprivkey RPC.- Specified by:
importPrivKeyin interfaceBitcoindRpcClient- Parameters:
bitcoinPrivKey- The private key to import into the wallet encoded in base58check using wallet import format (WIF)label- The name of an account to which transactions involving the key should be assigned.rescan- Set to true (the default) to rescan the entire local block database for transactions affecting any address or pubkey script in the wallet.- Throws:
GenericRpcException- See Also:
- importprivkey
-
importAddress
public java.lang.Object importAddress(java.lang.String address, java.lang.String label, boolean rescan) throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe importaddress RPC adds an address or pubkey script to the wallet without the associated private key, allowing you to watch for transactions affecting that address or pubkey script without being able to spend any of its outputs.- Specified by:
importAddressin interfaceBitcoindRpcClient- Parameters:
address- Either a P2PKH or P2SH address encoded in base58check, or a pubkey script encoded as hexlabel- An account name into which the address should be placed.rescan- Set to true (the default) to rescan the entire local block database- Returns:
- Null on success
- Throws:
GenericRpcException- See Also:
- importaddress [TODO] Should this really return Object?
-
listAccounts
public java.util.Map<java.lang.String,java.lang.Number> listAccounts() throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe listaccounts RPC lists accounts and their balances.- Specified by:
listAccountsin interfaceBitcoindRpcClient- Returns:
- Map that has account names as keys, account balances as values
- Throws:
GenericRpcException- See Also:
- listaccounts
-
listAccounts
public java.util.Map<java.lang.String,java.lang.Number> listAccounts(int minConf) throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe listaccounts RPC lists accounts and their balances.- Specified by:
listAccountsin interfaceBitcoindRpcClient- Parameters:
minConf- The minimum number of confirmations an externally-generated transaction must have before it is counted towards the balance.- Returns:
- Map that has account names as keys, account balances as values
- Throws:
GenericRpcException- See Also:
- listaccounts
-
listAccounts
public java.util.Map<java.lang.String,java.lang.Number> listAccounts(int minConf, boolean watchonly) throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe listaccounts RPC lists accounts and their balances.- Specified by:
listAccountsin interfaceBitcoindRpcClient- Parameters:
minConf- The minimum number of confirmations an externally-generated transaction must have before it is counted towards the balance.watchonly- Include balances in watch-only addresses.- Returns:
- Map that has account names as keys, account balances as values
- Throws:
GenericRpcException- See Also:
- listaccounts
-
listLockUnspent
public java.util.List<BitcoindRpcClient.LockedUnspent> listLockUnspent()
Description copied from interface:BitcoindRpcClientThe listlockunspent RPC returns a list of temporarily unspendable (locked) outputs.- Specified by:
listLockUnspentin interfaceBitcoindRpcClient- See Also:
- listlockunspent
-
listReceivedByAddress
public java.util.List<BitcoindRpcClient.ReceivedAddress> listReceivedByAddress() throws GenericRpcException
Description copied from interface:BitcoindRpcClientThe listreceivedbyaddress RPC lists the total number of bitcoins received by each address.- Specified by:
listReceivedByAddressin interfaceBitcoindRpcClient- Returns:
- An array containing objects each describing a particular address
- Throws:
GenericRpcException- See Also:
- listreceivedbyaddress
-
listReceivedByAddress
public java.util.List<BitcoindRpcClient.ReceivedAddress> listReceivedByAddress(int minConf) throws GenericRpcException
Description copied from interface:BitcoindRpcClientThe listreceivedbyaddress RPC lists the total number of bitcoins received by each address.- Specified by:
listReceivedByAddressin interfaceBitcoindRpcClient- Parameters:
minConf- The minimum number of confirmations an externally-generated transaction must have before it is counted towards the balance.- Returns:
- An array containing objects each describing a particular address
- Throws:
GenericRpcException- See Also:
- listreceivedbyaddress
-
listReceivedByAddress
public java.util.List<BitcoindRpcClient.ReceivedAddress> listReceivedByAddress(int minConf, boolean includeEmpty) throws GenericRpcException
Description copied from interface:BitcoindRpcClientThe listreceivedbyaddress RPC lists the total number of bitcoins received by each address.- Specified by:
listReceivedByAddressin interfaceBitcoindRpcClient- Parameters:
minConf- The minimum number of confirmations an externally-generated transaction must have before it is counted towards the balance.includeEmpty- Set to true to display accounts which have never received a payment.- Returns:
- An array containing objects each describing a particular address
- Throws:
GenericRpcException- See Also:
- listreceivedbyaddress
-
listSinceBlock
public BitcoindRpcClient.TransactionsSinceBlock listSinceBlock() throws GenericRpcException
Description copied from interface:BitcoindRpcClientThe listsinceblock RPC gets all transactions affecting the wallet which have occurred since a particular block, plus the header hash of a block at a particular depth.- Specified by:
listSinceBlockin interfaceBitcoindRpcClient- Returns:
- An object containing an array of transactions and the lastblock field
- Throws:
GenericRpcException- See Also:
- listsinceblock
-
listSinceBlock
public BitcoindRpcClient.TransactionsSinceBlock listSinceBlock(java.lang.String blockHash) throws GenericRpcException
Description copied from interface:BitcoindRpcClientThe listsinceblock RPC gets all transactions affecting the wallet which have occurred since a particular block, plus the header hash of a block at a particular depth.- Specified by:
listSinceBlockin interfaceBitcoindRpcClient- Parameters:
blockHash- The hash of a block header encoded as hex in RPC byte order.- Returns:
- An object containing an array of transactions and the lastblock field
- Throws:
GenericRpcException- See Also:
- listsinceblock
-
listSinceBlock
public BitcoindRpcClient.TransactionsSinceBlock listSinceBlock(java.lang.String blockHash, int targetConfirmations) throws GenericRpcException
Description copied from interface:BitcoindRpcClientThe listsinceblock RPC gets all transactions affecting the wallet which have occurred since a particular block, plus the header hash of a block at a particular depth.- Specified by:
listSinceBlockin interfaceBitcoindRpcClient- Parameters:
blockHash- The hash of a block header encoded as hex in RPC byte order.targetConfirmations- Sets the lastblock field of the results to the header hash of a block with this many confirmations.- Returns:
- An object containing an array of transactions and the lastblock field
- Throws:
GenericRpcException- See Also:
- listsinceblock
-
listSinceBlock
public BitcoindRpcClient.TransactionsSinceBlock listSinceBlock(java.lang.String blockHash, int targetConfirmations, boolean includeWatchOnly) throws GenericRpcException
Description copied from interface:BitcoindRpcClientThe listsinceblock RPC gets all transactions affecting the wallet which have occurred since a particular block, plus the header hash of a block at a particular depth.- Specified by:
listSinceBlockin interfaceBitcoindRpcClient- Parameters:
blockHash- The hash of a block header encoded as hex in RPC byte order.targetConfirmations- Sets the lastblock field of the results to the header hash of a block with this many confirmations.includeWatchOnly- Include transactions to watch-only addresses- Returns:
- An object containing an array of transactions and the lastblock field
- Throws:
GenericRpcException- See Also:
- listsinceblock, Bitcoin Core Documentation for listsinceblock
-
listTransactions
public java.util.List<BitcoindRpcClient.Transaction> listTransactions() throws GenericRpcException
Description copied from interface:BitcoindRpcClientThe listtransactions RPC returns the most recent transactions that affect the wallet.- Specified by:
listTransactionsin interfaceBitcoindRpcClient- Returns:
- An array containing objects, with each object describing a payment or internal accounting entry (not a transaction).
- Throws:
GenericRpcException- See Also:
- listtransactions
-
listTransactions
public java.util.List<BitcoindRpcClient.Transaction> listTransactions(java.lang.String account) throws GenericRpcException
Description copied from interface:BitcoindRpcClientThe listtransactions RPC returns the most recent transactions that affect the wallet.- Specified by:
listTransactionsin interfaceBitcoindRpcClient- Parameters:
account- The name of an account to get transactinos from (deprecated).- Returns:
- An array containing objects, with each object describing a payment or internal accounting entry (not a transaction).
- Throws:
GenericRpcException- See Also:
- listtransactions
-
listTransactions
public java.util.List<BitcoindRpcClient.Transaction> listTransactions(java.lang.String account, int count) throws GenericRpcException
Description copied from interface:BitcoindRpcClientThe listtransactions RPC returns the most recent transactions that affect the wallet.- Specified by:
listTransactionsin interfaceBitcoindRpcClient- Parameters:
account- The name of an account to get transactinos from (deprecated).count- The number of the most recent transactions to list.- Returns:
- An array containing objects, with each object describing a payment or internal accounting entry (not a transaction).
- Throws:
GenericRpcException- See Also:
- listtransactions
-
listTransactions
public java.util.List<BitcoindRpcClient.Transaction> listTransactions(java.lang.String account, int count, int skip) throws GenericRpcException
Description copied from interface:BitcoindRpcClientThe listtransactions RPC returns the most recent transactions that affect the wallet.- Specified by:
listTransactionsin interfaceBitcoindRpcClient- Parameters:
account- The name of an account to get transactinos from (deprecated).count- The number of the most recent transactions to list.skip- The number of the most recent transactions which should not be returned.- Returns:
- An array containing objects, with each object describing a payment or internal accounting entry (not a transaction).
- Throws:
GenericRpcException- See Also:
- listtransactions
-
listUnspent
public java.util.List<BitcoindRpcClient.Unspent> listUnspent() throws GenericRpcException
Description copied from interface:BitcoindRpcClientThe listunspent RPC returns an array of unspent transaction outputs belonging to this wallet.- Specified by:
listUnspentin interfaceBitcoindRpcClient- Returns:
- An array of objects each describing an unspent output.
- Throws:
GenericRpcException- See Also:
- Developer reference documentation, Bitcoin Core API documentation
-
listUnspent
public java.util.List<BitcoindRpcClient.Unspent> listUnspent(int minConf) throws GenericRpcException
Description copied from interface:BitcoindRpcClientThe listunspent RPC returns an array of unspent transaction outputs belonging to this wallet.- Specified by:
listUnspentin interfaceBitcoindRpcClient- Parameters:
minConf- The minimum number of confirmations the transaction containing an output must have in order to be returned.- Returns:
- An array of objects each describing an unspent output.
- Throws:
GenericRpcException- See Also:
- listunspent
-
listUnspent
public java.util.List<BitcoindRpcClient.Unspent> listUnspent(int minConf, int maxConf) throws GenericRpcException
Description copied from interface:BitcoindRpcClientThe listunspent RPC returns an array of unspent transaction outputs belonging to this wallet.- Specified by:
listUnspentin interfaceBitcoindRpcClient- Parameters:
minConf- The minimum number of confirmations the transaction containing an output must have in order to be returned.maxConf- The maximum number of confirmations the transaction containing an output may have in order to be returned.- Returns:
- An array of objects each describing an unspent output.
- Throws:
GenericRpcException- See Also:
- listunspent
-
listUnspent
public java.util.List<BitcoindRpcClient.Unspent> listUnspent(int minConf, int maxConf, java.lang.String... addresses) throws GenericRpcException
Description copied from interface:BitcoindRpcClientThe listunspent RPC returns an array of unspent transaction outputs belonging to this wallet.- Specified by:
listUnspentin interfaceBitcoindRpcClient- Parameters:
minConf- The minimum number of confirmations the transaction containing an output must have in order to be returned.maxConf- The maximum number of confirmations the transaction containing an output may have in order to be returned.addresses- Only outputs which pay an address in this array will be returned- Returns:
- An array of objects each describing an unspent output.
- Throws:
GenericRpcException- See Also:
- listunspent
-
lockUnspent
public boolean lockUnspent(boolean unlock, java.lang.String txid, int vout) throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe lockunspent RPC temporarily locks or unlocks specified transaction outputs. A locked transaction output will not be chosen by automatic coin selection when spending bitcoins.- Specified by:
lockUnspentin interfaceBitcoindRpcClient- Parameters:
unlock- Set to false to lock the outputs specified in the following parameter. Set to true to unlock the outputs specified.txid- The TXID of the transaction containing the output to lock or unlock, encoded as hex.vout- The output index number (vout) of the output to lock or unlock.- Returns:
- true if successful.
- Throws:
GenericRpcException- See Also:
- lockunspent
-
move
public boolean move(java.lang.String fromAccount, java.lang.String toAddress, java.math.BigDecimal amount) throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe move RPC moves a specified amount from one account in your wallet to another using an off-block-chain transaction.- Specified by:
movein interfaceBitcoindRpcClient- Parameters:
fromAccount- The name of the account to move the funds fromtoAddress- The name of the account to move the funds toamount- The amount of bitcoins to move- Throws:
GenericRpcException- See Also:
- move
-
move
public boolean move(java.lang.String fromAccount, java.lang.String toAddress, java.math.BigDecimal amount, java.lang.String comment) throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe move RPC moves a specified amount from one account in your wallet to another using an off-block-chain transaction.- Specified by:
movein interfaceBitcoindRpcClient- Parameters:
fromAccount- The name of the account to move the funds fromtoAddress- The name of the account to move the funds toamount- The amount of bitcoins to movecomment- A comment to assign to this move payment- Throws:
GenericRpcException- See Also:
- move
-
move
public boolean move(java.lang.String fromAccount, java.lang.String toAddress, java.math.BigDecimal amount, int minConf) throws GenericRpcException- Specified by:
movein interfaceBitcoindRpcClient- Throws:
GenericRpcException- See Also:
- move
-
move
public boolean move(java.lang.String fromAccount, java.lang.String toAddress, java.math.BigDecimal amount, int minConf, java.lang.String comment) throws GenericRpcException- Specified by:
movein interfaceBitcoindRpcClient- Throws:
GenericRpcException- See Also:
- move
-
sendFrom
public java.lang.String sendFrom(java.lang.String fromAccount, java.lang.String toAddress, java.math.BigDecimal amount) throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe sendfrom RPC spends an amount from a local account to a bitcoin address.- Specified by:
sendFromin interfaceBitcoindRpcClient- Parameters:
fromAccount- The name of the account from which the bitcoins should be spent.toAddress- A P2PKH or P2SH address to which the bitcoins should be sentamount- The amount to spend in bitcoins.- Returns:
- The TXID of the sent transaction, encoded as hex in RPC byte order
- Throws:
GenericRpcException- See Also:
- sendfrom
-
sendFrom
public java.lang.String sendFrom(java.lang.String fromAccount, java.lang.String toAddress, java.math.BigDecimal amount, int minConf) throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe sendfrom RPC spends an amount from a local account to a bitcoin address.- Specified by:
sendFromin interfaceBitcoindRpcClient- Parameters:
fromAccount- The name of the account from which the bitcoins should be spent.toAddress- A P2PKH or P2SH address to which the bitcoins should be sentamount- The amount to spend in bitcoins.minConf- The minimum number of confirmations an incoming transaction must have for its outputs to be credited to this account’s balance.- Returns:
- The TXID of the sent transaction, encoded as hex in RPC byte order
- Throws:
GenericRpcException- See Also:
- sendfrom
-
sendFrom
public java.lang.String sendFrom(java.lang.String fromAccount, java.lang.String toAddress, java.math.BigDecimal amount, int minConf, java.lang.String comment) throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe sendfrom RPC spends an amount from a local account to a bitcoin address.- Specified by:
sendFromin interfaceBitcoindRpcClient- Parameters:
fromAccount- The name of the account from which the bitcoins should be spent.toAddress- A P2PKH or P2SH address to which the bitcoins should be sentamount- The amount to spend in bitcoins.minConf- The minimum number of confirmations an incoming transaction must have for its outputs to be credited to this account’s balance.comment- A locally-stored (not broadcast) comment assigned to this transaction.- Returns:
- The TXID of the sent transaction, encoded as hex in RPC byte order
- Throws:
GenericRpcException- See Also:
- sendfrom
-
sendFrom
public java.lang.String sendFrom(java.lang.String fromAccount, java.lang.String toAddress, java.math.BigDecimal amount, int minConf, java.lang.String comment, java.lang.String commentTo) throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe sendfrom RPC spends an amount from a local account to a bitcoin address.- Specified by:
sendFromin interfaceBitcoindRpcClient- Parameters:
fromAccount- The name of the account from which the bitcoins should be spent.toAddress- A P2PKH or P2SH address to which the bitcoins should be sentamount- The amount to spend in bitcoins.minConf- The minimum number of confirmations an incoming transaction must have for its outputs to be credited to this account’s balance.comment- A locally-stored (not broadcast) comment assigned to this transaction.commentTo- A locally-stored (not broadcast) comment assigned to this transaction- Returns:
- The TXID of the sent transaction, encoded as hex in RPC byte order
- Throws:
GenericRpcException- See Also:
- sendfrom
-
sendRawTransaction
public java.lang.String sendRawTransaction(java.lang.String hex) throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe sendrawtransaction RPC validates a transaction and broadcasts it to the peer-to-peer network.- Specified by:
sendRawTransactionin interfaceBitcoindRpcClient- Parameters:
hex- The serialized transaction to broadcast encoded as hex- Returns:
- If the transaction was accepted by the node for broadcast, this will be the TXID of the transaction encoded as hex in RPC byte order.
- Throws:
GenericRpcException- See Also:
- sendrawtransaction
-
sendToAddress
public java.lang.String sendToAddress(java.lang.String toAddress, java.math.BigDecimal amount) throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe sendtoaddress RPC spends an amount to a given address.- Specified by:
sendToAddressin interfaceBitcoindRpcClient- Parameters:
toAddress- A P2PKH or P2SH address to which the bitcoins should be sentamount- The amount to spent in bitcoins- Returns:
- The TXID of the sent transaction, encoded as hex in RPC byte order
- Throws:
GenericRpcException- See Also:
- sendtoaddress
-
sendToAddress
public java.lang.String sendToAddress(java.lang.String toAddress, java.math.BigDecimal amount, java.lang.String comment) throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe sendtoaddress RPC spends an amount to a given address.- Specified by:
sendToAddressin interfaceBitcoindRpcClient- Parameters:
toAddress- A P2PKH or P2SH address to which the bitcoins should be sentamount- The amount to spent in bitcoinscomment- A locally-stored (not broadcast) comment assigned to this transaction.- Returns:
- The TXID of the sent transaction, encoded as hex in RPC byte order
- Throws:
GenericRpcException- See Also:
- sendtoaddress
-
sendToAddress
public java.lang.String sendToAddress(java.lang.String toAddress, java.math.BigDecimal amount, java.lang.String comment, java.lang.String commentTo) throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe sendtoaddress RPC spends an amount to a given address.- Specified by:
sendToAddressin interfaceBitcoindRpcClient- Parameters:
toAddress- A P2PKH or P2SH address to which the bitcoins should be sentamount- The amount to spent in bitcoinscomment- A locally-stored (not broadcast) comment assigned to this transaction.commentTo- A locally-stored (not broadcast) comment assigned to this transaction- Returns:
- The TXID of the sent transaction, encoded as hex in RPC byte order
- Throws:
GenericRpcException- See Also:
- sendtoaddress
-
signRawTransaction
@Deprecated public java.lang.String signRawTransaction(java.lang.String hex) throws GenericRpcExceptionDeprecated.- Throws:
GenericRpcException
-
signRawTransaction
@Deprecated public java.lang.String signRawTransaction(java.lang.String hex, java.util.List<? extends BitcoindRpcClient.TxInput> inputs, java.util.List<java.lang.String> privateKeys) throws GenericRpcExceptionDeprecated.Description copied from interface:BitcoindRpcClientThe signrawtransaction RPC signs a transaction in the serialized transaction format using private keys stored in the wallet or provided in the call.- Specified by:
signRawTransactionin interfaceBitcoindRpcClient- Parameters:
hex- The transaction to sign as a serialized transactioninputs- The previous outputs being spent by this transactionprivateKeys- An array holding private keys.- Returns:
- The results of the signature
- Throws:
GenericRpcException- See Also:
- signrawtransaction
-
signRawTransaction
@Deprecated public java.lang.String signRawTransaction(java.lang.String hex, java.util.List<? extends BitcoindRpcClient.TxInput> inputs, java.util.List<java.lang.String> privateKeys, java.lang.String sigHashType)Deprecated.
-
signRawTransactionWithKey
public BitcoindRpcClient.SignedRawTransaction signRawTransactionWithKey(java.lang.String hex, java.util.List<java.lang.String> privateKeys, java.util.List<? extends BitcoindRpcClient.TxInput> prevTxs, SignatureHashType sigHashType)
Description copied from interface:BitcoindRpcClientThe signrawtransactionwithkey RPC sign inputs for raw transaction (serialized, hex-encoded).- Specified by:
signRawTransactionWithKeyin interfaceBitcoindRpcClient- Parameters:
hex- The transaction hex stringprivateKeys- List of base58-encoded private keys for signingprevTxs- List of previous transaction outputs that this transaction depends on but may not yet be in the block chain (optional)sigHashType- The signature hash type (optional, default = ALL)- Returns:
- The results of the signature
- See Also:
- Bitcoin Core Documentation for signrawtransactionwithkey
-
decodeRawTransaction
public BitcoindRpcClient.RawTransaction decodeRawTransaction(java.lang.String hex) throws GenericRpcException
- Throws:
GenericRpcException
-
validateAddress
public BitcoindRpcClient.AddressValidationResult validateAddress(java.lang.String address) throws GenericRpcException
Description copied from interface:BitcoindRpcClientThe validateaddress RPC returns information about the given Bitcoin address.- Specified by:
validateAddressin interfaceBitcoindRpcClient- Parameters:
address- The P2PKH or P2SH address to validate encoded in base58check format- Returns:
- Information about the address
- Throws:
GenericRpcException- See Also:
- validateaddress
-
generate
@Deprecated public java.util.List<java.lang.String> generate(int numBlocks) throws BitcoinRPCExceptionDeprecated.Description copied from interface:BitcoindRpcClientThe generate RPC nearly instantly generates blocks.- Specified by:
generatein interfaceBitcoindRpcClient- Parameters:
numBlocks- The number of blocks to generate.- Returns:
- An array containing the block header hashes of the generated blocks
- Throws:
BitcoinRPCException- See Also:
- generate
-
generate
@Deprecated public java.util.List<java.lang.String> generate(int numBlocks, long maxTries) throws BitcoinRPCExceptionDeprecated.Description copied from interface:BitcoindRpcClientThe generate RPC nearly instantly generates blocks.- Specified by:
generatein interfaceBitcoindRpcClient- Parameters:
numBlocks- The number of blocks to generate.maxTries- The maximum number of iterations that are tried to create the requested number of blocks.- Returns:
- An array containing the block header hashes of the generated blocks
- Throws:
BitcoinRPCException- See Also:
- generate
-
generateToAddress
public java.util.List<java.lang.String> generateToAddress(int numBlocks, java.lang.String address) throws BitcoinRPCExceptionDescription copied from interface:BitcoindRpcClientThe generatetoaddress RPC mines blocks immediately to a specified address.- Specified by:
generateToAddressin interfaceBitcoindRpcClient- Parameters:
numBlocks- The number of blocks to generate.address- The address to send the newly generated Bitcoin to- Throws:
BitcoinRPCException- See Also:
- generatetoaddress
-
generateToAddress
public java.util.List<java.lang.String> generateToAddress(int numBlocks, java.lang.String address, long maxTries) throws BitcoinRPCExceptionDescription copied from interface:BitcoindRpcClientThe generatetoaddress RPC mines blocks immediately to a specified address.- Specified by:
generateToAddressin interfaceBitcoindRpcClient- Parameters:
numBlocks- The number of blocks to generate.address- The address to send the newly generated Bitcoin tomaxTries- The maximum number of iterations that are tried to create the requested number of blocks.- Throws:
BitcoinRPCException- See Also:
- generatetoaddress
-
estimateFee
public java.math.BigDecimal estimateFee(int nBlocks) throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe estimatefee RPC estimates the transaction fee per kilobyte that needs to be paid for a transaction to be included within a certain number of blocks.- Specified by:
estimateFeein interfaceBitcoindRpcClient- Parameters:
nBlocks- The maximum number of blocks a transaction should have to wait before it is predicted to be included in a block.- Returns:
- The estimated fee the transaction should pay in order to be included within the specified number of blocks.
- Throws:
GenericRpcException- See Also:
- estimatefee
-
invalidateBlock
public void invalidateBlock(java.lang.String hash) throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientPermanently marks a block as invalid, as if it violated a consensus rule.- Specified by:
invalidateBlockin interfaceBitcoindRpcClient- Parameters:
hash- the hash of the block to mark as invalid [TODO] Add to https://bitcoin.org/en/developer-reference- Throws:
GenericRpcException
-
reconsiderBlock
public void reconsiderBlock(java.lang.String hash) throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientRemoves invalidity status of a block and its descendants, reconsider them for activation. This can be used to undo the effects of invalidateblock.- Specified by:
reconsiderBlockin interfaceBitcoindRpcClient- Parameters:
hash- The hash of the block to reconsider [TODO] Add to https://bitcoin.org/en/developer-reference- Throws:
GenericRpcException
-
getPeerInfo
public java.util.List<BitcoindRpcClient.PeerInfoResult> getPeerInfo() throws GenericRpcException
Description copied from interface:BitcoindRpcClientThe getpeerinfo RPC returns data about each connected network node.- Specified by:
getPeerInfoin interfaceBitcoindRpcClient- Returns:
- An array of objects each describing one connected node.
- Throws:
GenericRpcException- See Also:
- getpeerinfo
-
stop
public void stop()
Description copied from interface:BitcoindRpcClientThe stop RPC safely shuts down the Bitcoin Core server.- Specified by:
stopin interfaceBitcoindRpcClient- See Also:
- stop
-
getRawChangeAddress
public java.lang.String getRawChangeAddress() throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe getrawchangeaddress RPC returns a new Bitcoin address for receiving change. This is for use with raw transactions, not normal use.- Specified by:
getRawChangeAddressin interfaceBitcoindRpcClient- Returns:
- A P2PKH address which has not previously been returned by this RPC.
- Throws:
GenericRpcException- See Also:
- getrawchangeaddress
-
getConnectionCount
public long getConnectionCount() throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe getconnectioncount RPC returns the number of connections to other nodes.- Specified by:
getConnectionCountin interfaceBitcoindRpcClient- Returns:
- The total number of connections to other nodes (both inbound and outbound)
- Throws:
GenericRpcException- See Also:
- getconnectioncount
-
getUnconfirmedBalance
public java.math.BigDecimal getUnconfirmedBalance() throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe getunconfirmedbalance RPC returns the wallet’s total unconfirmed balance.- Specified by:
getUnconfirmedBalancein interfaceBitcoindRpcClient- Returns:
- The total number of bitcoins paid to this wallet in unconfirmed transactions
- Throws:
GenericRpcException- See Also:
- getunconfirmedbalance
-
getDifficulty
public java.math.BigDecimal getDifficulty() throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe getdifficulty RPC- Specified by:
getDifficultyin interfaceBitcoindRpcClient- Returns:
- The difficulty of creating a block with the same target threshold (nBits) as the highest-height block in the local best block chain.
- Throws:
GenericRpcException- See Also:
- getdifficulty
-
getNetTotals
public BitcoindRpcClient.NetTotals getNetTotals() throws GenericRpcException
Description copied from interface:BitcoindRpcClientThe getnettotals RPC returns information about network traffic, including bytes in, bytes out, and the current time.- Specified by:
getNetTotalsin interfaceBitcoindRpcClient- Returns:
- An object containing information about the node’s network totals
- Throws:
GenericRpcException- See Also:
- getnettotals
-
decodeScript
public BitcoindRpcClient.DecodedScript decodeScript(java.lang.String hex) throws GenericRpcException
Description copied from interface:BitcoindRpcClientThe decodescript RPC decodes a hex-encoded P2SH redeem script.- Specified by:
decodeScriptin interfaceBitcoindRpcClient- Parameters:
hex- The redeem script to decode as a hex-encoded serialized script- Returns:
- An object describing the decoded script, or JSON null if the script could not be decoded
- Throws:
GenericRpcException- See Also:
- decodescript
-
ping
public void ping() throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe ping RPC sends a P2P ping message to all connected nodes to measure ping time. Results are provided by the getpeerinfo RPC pingtime and pingwait fields as decimal seconds.- Specified by:
pingin interfaceBitcoindRpcClient- Throws:
GenericRpcException- See Also:
- ping
-
getNetworkHashPs
public java.math.BigDecimal getNetworkHashPs() throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe getnetworkhashps RPC returns the estimated current or historical network hashes per second based on the last n blocks.- Specified by:
getNetworkHashPsin interfaceBitcoindRpcClient- Returns:
- The estimated number of hashes per second based on the parameters provided.
- Throws:
GenericRpcException- See Also:
- getgenerate [TODO] Add parameters blocks, height
-
setTxFee
public boolean setTxFee(java.math.BigDecimal amount) throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe settxfee RPC sets the transaction fee per kilobyte paid by transactions created by this wallet.- Specified by:
setTxFeein interfaceBitcoindRpcClient- Parameters:
amount- The transaction fee to pay, in bitcoins, for each kilobyte of transaction data.- Throws:
GenericRpcException- See Also:
- settxfee
-
addNode
public void addNode(java.lang.String node, java.lang.String command) throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe addnode RPC attempts to add or remove a node from the addnode list, or to try a connection to a node once.- Specified by:
addNodein interfaceBitcoindRpcClient- Parameters:
node- example: "192.168.0.6:8333"command- must be either "add", "remove" or "onetry"- Throws:
GenericRpcException- See Also:
- addnode
-
backupWallet
public void backupWallet(java.lang.String destination) throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe backupwallet RPC safely copies wallet.dat to the specified file, which can be a directory or a path with filename.- Specified by:
backupWalletin interfaceBitcoindRpcClient- Parameters:
destination- A filename or directory name.- Throws:
GenericRpcException- See Also:
- backupwallet
-
signMessage
public java.lang.String signMessage(java.lang.String bitcoinAdress, java.lang.String message) throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe signmessage RPC signs a message with the private key of an address.- Specified by:
signMessagein interfaceBitcoindRpcClient- Parameters:
bitcoinAdress- A P2PKH address whose private key belongs to this walletmessage- The message to sign- Returns:
- The signature of the message, encoded in base64.
- Throws:
GenericRpcException- See Also:
- signmessage
-
dumpWallet
public void dumpWallet(java.lang.String filename) throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe dumpwallet RPC creates or overwrites a file with all wallet keys in a human-readable format.- Specified by:
dumpWalletin interfaceBitcoindRpcClient- Parameters:
filename- The file in which the wallet dump will be placed.- Throws:
GenericRpcException- See Also:
- dumpwallet
-
importWallet
public void importWallet(java.lang.String filename) throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe importwallet RPC imports private keys from a file in wallet dump file format (see the dumpwallet RPC). These keys will be added to the keys currently in the wallet.- Specified by:
importWalletin interfaceBitcoindRpcClient- Parameters:
filename- The file to import. The path is relative to Bitcoin Core’s working directory- Throws:
GenericRpcException- See Also:
- importwallet
-
keyPoolRefill
public void keyPoolRefill() throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe keypoolrefill RPC fills the cache of unused pre-generated keys (the keypool).- Specified by:
keyPoolRefillin interfaceBitcoindRpcClient- Throws:
GenericRpcException- See Also:
- keypoolrefill
-
keyPoolRefill
public void keyPoolRefill(long size) throws GenericRpcException- Throws:
GenericRpcException
-
getReceivedByAccount
public java.math.BigDecimal getReceivedByAccount(java.lang.String account) throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe getreceivedbyaccount RPC returns the total amount received by addresses in a particular account from transactions with the specified number of confirmations.- Specified by:
getReceivedByAccountin interfaceBitcoindRpcClient- Parameters:
account- The name of the account containing the addresses to get.- Returns:
- The number of bitcoins received by the account.
- Throws:
GenericRpcException- See Also:
- getreceivedbyaccount
-
getReceivedByAccount
public java.math.BigDecimal getReceivedByAccount(java.lang.String account, int minConf) throws GenericRpcException- Throws:
GenericRpcException
-
encryptWallet
public void encryptWallet(java.lang.String passPhrase) throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe encryptwallet RPC encrypts the wallet with a passphrase. This is only to enable encryption for the first time. After encryption is enabled, you will need to enter the passphrase to use private keys.- Specified by:
encryptWalletin interfaceBitcoindRpcClient- Parameters:
passPhrase- The passphrase to use for the encrypted wallet.- Throws:
GenericRpcException- See Also:
- encryptwallet
-
walletPassPhrase
public void walletPassPhrase(java.lang.String passPhrase, long timeOut) throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe walletpassphrase RPC stores the wallet decryption key in memory for the indicated number of seconds. Issuing the walletpassphrase command while the wallet is already unlocked will set a new unlock time that overrides the old one.- Specified by:
walletPassPhrasein interfaceBitcoindRpcClient- Parameters:
passPhrase- The passphrase that unlocks the wallettimeOut- The number of seconds after which the decryption key will be automatically deleted from memory- Throws:
GenericRpcException- See Also:
- walletpassphrase
-
verifyMessage
public boolean verifyMessage(java.lang.String bitcoinAddress, java.lang.String signature, java.lang.String message) throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientThe verifymessage RPC verifies a signed message.- Specified by:
verifyMessagein interfaceBitcoindRpcClient- Parameters:
bitcoinAddress- The P2PKH address corresponding to the private key which made the signature.signature- The signature created by the signer encoded as base-64 (the format output by the signmessage RPC)message- The message exactly as it was signed- Throws:
GenericRpcException- See Also:
- verifymessage
-
addMultiSigAddress
public BitcoindRpcClient.MultiSig addMultiSigAddress(int nRequired, java.util.List<java.lang.String> keyObject) throws GenericRpcException
Description copied from interface:BitcoindRpcClientThe addmultisigaddress RPC adds a P2SH multisig address to the wallet.- Specified by:
addMultiSigAddressin interfaceBitcoindRpcClient- Parameters:
nRequired- The minimum (m) number of signatures required to spend this m-of-n multisig scriptkeyObject- An array of strings with each string being a public key or address- Returns:
- The P2SH multisig address.
- Throws:
GenericRpcException- See Also:
- addmultisigaddress
-
addMultiSigAddress
public BitcoindRpcClient.MultiSig addMultiSigAddress(int nRequired, java.util.List<java.lang.String> keyObject, java.lang.String account) throws GenericRpcException
Description copied from interface:BitcoindRpcClientThe addmultisigaddress RPC adds a P2SH multisig address to the wallet.- Specified by:
addMultiSigAddressin interfaceBitcoindRpcClient- Parameters:
nRequired- The minimum (m) number of signatures required to spend this m-of-n multisig scriptkeyObject- An array of strings with each string being a public key or addressaccount- The account name in which the address should be stored.- Returns:
- The P2SH multisig address.
- Throws:
GenericRpcException- See Also:
- addmultisigaddress
-
verifyChain
public boolean verifyChain()
Description copied from interface:BitcoindRpcClientThe verifychain RPC verifies each entry in the local block chain database.- Specified by:
verifyChainin interfaceBitcoindRpcClient- See Also:
- verifychain [TODO] Add parameters checkLevel, numOfBlocks
-
verifyChain
public boolean verifyChain(int checklevel, int numblocks)
-
submitBlock
public void submitBlock(java.lang.String hexData)
Attempts to submit new block to network. The 'jsonparametersobject' parameter is currently ignored, therefore left out.- Specified by:
submitBlockin interfaceBitcoindRpcClient- Parameters:
hexData-- See Also:
- submitblock
-
getTransaction
public BitcoindRpcClient.Transaction getTransaction(java.lang.String txId)
Description copied from interface:BitcoindRpcClientThe gettransaction RPC gets detailed information about an in-wallet transaction.- Specified by:
getTransactionin interfaceBitcoindRpcClient- Parameters:
txId- The TXID of the transaction to get details about.- See Also:
- gettransaction
-
getTxOut
public BitcoindRpcClient.TxOut getTxOut(java.lang.String txId, long vout) throws GenericRpcException
Description copied from interface:BitcoindRpcClientThe gettxout RPC returns details about an unspent transaction output (UTXO).- Specified by:
getTxOutin interfaceBitcoindRpcClient- Parameters:
txId- The TXID of the transaction containing the output to get, encoded as hex in RPC byte ordervout- The output index number (vout) of the output within the transaction- Returns:
- Information about the output.
- Throws:
GenericRpcException- See Also:
- gettxout
-
getTxOut
public BitcoindRpcClient.TxOut getTxOut(java.lang.String txId, long vout, boolean includemempool) throws GenericRpcException
- Throws:
GenericRpcException
-
getAddressBalance
public BitcoindRpcClient.AddressBalance getAddressBalance(java.lang.String address)
-
getAddressUtxo
public java.util.List<BitcoindRpcClient.AddressUtxo> getAddressUtxo(java.lang.String address)
-
scanTxOutSet
public BitcoindRpcClient.UtxoSet scanTxOutSet(java.util.List<BitcoindRpcClient.ScanObject> scanObjects) throws GenericRpcException
Description copied from interface:BitcoindRpcClientThe scantxoutset RPC scans the unspent transaction output set for entries that match certain output descriptors.Examples of output descriptors are:
- addr(<address>}) Outputs whose scriptPubKey corresponds to the specified address (does not include P2PK)
- raw(<hex script>) Outputs whose scriptPubKey equals the specified hex scripts
- combo(<pubkey>) P2PK, P2PKH, P2WPKH, and P2SH-P2WPKH outputs for the given pubkey
- pkh(<pubkey>) P2PKH outputs for the given pubkey
- sh(multi(<n>,<pubkey>,<pubkey>,...)) P2SH-multisig outputs for the given threshold and pubkeys
either refers to a fixed public key in hexadecimal notation, or to an xpub/xprv optionally followed by one or more path elements separated by "/", and optionally ending in "/*" (unhardened), or "/*'" or "/*h" (hardened) to specify all unhardened or hardened child keys. In the latter case, a range needs to be specified by below if different from 1000. For more information on output descriptors, see the documentation in the doc/descriptors.md file. - Specified by:
scanTxOutSetin interfaceBitcoindRpcClient- Parameters:
scanObjects- Output descriptors- Returns:
- Throws:
GenericRpcException- See Also:
- scantxoutset
-
scanTxOutSetStatus
public java.lang.Integer scanTxOutSetStatus() throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientReturns the status for progress report (in %) of the current scan.- Specified by:
scanTxOutSetStatusin interfaceBitcoindRpcClient- Returns:
- Throws:
GenericRpcException- See Also:
BitcoindRpcClient.scanTxOutSet(List)
-
abortScanTxOutSet
public java.lang.Boolean abortScanTxOutSet() throws GenericRpcExceptionDescription copied from interface:BitcoindRpcClientAborts the current scan- Specified by:
abortScanTxOutSetin interfaceBitcoindRpcClient- Returns:
- true when abort was successful
- Throws:
GenericRpcException- See Also:
BitcoindRpcClient.scanTxOutSet(List)
-
scanTxOutSetAddresses
public BitcoindRpcClient.UtxoSet scanTxOutSetAddresses(java.util.List<java.lang.String> addresses) throws GenericRpcException
Description copied from interface:BitcoindRpcClientConvenience method for retrieving UTXO SET for a list of addresses. (Outputs whose scriptPubKey corresponds to the specified address (does not include P2PK))- Specified by:
scanTxOutSetAddressesin interfaceBitcoindRpcClient- Returns:
- Throws:
GenericRpcException- See Also:
BitcoindRpcClient.scanTxOutSet(List)
-
scanTxOutSetPubKey
public BitcoindRpcClient.UtxoSet scanTxOutSetPubKey(java.lang.String pubkey, int range) throws GenericRpcException
Description copied from interface:BitcoindRpcClientConvenience method for retrieving UTXO SET (P2PK, P2PKH, P2WPKH, and P2SH-P2WPKH outputs) for a given pubkey.either refers to a fixed public key in hexadecimal notation, or to an xpub/xprv optionally followed by one or more path elements separated by "/", and optionally ending in "/*" (unhardened), or "/*'" or "/*h" (hardened) to specify all unhardened or hardened child keys. - Specified by:
scanTxOutSetPubKeyin interfaceBitcoindRpcClient- Returns:
- Throws:
GenericRpcException- See Also:
BitcoindRpcClient.scanTxOutSet(List)
-
-