https://en.bitcoin.it/w/api.php?action=feedcontributions&user=Sanity&feedformat=atomBitcoin Wiki - User contributions [en]2024-03-28T08:23:23ZUser contributionsMediaWiki 1.30.0https://en.bitcoin.it/w/index.php?title=Original_Bitcoin_client/API_calls_list&diff=12295Original Bitcoin client/API calls list2011-07-02T18:40:43Z<p>Sanity: Remove rant, probably not the place for it</p>
<hr />
<div>Bitcoin API call list (as of version 0.3.20.2)<br />
<br />
== Common operations ==<br />
<br />
=== Listing my bitcoin addresses ===<br />
<br />
Listing the bitcoin [[address|addresses]] in your wallet is easily done via ''listreceivedbyaddress''. It normally lists only addresses which already have received transactions, however you can list all the addresses by setting the first argument to 0, and the second one to true.<br />
<br />
[[accounts explained|Accounts]] are used to organize addresses.<br />
<br />
== Full list ==<br />
<br />
Required arguments are denoted inside &lt; and &gt; Optional arguments are inside [ and ].<br />
<br />
{|class="wikitable"<br />
! Command !! Parameters !! Description<br />
|-<br />
| backupwallet || <destination> || Safely copies wallet.dat to destination, which can be a directory or a path with filename.<br />
|-<br />
| getaccount || <bitcoinaddress> || Returns the account associated with the given address.<br />
|-<br />
| getaccountaddress || <account> || Returns the current bitcoin address for receiving payments to this account.<br />
|-<br />
| getaddressesbyaccount || <account> || Returns the list of addresses for the given account.<br />
|-<br />
| getbalance || [account] [minconf=1] || If [account] is not specified, returns the server's total available balance.<br/>If [account] is specified, returns the balance in the account.<br />
|-<br />
| getblockbycount || height || Dumps the block existing at specified height. '''Note: this is not available in the official release'''<br />
|-<br />
| getblockcount || || Returns the number of blocks in the longest block chain.<br />
|-<br />
| getblocknumber || || Returns the block number of the latest block in the longest block chain.<br />
|-<br />
| getconnectioncount || || Returns the number of connections to other nodes.<br />
|-<br />
| getdifficulty || || Returns the proof-of-work difficulty as a multiple of the minimum difficulty.<br />
|-<br />
| getgenerate || || Returns true or false whether bitcoind is currently generating hashes<br />
|-<br />
| gethashespersec || || Returns a recent hashes per second performance measurement while generating.<br />
|-<br />
| getinfo || || Returns an object containing various state info.<br />
|-<br />
| getnewaddress || [account] || Returns a new bitcoin address for receiving payments. If [account] is specified (recommended), it is added to the address book so payments received with the address will be credited to [account].<br />
|-<br />
| getreceivedbyaccount || <account> [minconf=1] || Returns the total amount received by addresses with <account> in transactions with at least [minconf] confirmations.<br />
|-<br />
| getreceivedbyaddress || <bitcoinaddress> [minconf=1] || Returns the total amount received by <bitcoinaddress> in transactions with at least [minconf] confirmations.<br />
|-<br />
| gettransaction || <txid> || Get detailed information about <txid><br />
|-<br />
| [[getwork]] || [data] || If [data] is not specified, returns formatted hash data to work on:<br />
* "midstate" : precomputed hash state after hashing the first half of the data<br />
* "data" : block data<br />
* "hash1" : formatted hash buffer for second hash<br />
* "target" : little endian hash target<br />
If [data] is specified, tries to solve the block and returns true if it was successful.<br />
|-<br />
| help || [command] || List commands, or get help for a command.<br />
|-<br />
| listaccounts || [minconf=1] || Returns Object that has account names as keys, account balances as values.<br />
|-<br />
| listreceivedbyaccount || [minconf=1] [includeempty=false] || Returns an array of objects containing:<br />
* "account" : the account of the receiving addresses<br />
* "amount" : total amount received by addresses with this account<br />
* "confirmations" : number of confirmations of the most recent transaction included<br />
|-<br />
| listreceivedbyaddress || [minconf=1] [includeempty=false] || Returns an array of objects containing:<br />
* "address" : receiving address<br />
* "account" : the account of the receiving address<br />
* "amount" : total amount received by the address<br />
* "confirmations" : number of confirmations of the most recent transaction included<br />
To get a list of accounts on the system, execute bitcoind listreceivedbyaddress 0 true<br />
|-<br />
| listtransactions || <account> [count=10] || Returns up to [count] most recent transactions for account <account>.<br />
|-<br />
| move || <fromaccount> <toaccount> <amount> [minconf=1] [comment] || Move from one account in your wallet to another.<br />
|-<br />
| sendfrom || <fromaccount> <tobitcoinaddress> <amount> [minconf=1] [comment] [comment-to] || <amount> is a real and is rounded to 8 decimal places. Returns the transaction ID if successful.<br />
|-<br />
| sendtoaddress || <bitcoinaddress> <amount> [comment] [comment-to] || <amount> is a real and is rounded to 8 decimal places<br />
|-<br />
| setaccount || <bitcoinaddress> <account> || Sets the account associated with the given address.<br />
|-<br />
| setgenerate || <generate> [genproclimit] || <generate> is true or false to turn generation on or off.<br/>Generation is limited to [genproclimit] processors, -1 is unlimited.<br />
|-<br />
| stop || || Stop bitcoin server.<br />
|-<br />
| validateaddress || <bitcoinaddress> || Return information about <bitcoinaddress>.<br />
|}<br />
<br />
==See Also==<br />
<br />
* [[Original Bitcoin client]]<br />
* [[API reference (JSON-RPC)]]<br />
* [[Lazy_API]]<br />
<br />
[[Category:Technical]]<br />
[[Category:Developer]]</div>Sanityhttps://en.bitcoin.it/w/index.php?title=Original_Bitcoin_client/API_calls_list&diff=12291Original Bitcoin client/API calls list2011-07-02T18:30:24Z<p>Sanity: /* Full list */</p>
<hr />
<div>Bitcoin API call list (as of version 0.3.20.2)<br />
<br />
== Common operations ==<br />
<br />
=== Listing my bitcoin addresses ===<br />
<br />
Listing the bitcoin [[address|addresses]] in your wallet is easily done via ''listreceivedbyaddress''. It normally lists only addresses which already have received transactions, however you can list all the addresses by setting the first argument to 0, and the second one to true.<br />
<br />
[[accounts explained|Accounts]] are used to organize addresses.<br />
<br />
== Full list ==<br />
<br />
Required arguments are denoted inside &lt; and &gt; Optional arguments are inside [ and ].<br />
<br />
{|class="wikitable"<br />
! Command !! Parameters !! Description<br />
|-<br />
| backupwallet || <destination> || Safely copies wallet.dat to destination, which can be a directory or a path with filename.<br />
|-<br />
| getaccount || <bitcoinaddress> || Returns the account associated with the given address.<br />
|-<br />
| getaccountaddress || <account> || Returns the current bitcoin address for receiving payments to this account.<br />
|-<br />
| getaddressesbyaccount || <account> || Returns the list of addresses for the given account.<br />
|-<br />
| getbalance || [account] [minconf=1] || If [account] is not specified, returns the server's total available balance.<br/>If [account] is specified, returns the balance in the account.<br />
|-<br />
| getblockbycount || height || Dumps the block existing at specified height. '''Note: this is not available in the official release'''<br />
|-<br />
| getblockcount || || Returns the number of blocks in the longest block chain.<br />
|-<br />
| getblocknumber || || Returns the block number of the latest block in the longest block chain.<br />
|-<br />
| getconnectioncount || || Returns the number of connections to other nodes.<br />
|-<br />
| getdifficulty || || Returns the proof-of-work difficulty as a multiple of the minimum difficulty.<br />
|-<br />
| getgenerate || || Returns true or false whether bitcoind is currently generating hashes<br />
|-<br />
| gethashespersec || || Returns a recent hashes per second performance measurement while generating.<br />
|-<br />
| getinfo || || Returns an object containing various state info.<br />
|-<br />
| getnewaddress || [account] || Returns a new bitcoin address for receiving payments. If [account] is specified (recommended), it is added to the address book so payments received with the address will be credited to [account].<br />
|-<br />
| getreceivedbyaccount || <account> [minconf=1] || Returns the total amount received by addresses with <account> in transactions with at least [minconf] confirmations.<br />
|-<br />
| getreceivedbyaddress || <bitcoinaddress> [minconf=1] || Returns the total amount received by <bitcoinaddress> in transactions with at least [minconf] confirmations.<br />
|-<br />
| gettransaction || <txid> || Get detailed information about <txid><br />
|-<br />
| [[getwork]] || [data] || If [data] is not specified, returns formatted hash data to work on:<br />
* "midstate" : precomputed hash state after hashing the first half of the data<br />
* "data" : block data<br />
* "hash1" : formatted hash buffer for second hash<br />
* "target" : little endian hash target<br />
If [data] is specified, tries to solve the block and returns true if it was successful.<br />
|-<br />
| help || [command] || List commands, or get help for a command.<br />
|-<br />
| listaccounts || [minconf=1] || Returns Object that has account names as keys, account balances as values.<br />
|-<br />
| listreceivedbyaccount || [minconf=1] [includeempty=false] || Returns an array of objects containing:<br />
* "account" : the account of the receiving addresses<br />
* "amount" : total amount received by addresses with this account<br />
* "confirmations" : number of confirmations of the most recent transaction included<br />
|-<br />
| listreceivedbyaddress || [minconf=1] [includeempty=false] || Returns an array of objects containing:<br />
* "address" : receiving address<br />
* "account" : the account of the receiving address<br />
* "amount" : total amount received by the address<br />
* "confirmations" : number of confirmations of the most recent transaction included<br />
To get a list of accounts on the system, execute bitcoind listreceivedbyaddress 0 true<br />
|-<br />
| listtransactions || <account> [count=10] || Returns up to [count] most recent transactions for account <account>.<br />
|-<br />
| move || <fromaccount> <toaccount> <amount> [minconf=1] [comment] || Move from one account in your wallet to another.<br />
|-<br />
| sendfrom || <fromaccount> <tobitcoinaddress> <amount> [minconf=1] [comment] [comment-to] || <amount> is a real and is rounded to 8 decimal places (yes, this is bad practice for handling currency :-( ). Returns the transaction ID if successful.<br />
|-<br />
| sendtoaddress || <bitcoinaddress> <amount> [comment] [comment-to] || <amount> is a real and is rounded to 8 decimal places<br />
|-<br />
| setaccount || <bitcoinaddress> <account> || Sets the account associated with the given address.<br />
|-<br />
| setgenerate || <generate> [genproclimit] || <generate> is true or false to turn generation on or off.<br/>Generation is limited to [genproclimit] processors, -1 is unlimited.<br />
|-<br />
| stop || || Stop bitcoin server.<br />
|-<br />
| validateaddress || <bitcoinaddress> || Return information about <bitcoinaddress>.<br />
|}<br />
<br />
==See Also==<br />
<br />
* [[Original Bitcoin client]]<br />
* [[API reference (JSON-RPC)]]<br />
* [[Lazy_API]]<br />
<br />
[[Category:Technical]]<br />
[[Category:Developer]]</div>Sanityhttps://en.bitcoin.it/w/index.php?title=Original_Bitcoin_client/API_calls_list&diff=12290Original Bitcoin client/API calls list2011-07-02T18:29:45Z<p>Sanity: Informed by BlueMatt on irc.freenode.net that these amounts are now rounded to 8 decimal places.</p>
<hr />
<div>Bitcoin API call list (as of version 0.3.20.2)<br />
<br />
== Common operations ==<br />
<br />
=== Listing my bitcoin addresses ===<br />
<br />
Listing the bitcoin [[address|addresses]] in your wallet is easily done via ''listreceivedbyaddress''. It normally lists only addresses which already have received transactions, however you can list all the addresses by setting the first argument to 0, and the second one to true.<br />
<br />
[[accounts explained|Accounts]] are used to organize addresses.<br />
<br />
== Full list ==<br />
<br />
Required arguments are denoted inside &lt; and &gt; Optional arguments are inside [ and ].<br />
<br />
{|class="wikitable"<br />
! Command !! Parameters !! Description<br />
|-<br />
| backupwallet || <destination> || Safely copies wallet.dat to destination, which can be a directory or a path with filename.<br />
|-<br />
| getaccount || <bitcoinaddress> || Returns the account associated with the given address.<br />
|-<br />
| getaccountaddress || <account> || Returns the current bitcoin address for receiving payments to this account.<br />
|-<br />
| getaddressesbyaccount || <account> || Returns the list of addresses for the given account.<br />
|-<br />
| getbalance || [account] [minconf=1] || If [account] is not specified, returns the server's total available balance.<br/>If [account] is specified, returns the balance in the account.<br />
|-<br />
| getblockbycount || height || Dumps the block existing at specified height. '''Note: this is not available in the official release'''<br />
|-<br />
| getblockcount || || Returns the number of blocks in the longest block chain.<br />
|-<br />
| getblocknumber || || Returns the block number of the latest block in the longest block chain.<br />
|-<br />
| getconnectioncount || || Returns the number of connections to other nodes.<br />
|-<br />
| getdifficulty || || Returns the proof-of-work difficulty as a multiple of the minimum difficulty.<br />
|-<br />
| getgenerate || || Returns true or false whether bitcoind is currently generating hashes<br />
|-<br />
| gethashespersec || || Returns a recent hashes per second performance measurement while generating.<br />
|-<br />
| getinfo || || Returns an object containing various state info.<br />
|-<br />
| getnewaddress || [account] || Returns a new bitcoin address for receiving payments. If [account] is specified (recommended), it is added to the address book so payments received with the address will be credited to [account].<br />
|-<br />
| getreceivedbyaccount || <account> [minconf=1] || Returns the total amount received by addresses with <account> in transactions with at least [minconf] confirmations.<br />
|-<br />
| getreceivedbyaddress || <bitcoinaddress> [minconf=1] || Returns the total amount received by <bitcoinaddress> in transactions with at least [minconf] confirmations.<br />
|-<br />
| gettransaction || <txid> || Get detailed information about <txid><br />
|-<br />
| [[getwork]] || [data] || If [data] is not specified, returns formatted hash data to work on:<br />
* "midstate" : precomputed hash state after hashing the first half of the data<br />
* "data" : block data<br />
* "hash1" : formatted hash buffer for second hash<br />
* "target" : little endian hash target<br />
If [data] is specified, tries to solve the block and returns true if it was successful.<br />
|-<br />
| help || [command] || List commands, or get help for a command.<br />
|-<br />
| listaccounts || [minconf=1] || Returns Object that has account names as keys, account balances as values.<br />
|-<br />
| listreceivedbyaccount || [minconf=1] [includeempty=false] || Returns an array of objects containing:<br />
* "account" : the account of the receiving addresses<br />
* "amount" : total amount received by addresses with this account<br />
* "confirmations" : number of confirmations of the most recent transaction included<br />
|-<br />
| listreceivedbyaddress || [minconf=1] [includeempty=false] || Returns an array of objects containing:<br />
* "address" : receiving address<br />
* "account" : the account of the receiving address<br />
* "amount" : total amount received by the address<br />
* "confirmations" : number of confirmations of the most recent transaction included<br />
To get a list of accounts on the system, execute bitcoind listreceivedbyaddress 0 true<br />
|-<br />
| listtransactions || <account> [count=10] || Returns up to [count] most recent transactions for account <account>.<br />
|-<br />
| move || <fromaccount> <toaccount> <amount> [minconf=1] [comment] || Move from one account in your wallet to another.<br />
|-<br />
| sendfrom || <fromaccount> <tobitcoinaddress> <amount> [minconf=1] [comment] [comment-to] || <amount> is a real and is rounded to 8 decimal places<ref>Yes, this is bad practice for handling currency</ref>. Returns the transaction ID if successful.<br />
|-<br />
| sendtoaddress || <bitcoinaddress> <amount> [comment] [comment-to] || <amount> is a real and is rounded to 8 decimal places<br />
|-<br />
| setaccount || <bitcoinaddress> <account> || Sets the account associated with the given address.<br />
|-<br />
| setgenerate || <generate> [genproclimit] || <generate> is true or false to turn generation on or off.<br/>Generation is limited to [genproclimit] processors, -1 is unlimited.<br />
|-<br />
| stop || || Stop bitcoin server.<br />
|-<br />
| validateaddress || <bitcoinaddress> || Return information about <bitcoinaddress>.<br />
|}<br />
<br />
==See Also==<br />
<br />
* [[Original Bitcoin client]]<br />
* [[API reference (JSON-RPC)]]<br />
* [[Lazy_API]]<br />
<br />
[[Category:Technical]]<br />
[[Category:Developer]]</div>Sanity