public interface BitcoindRpcClient
| Modifier and Type | Method and Description |
|---|---|
String |
addMultiSigAddress(int nRequired,
List<String> keyObject)
The addmultisigaddress RPC adds a P2SH multisig address to the wallet.
|
String |
addMultiSigAddress(int nRequired,
List<String> keyObject,
String account)
The addmultisigaddress RPC adds a P2SH multisig address to the wallet.
|
void |
addNode(String node,
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.
|
void |
backupWallet(String destination)
The backupwallet RPC safely copies wallet.dat to the specified file, which can be a directory or a path with filename.
|
BitcoindRpcClient.MultiSig |
createMultiSig(int nRequired,
List<String> keys)
The createmultisig RPC creates a P2SH multi-signature address.
|
String |
createRawTransaction(List<BitcoindRpcClient.TxInput> inputs,
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.DecodedScript |
decodeScript(String hex)
The decodescript RPC decodes a hex-encoded P2SH redeem script.
|
String |
dumpPrivKey(String address)
The dumpprivkey RPC returns the wallet-import-format (WIF) private key corresponding to an address.
|
void |
dumpWallet(String filename)
The dumpwallet RPC creates or overwrites a file with all wallet keys in a human-readable format.
|
void |
encryptWallet(String passPhrase)
The encryptwallet RPC encrypts the wallet with a passphrase.
|
List<String> |
generate(int numBlocks)
The generate RPC nearly instantly generates blocks.
|
List<String> |
generate(int numBlocks,
long maxTries)
The generate RPC nearly instantly generates blocks.
|
List<String> |
generateToAddress(int numBlocks,
String address)
The generatetoaddress RPC mines blocks immediately to a specified address.
|
String |
getAccount(String address)
The getaccount RPC returns the name of the account associated with the given address.
|
String |
getAccountAddress(String account)
The getaccountaddress RPC returns the current Bitcoin address for receiving payments to this account.
|
List<BitcoindRpcClient.NodeInfo> |
getAddedNodeInfo(boolean details,
String node)
The getaddednodeinfo RPC returns information about the given added node, or all added nodes (except onetry nodes).
|
BitcoindRpcClient.AddressBalance |
getAddressBalance(String address)
get the balance of specified address
PAY ATTENTION
This API only works on some bitcoind nodes which support addressindex option
satoshilabs/bitcoin is such a kind of these nodes
|
List<String> |
getAddressesByAccount(String account)
The getaddressesbyaccount RPC returns a list of every address assigned to a particular account.
|
List<BitcoindRpcClient.AddressUtxo> |
getAddressUtxo(String address)
get all the utxo list of a specified address
PAY ATTENTION
This API only works on some bitcoind nodes which support addressindex option
satoshilabs/bitcoin is such a kind of these nodes
|
BigDecimal |
getBalance()
The getbalance RPC gets the balance in decimal bitcoins for the default account.
|
BigDecimal |
getBalance(String account)
The getbalance RPC gets the balance in decimal bitcoins across all accounts or for a particular account.
|
BigDecimal |
getBalance(String account,
int minConf)
The getbalance RPC gets the balance in decimal bitcoins across all accounts or for a particular account.
|
String |
getBestBlockHash()
The getbestblockhash RPC returns the header hash of the most recent block on the best block chain.
|
BitcoindRpcClient.Block |
getBlock(int height)
Gets a block at the given height from the local block database.
|
BitcoindRpcClient.Block |
getBlock(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.BlockChainInfo |
getBlockChainInfo()
The getblockchaininfo RPC provides information about the current state of the block chain.
|
int |
getBlockCount()
The getblockcount RPC returns the number of blocks in the local best block chain.
|
String |
getBlockHash(int height)
The getblockhash RPC returns the header hash of a block at the given height in the local best block chain.
|
long |
getConnectionCount()
The getconnectioncount RPC returns the number of connections to other nodes.
|
BigDecimal |
getDifficulty()
The getdifficulty RPC
|
BigDecimal |
getEstimateFee(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.
|
BigDecimal |
getEstimatePriority(int nBlocks)
The estimatepriority RPC estimates the priority (coin age) that a transaction needs in order to be included within a certain number of blocks as a free high-priority transaction.
|
BitcoindRpcClient.SmartFeeResult |
getEstimateSmartFee(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.
|
boolean |
getGenerate()
The getgenerate RPC was removed in Bitcoin Core 0.13.0.
|
BitcoindRpcClient.Info |
getInfo()
The getinfo RPC prints various information about the node and the network.
|
BitcoindRpcClient.MiningInfo |
getMiningInfo()
The getmininginfo RPC returns various mining-related information.
|
BitcoindRpcClient.NetTotals |
getNetTotals()
The getnettotals RPC returns information about network traffic, including bytes in, bytes out, and the current time.
|
BigDecimal |
getNetworkHashPs()
The getnetworkhashps RPC returns the estimated current or historical network hashes per second based on the last n blocks.
|
BitcoindRpcClient.NetworkInfo |
getNetworkInfo()
The getnetworkinfo RPC returns information about the node’s connection to the network.
|
String |
getNewAddress()
The getnewaddress RPC returns a new Bitcoin address for receiving payments.
|
String |
getNewAddress(String account)
The getnewaddress RPC returns a new Bitcoin address for receiving payments.
|
String |
getNewAddress(String account,
String addressType)
The getnewaddress RPC returns a new Bitcoin address for receiving payments.
|
List<BitcoindRpcClient.PeerInfoResult> |
getPeerInfo()
The getpeerinfo RPC returns data about each connected network node.
|
String |
getRawBlock(String blockHash)
The getblock RPC gets a block with a particular header hash from the local block database as a serialized block.
|
String |
getRawChangeAddress()
The getrawchangeaddress RPC returns a new Bitcoin address for receiving change.
|
List<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.RawTransaction |
getRawTransaction(String txId)
The getrawtransaction RPC gets a hex-encoded serialized transaction or a JSON object describing the transaction.
|
String |
getRawTransactionHex(String txId)
The getrawtransaction RPC gets a hex-encoded serialized transaction.
|
BigDecimal |
getReceivedByAccount(String account)
The getreceivedbyaccount RPC returns the total amount received by addresses in a particular account from transactions with the specified number of confirmations.
|
BigDecimal |
getReceivedByAddress(String address)
The getreceivedbyaddress RPC returns the total amount received by the specified address in transactions with the specified number of confirmations.
|
BigDecimal |
getReceivedByAddress(String address,
int minConf)
The getreceivedbyaddress RPC returns the total amount received by the specified address in transactions with the specified number of confirmations.
|
BitcoindRpcClient.Transaction |
getTransaction(String txId)
The gettransaction RPC gets detailed information about an in-wallet transaction.
|
BitcoindRpcClient.TxOut |
getTxOut(String txId,
long vout)
The gettxout RPC returns details about an unspent transaction output (UTXO).
|
BitcoindRpcClient.TxOutSetInfo |
getTxOutSetInfo()
The gettxoutsetinfo RPC returns statistics about the confirmed unspent transaction output (UTXO) set.
|
BigDecimal |
getUnconfirmedBalance()
The getunconfirmedbalance RPC returns the wallet’s total unconfirmed balance.
|
BitcoindRpcClient.WalletInfo |
getWalletInfo()
The getwalletinfo RPC provides information about the wallet.
|
Object |
importAddress(String address,
String account,
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.
|
void |
importPrivKey(String bitcoinPrivKey)
The importprivkey RPC adds a private key to your wallet.
|
void |
importPrivKey(String bitcoinPrivKey,
String account)
The importprivkey RPC adds a private key to your wallet.
|
void |
importPrivKey(String bitcoinPrivKey,
String account,
boolean rescan)
The importprivkey RPC adds a private key to your wallet.
|
void |
importWallet(String filename)
The importwallet RPC imports private keys from a file in wallet dump file format (see the dumpwallet RPC).
|
void |
invalidateBlock(String blockHash)
Permanently marks a block as invalid, as if it violated a consensus rule.
|
void |
keyPoolRefill()
The keypoolrefill RPC fills the cache of unused pre-generated keys (the keypool).
|
Map<String,Number> |
listAccounts()
The listaccounts RPC lists accounts and their balances.
|
Map<String,Number> |
listAccounts(int minConf)
The listaccounts RPC lists accounts and their balances.
|
List<BitcoindRpcClient.ReceivedAddress> |
listReceivedByAddress()
The listreceivedbyaddress RPC lists the total number of bitcoins received by each address.
|
List<BitcoindRpcClient.ReceivedAddress> |
listReceivedByAddress(int minConf)
The listreceivedbyaddress RPC lists the total number of bitcoins received by each address.
|
List<BitcoindRpcClient.ReceivedAddress> |
listReceivedByAddress(int minConf,
boolean includeEmpty)
The listreceivedbyaddress RPC lists the total number of bitcoins received by each address.
|
BitcoindRpcClient.TransactionsSinceBlock |
listSinceBlock()
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.TransactionsSinceBlock |
listSinceBlock(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.TransactionsSinceBlock |
listSinceBlock(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.
|
List<BitcoindRpcClient.Transaction> |
listTransactions()
The listtransactions RPC returns the most recent transactions that affect the wallet.
|
List<BitcoindRpcClient.Transaction> |
listTransactions(String account)
The listtransactions RPC returns the most recent transactions that affect the wallet.
|
List<BitcoindRpcClient.Transaction> |
listTransactions(String account,
int count)
The listtransactions RPC returns the most recent transactions that affect the wallet.
|
List<BitcoindRpcClient.Transaction> |
listTransactions(String account,
int count,
int skip)
The listtransactions RPC returns the most recent transactions that affect the wallet.
|
List<BitcoindRpcClient.Unspent> |
listUnspent()
The listunspent RPC returns an array of unspent transaction outputs belonging to this wallet.
|
List<BitcoindRpcClient.Unspent> |
listUnspent(int minConf)
The listunspent RPC returns an array of unspent transaction outputs belonging to this wallet.
|
List<BitcoindRpcClient.Unspent> |
listUnspent(int minConf,
int maxConf)
The listunspent RPC returns an array of unspent transaction outputs belonging to this wallet.
|
List<BitcoindRpcClient.Unspent> |
listUnspent(int minConf,
int maxConf,
String... addresses)
The listunspent RPC returns an array of unspent transaction outputs belonging to this wallet.
|
boolean |
move(String fromAccount,
String toAccount,
BigDecimal amount)
The move RPC moves a specified amount from one account in your wallet to another using an off-block-chain transaction.
|
boolean |
move(String fromAccount,
String toAccount,
BigDecimal amount,
int minConf)
Deprecated.
|
boolean |
move(String fromAccount,
String toAccount,
BigDecimal amount,
int minConf,
String comment)
Deprecated.
|
boolean |
move(String fromAccount,
String toAccount,
BigDecimal amount,
String comment)
The move RPC moves a specified amount from one account in your wallet to another using an off-block-chain transaction.
|
void |
ping()
The ping RPC sends a P2P ping message to all connected nodes to measure ping time.
|
void |
reconsiderBlock(String blockHash)
Removes invalidity status of a block and its descendants, reconsider them for activation.
|
String |
sendFrom(String fromAccount,
String toAddress,
BigDecimal amount)
The sendfrom RPC spends an amount from a local account to a bitcoin address.
|
String |
sendFrom(String fromAccount,
String toAddress,
BigDecimal amount,
int minConf)
The sendfrom RPC spends an amount from a local account to a bitcoin address.
|
String |
sendFrom(String fromAccount,
String toAddress,
BigDecimal amount,
int minConf,
String comment)
The sendfrom RPC spends an amount from a local account to a bitcoin address.
|
String |
sendFrom(String fromAccount,
String toAddress,
BigDecimal amount,
int minConf,
String comment,
String commentTo)
The sendfrom RPC spends an amount from a local account to a bitcoin address.
|
String |
sendRawTransaction(String hex)
The sendrawtransaction RPC validates a transaction and broadcasts it to the peer-to-peer network.
|
String |
sendToAddress(String toAddress,
BigDecimal amount)
The sendtoaddress RPC spends an amount to a given address.
|
String |
sendToAddress(String toAddress,
BigDecimal amount,
String comment)
The sendtoaddress RPC spends an amount to a given address.
|
String |
sendToAddress(String toAddress,
BigDecimal amount,
String comment,
String commentTo)
The sendtoaddress RPC spends an amount to a given address.
|
void |
setGenerate(boolean doGenerate)
Deprecated.
|
boolean |
setTxFee(BigDecimal amount)
The settxfee RPC sets the transaction fee per kilobyte paid by transactions created by this wallet.
|
String |
signMessage(String adress,
String message)
The signmessage RPC signs a message with the private key of an address.
|
String |
signRawTransaction(String hex,
List<? extends BitcoindRpcClient.TxInput> inputs,
List<String> privateKeys)
The signrawtransaction RPC signs a transaction in the serialized transaction format using private keys stored in the wallet or provided in the call.
|
void |
stop()
The stop RPC safely shuts down the Bitcoin Core server.
|
void |
submitBlock(String hexData)
The submitblock RPC accepts a block, verifies it is a valid addition to the block chain, and broadcasts it to the network.
|
BitcoindRpcClient.AddressValidationResult |
validateAddress(String address)
The validateaddress RPC returns information about the given Bitcoin address.
|
boolean |
verifyChain()
The verifychain RPC verifies each entry in the local block chain database.
|
boolean |
verifyMessage(String address,
String signature,
String message)
The verifymessage RPC verifies a signed message.
|
void |
walletPassPhrase(String passPhrase,
long timeOut)
The walletpassphrase RPC stores the wallet decryption key in memory for the indicated number of seconds.
|
String createRawTransaction(List<BitcoindRpcClient.TxInput> inputs, List<BitcoindRpcClient.TxOutput> outputs) throws GenericRpcException
inputs - An array of objects, each one to be used as an input to the transactionoutputs - The addresses and amounts to payGenericRpcExceptionString dumpPrivKey(String address) throws GenericRpcException
address - The P2PKH address corresponding to the private key you want returned.GenericRpcExceptionString getAccount(String address) throws GenericRpcException
address - A P2PKH or P2SH Bitcoin address belonging either to a specific account or the default accountGenericRpcExceptionString getAccountAddress(String account) throws GenericRpcException
account - The name of an account.GenericRpcExceptionList<String> getAddressesByAccount(String account) throws GenericRpcException
account - The name of an account to get the balance for.GenericRpcExceptionBigDecimal getBalance() throws GenericRpcException
GenericRpcExceptionBigDecimal getBalance(String account) throws GenericRpcException
account - The name of an account to get the balance for.GenericRpcExceptionBigDecimal getBalance(String account, int minConf) throws GenericRpcException
account - The name of an account to get the balance for.minConf - The minimum number of confirmationsGenericRpcExceptionBitcoindRpcClient.Info getInfo() throws GenericRpcException
GenericRpcExceptionBitcoindRpcClient.MiningInfo getMiningInfo() throws GenericRpcException
GenericRpcExceptionBitcoindRpcClient.MultiSig createMultiSig(int nRequired, List<String> keys) throws GenericRpcException
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 addressGenericRpcExceptionBitcoindRpcClient.NetworkInfo getNetworkInfo() throws GenericRpcException
GenericRpcExceptionBitcoindRpcClient.TxOutSetInfo getTxOutSetInfo()
BitcoindRpcClient.WalletInfo getWalletInfo()
BitcoindRpcClient.Block getBlock(int height) throws GenericRpcException
getBlockHash(int) and getBlock(String).GenericRpcExceptionBitcoindRpcClient.Block getBlock(String blockHash) throws GenericRpcException
blockHash - The hash of the header of the block to get, encoded as hex in RPC byte orderGenericRpcExceptionString getRawBlock(String blockHash) throws GenericRpcException
blockHash - The hash of the header of the block to get, encoded as hex in RPC byte orderGenericRpcExceptionString getBlockHash(int height) throws GenericRpcException
height - The height of the block whose header hash should be returned.GenericRpcExceptionBitcoindRpcClient.BlockChainInfo getBlockChainInfo() throws GenericRpcException
GenericRpcExceptionint getBlockCount()
throws GenericRpcException
GenericRpcExceptionString getNewAddress() throws GenericRpcException
GenericRpcExceptionString getNewAddress(String account) throws GenericRpcException
GenericRpcExceptionString getNewAddress(String account, String addressType) throws GenericRpcException
GenericRpcExceptionList<String> getRawMemPool() throws GenericRpcException
GenericRpcExceptionString getBestBlockHash() throws GenericRpcException
GenericRpcExceptionBitcoindRpcClient.RawTransaction getRawTransaction(String txId) throws GenericRpcException
txId - The TXID of the transaction to get, encoded as hex in RPC byte orderGenericRpcExceptionString getRawTransactionHex(String txId) throws GenericRpcException
txId - The TXID of the transaction to get, encoded as hex in RPC byte orderGenericRpcExceptionBigDecimal getReceivedByAddress(String address) throws GenericRpcException
address - The address whose transactions should be talliedGenericRpcExceptionBigDecimal getReceivedByAddress(String address, int minConf) throws GenericRpcException
address - The address whose transactions should be talliedminConf - The minimum number of confirmationsGenericRpcExceptionvoid importPrivKey(String bitcoinPrivKey) throws GenericRpcException
bitcoinPrivKey - The private key to import into the wallet encoded in base58check using wallet import format (WIF)GenericRpcExceptionvoid importPrivKey(String bitcoinPrivKey, String account) throws GenericRpcException
bitcoinPrivKey - The private key to import into the wallet encoded in base58check using wallet import format (WIF)account - The name of an account to which transactions involving the key should be assigned.GenericRpcExceptionvoid importPrivKey(String bitcoinPrivKey, String account, boolean rescan) throws GenericRpcException
bitcoinPrivKey - The private key to import into the wallet encoded in base58check using wallet import format (WIF)account - 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.GenericRpcExceptionObject importAddress(String address, String account, boolean rescan) throws GenericRpcException
address - Either a P2PKH or P2SH address encoded in base58check, or a pubkey script encoded as hexaccount - An account name into which the address should be placed.rescan - Set to true (the default) to rescan the entire local block databaseGenericRpcExceptionMap<String,Number> listAccounts() throws GenericRpcException
GenericRpcExceptionMap<String,Number> listAccounts(int minConf) throws GenericRpcException
minConf - The minimum number of confirmations an externally-generated transaction must have before it is counted towards the balance.GenericRpcExceptionList<BitcoindRpcClient.ReceivedAddress> listReceivedByAddress() throws GenericRpcException
GenericRpcExceptionList<BitcoindRpcClient.ReceivedAddress> listReceivedByAddress(int minConf) throws GenericRpcException
minConf - The minimum number of confirmations an externally-generated transaction must have before it is counted towards the balance.GenericRpcExceptionList<BitcoindRpcClient.ReceivedAddress> listReceivedByAddress(int minConf, boolean includeEmpty) throws GenericRpcException
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.GenericRpcExceptionBitcoindRpcClient.TransactionsSinceBlock listSinceBlock() throws GenericRpcException
GenericRpcExceptionBitcoindRpcClient.TransactionsSinceBlock listSinceBlock(String blockHash) throws GenericRpcException
blockHash - The hash of a block header encoded as hex in RPC byte order.GenericRpcExceptionBitcoindRpcClient.TransactionsSinceBlock listSinceBlock(String blockHash, int targetConfirmations) throws GenericRpcException
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.GenericRpcExceptionList<BitcoindRpcClient.Transaction> listTransactions() throws GenericRpcException
GenericRpcExceptionList<BitcoindRpcClient.Transaction> listTransactions(String account) throws GenericRpcException
account - The name of an account to get transactinos from (deprecated).GenericRpcExceptionList<BitcoindRpcClient.Transaction> listTransactions(String account, int count) throws GenericRpcException
account - The name of an account to get transactinos from (deprecated).count - The number of the most recent transactions to list.GenericRpcExceptionList<BitcoindRpcClient.Transaction> listTransactions(String account, int count, int skip) throws GenericRpcException
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.GenericRpcExceptionList<BitcoindRpcClient.Unspent> listUnspent() throws GenericRpcException
GenericRpcExceptionList<BitcoindRpcClient.Unspent> listUnspent(int minConf) throws GenericRpcException
minConf - The minimum number of confirmations the transaction containing an output must have in order to be returned.GenericRpcExceptionList<BitcoindRpcClient.Unspent> listUnspent(int minConf, int maxConf) throws GenericRpcException
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.GenericRpcExceptionList<BitcoindRpcClient.Unspent> listUnspent(int minConf, int maxConf, String... addresses) throws GenericRpcException
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 returnedGenericRpcExceptionboolean move(String fromAccount, String toAccount, BigDecimal amount) throws GenericRpcException
fromAccount - The name of the account to move the funds fromtoAccount - The name of the account to move the funds toamount - The amount of bitcoins to moveGenericRpcExceptionboolean move(String fromAccount, String toAccount, BigDecimal amount, String comment) throws GenericRpcException
fromAccount - The name of the account to move the funds fromtoAccount - The name of the account to move the funds toamount - The amount of bitcoins to movecomment - A comment to assign to this move paymentGenericRpcExceptionboolean move(String fromAccount, String toAccount, BigDecimal amount, int minConf) throws GenericRpcException
GenericRpcExceptionboolean move(String fromAccount, String toAccount, BigDecimal amount, int minConf, String comment) throws GenericRpcException
GenericRpcExceptionString sendFrom(String fromAccount, String toAddress, BigDecimal amount) throws GenericRpcException
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.GenericRpcExceptionString sendFrom(String fromAccount, String toAddress, BigDecimal amount, int minConf) throws GenericRpcException
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.GenericRpcExceptionString sendFrom(String fromAccount, String toAddress, BigDecimal amount, int minConf, String comment) throws GenericRpcException
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.GenericRpcExceptionString sendFrom(String fromAccount, String toAddress, BigDecimal amount, int minConf, String comment, String commentTo) throws GenericRpcException
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 transactionGenericRpcExceptionString sendRawTransaction(String hex) throws GenericRpcException
hex - The serialized transaction to broadcast encoded as hexGenericRpcExceptionString sendToAddress(String toAddress, BigDecimal amount) throws GenericRpcException
toAddress - A P2PKH or P2SH address to which the bitcoins should be sentamount - The amount to spent in bitcoinsGenericRpcExceptionString sendToAddress(String toAddress, BigDecimal amount, String comment) throws GenericRpcException
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.GenericRpcExceptionString sendToAddress(String toAddress, BigDecimal amount, String comment, String commentTo) throws GenericRpcException
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 transactionGenericRpcExceptionString signRawTransaction(String hex, List<? extends BitcoindRpcClient.TxInput> inputs, List<String> privateKeys) throws GenericRpcException
hex - The transaction to sign as a serialized transactioninputs - The previous outputs being spent by this transactionprivateKeys - An array holding private keys.GenericRpcExceptionvoid setGenerate(boolean doGenerate)
throws BitcoinRPCException
BitcoinRPCExceptionList<String> generate(int numBlocks) throws BitcoinRPCException
numBlocks - The number of blocks to generate.BitcoinRPCExceptionList<String> generate(int numBlocks, long maxTries) throws BitcoinRPCException
numBlocks - The number of blocks to generate.maxTries - The maximum number of iterations that are tried to create the requested number of blocks.BitcoinRPCExceptionList<String> generateToAddress(int numBlocks, String address) throws BitcoinRPCException
numBlocks - The number of blocks to generate.address - The address to send the newly generated Bitcoin toBitcoinRPCExceptionBitcoindRpcClient.AddressValidationResult validateAddress(String address) throws GenericRpcException
address - The P2PKH or P2SH address to validate encoded in base58check formatGenericRpcExceptionBigDecimal getEstimateFee(int nBlocks) throws GenericRpcException
nBlocks - The maximum number of blocks a transaction should have to wait before it is predicted to be included in a block.GenericRpcExceptionBigDecimal getEstimatePriority(int nBlocks) throws GenericRpcException
nBlocks - The maximum number of blocks a transaction should have to wait before it is predicted to be included in a block based purely on its priorityGenericRpcExceptionvoid invalidateBlock(String blockHash) throws GenericRpcException
blockHash - the hash of the block to mark as invalid
[TODO] Add to https://bitcoin.org/en/developer-referenceGenericRpcExceptionvoid reconsiderBlock(String blockHash) throws GenericRpcException
blockHash - The hash of the block to reconsider
[TODO] Add to https://bitcoin.org/en/developer-referenceGenericRpcExceptionList<BitcoindRpcClient.PeerInfoResult> getPeerInfo()
void stop()
String getRawChangeAddress()
long getConnectionCount()
BigDecimal getUnconfirmedBalance()
BigDecimal getDifficulty()
void ping()
BitcoindRpcClient.DecodedScript decodeScript(String hex)
hex - The redeem script to decode as a hex-encoded serialized scriptBitcoindRpcClient.NetTotals getNetTotals()
boolean getGenerate()
BigDecimal getNetworkHashPs()
boolean setTxFee(BigDecimal amount)
amount - The transaction fee to pay, in bitcoins, for each kilobyte of transaction data.void addNode(String node, String command)
node - The node to add as a string in the form of command - What to do with the IP address above.void backupWallet(String destination)
destination - A filename or directory name.String signMessage(String adress, String message)
adress - A P2PKH address whose private key belongs to this walletmessage - The message to signvoid dumpWallet(String filename)
filename - The file in which the wallet dump will be placed.void importWallet(String filename)
filename - The file to import. The path is relative to Bitcoin Core’s working directoryvoid keyPoolRefill()
BigDecimal getReceivedByAccount(String account)
account - The name of the account containing the addresses to get.void encryptWallet(String passPhrase)
passPhrase - The passphrase to use for the encrypted wallet.void walletPassPhrase(String passPhrase, long timeOut)
passPhrase - The passphrase that unlocks the wallettimeOut - The number of seconds after which the decryption key will be automatically deleted from memoryboolean verifyMessage(String address, String signature, String message)
address - 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 signedString addMultiSigAddress(int nRequired, List<String> keyObject)
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 addressString addMultiSigAddress(int nRequired, List<String> keyObject, String account)
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.boolean verifyChain()
List<BitcoindRpcClient.NodeInfo> getAddedNodeInfo(boolean details, String node)
details - Removed in Bitcoin Core 0.14.0node - The node to get information about in the same void submitBlock(String hexData)
hexData - The full block to submit in serialized block format as hexBitcoindRpcClient.Transaction getTransaction(String txId)
txId - The TXID of the transaction to get details about.BitcoindRpcClient.TxOut getTxOut(String txId, long vout)
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 transactionBitcoindRpcClient.SmartFeeResult getEstimateSmartFee(int blocks)
blocks - Confirmation target in blocksBitcoindRpcClient.AddressBalance getAddressBalance(String address)
List<BitcoindRpcClient.AddressUtxo> getAddressUtxo(String address)
Copyright © 2018. All rights reserved.