diff --git a/_autocrossref.yaml b/_autocrossref.yaml index 5ec175de..2a85c6e7 100644 --- a/_autocrossref.yaml +++ b/_autocrossref.yaml @@ -281,6 +281,8 @@ CVE-2012-2459: '`getaccountaddress` RPC': rpc getaccountaddress '`getaddednodeinfo`': rpc getaddednodeinfo '`getaddednodeinfo` RPC': rpc getaddednodeinfo +'`getaddressbalance`': rpc getaddressbalance +'`getaddressbalance` RPC': rpc getaddressbalance '`getaddressesbyaccount`': rpc getaddressesbyaccount '`getaddressesbyaccount` RPC': rpc getaddressesbyaccount '`getbalance`': rpc getbalance diff --git a/_config.yml b/_config.yml index a1355719..dea5c045 100644 --- a/_config.yml +++ b/_config.yml @@ -277,6 +277,7 @@ devsearches: - 'GetAccount': "/en/developer-reference#getaccount" - 'GetAccountAddress': "/en/developer-reference#getaccountaddress" - 'GetAddedNodeInfo': "/en/developer-reference#getaddednodeinfo" + - 'GetAddressBalance': "/en/developer-reference#getaddressbalance" - 'GetAddressesByAccount': "/en/developer-reference#getaddressesbyaccount" - 'GetBalance': "/en/developer-reference#getbalance" - 'GetBestBlockHash': "/en/developer-reference#getbestblockhash" diff --git a/_includes/devdoc/dash-core/rpcs/quick-reference.md b/_includes/devdoc/dash-core/rpcs/quick-reference.md index 05f85de6..6f7cfa8a 100644 --- a/_includes/devdoc/dash-core/rpcs/quick-reference.md +++ b/_includes/devdoc/dash-core/rpcs/quick-reference.md @@ -180,9 +180,8 @@ Use v0.n.n in abbreviation title to prevent autocrossrefing. * [ListBanned][rpc listbanned]: {{summary_listBanned}} {{NEW0_12_0}} * [Ping][rpc ping]: {{summary_ping-rpc}} * [SetBan][rpc setban]: {{summary_setBan}} {{NEW0_12_0}} - + {% endautocrossref %} #### Raw Transaction RPCs @@ -239,6 +238,7 @@ default. + * [DumpHDInfo][rpc dumphdinfo]: {{summary_dumpHdInfo}} * [DumpPrivKey][rpc dumpprivkey]: {{summary_dumpPrivKey}} * [DumpWallet][rpc dumpwallet]: {{summary_dumpWallet}} * [EncryptWallet][rpc encryptwallet]: {{summary_encryptWallet}} diff --git a/_includes/devdoc/dash-core/rpcs/rpcs/getaddressbalance.md b/_includes/devdoc/dash-core/rpcs/rpcs/getaddressbalance.md new file mode 100644 index 00000000..7f4c4d30 --- /dev/null +++ b/_includes/devdoc/dash-core/rpcs/rpcs/getaddressbalance.md @@ -0,0 +1,70 @@ +{% comment %} +This file is licensed under the MIT License (MIT) available on +http://opensource.org/licenses/MIT. +{% endcomment %} +{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/getaddressbalance.md" %} + +##### GetAddressBalance +{% include helpers/subhead-links.md %} + +{% autocrossref %} + +{% assign summary_getAddressBalance="returns the balance for address(es) (requires addressindex to be enabled)." %} + +*Requires wallet support.* + +The `getaddressbalance` RPC {{summary_getAddressBalance}} + +*Parameter #1---an array of addresses* + +{% itemplate ntpd1 %} +- n: "Address" + t: "string (base58)" + p: "Required
(1 or more)" + d: "An array of P2PKH or P2SH Dash address(es)." + +{% enditemplate %} + +*Result---the current balance in duffs and the total number of duffs received (including change)* + +{% itemplate ntpd1 %} +- n: "`result`" + t: "object" + p: "Required
(exactly 1)" + d: "An object listing the current balance and total amount received (including change), or an error if any address is invalid" + +- n: "→
`balance`" + t: "string" + p: "Required
(exactly 1)" + d: "The current balance in duffs" + +- n: "→
`received`" + t: "string" + p: "Required
(exactly 1)" + d: "The total number of duffs received (including change)" + +{% enditemplate %} + +*Example from Dash Core 0.12.2* + +Get the balance for an address: + +{% highlight bash %} +dash-cli getaddressbalance '{"addresses": ["yWjoZBvnUKWhpKMbBkVVnnMD8Bzno9j6tQ"]}' +{% endhighlight %} + +Result: + +{% highlight text %} +{ + "balance": 0, + "received": 10000100 +} +{% endhighlight %} + +*See also* + +* [GetBalance][rpc getbalance]: {{summary_getBalance}} +* [GetUnconfirmedBalance][rpc getunconfirmedbalance]: {{summary_getUnconfirmedBalance}} + +{% endautocrossref %} diff --git a/_includes/helpers/summaries.md b/_includes/helpers/summaries.md index 2cc9e469..61012717 100644 --- a/_includes/helpers/summaries.md +++ b/_includes/helpers/summaries.md @@ -23,6 +23,7 @@ This file is licensed under the terms of its source texts{%endcomment%} {% assign summary_getAccount="returns the name of the account associated with the given address." %} {% assign summary_getAccountAddress="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." %} {% assign summary_getAddedNodeInfo="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." %} +{% assign summary_getAddressBalance="returns the balance for address(es) (requires addressindex to be enabled)." %} {% assign summary_getAddressesByAccount="returns a list of every address assigned to a particular account." %} {% assign summary_getBalance="gets the balance in decimal bitcoins across all accounts or for a particular account." %} {% assign summary_getBestBlockHash="returns the header hash of the most recent block on the best block chain." %} diff --git a/_includes/references.md b/_includes/references.md index f7cf6da3..9b161626 100644 --- a/_includes/references.md +++ b/_includes/references.md @@ -106,6 +106,7 @@ http://opensource.org/licenses/MIT. [rpc getaccount]: /en/developer-reference#getaccount [rpc getaccountaddress]: /en/developer-reference#getaccountaddress [rpc getaddednodeinfo]: /en/developer-reference#getaddednodeinfo +[rpc getaddressbalance]: /en/developer-reference#getaddressbalance [rpc getaddressesbyaccount]: /en/developer-reference#getaddressesbyaccount [rpc getbalance]: /en/developer-reference#getbalance [rpc getbestblockhash]: /en/developer-reference#getbestblockhash diff --git a/en/developer-reference.md b/en/developer-reference.md index 854068c9..5e0d34d0 100644 --- a/en/developer-reference.md +++ b/en/developer-reference.md @@ -114,6 +114,8 @@ untrusted source. {% include devdoc/dash-core/rpcs/rpcs/getaddednodeinfo.md %} +{% include devdoc/dash-core/rpcs/rpcs/getaddressbalance.md %} + {% include devdoc/dash-core/rpcs/rpcs/getaddressesbyaccount.md %} {% include devdoc/dash-core/rpcs/rpcs/getbalance.md %}