Wallet RPC updates

- Convert more existing RPCs to Dash
(listaddressgroupings->listreceivedbyaddress)
This commit is contained in:
thephez 2017-11-29 14:07:32 -05:00
parent 8202b61162
commit 79231bb3d3
5 changed files with 120 additions and 74 deletions

View file

@ -9,6 +9,8 @@ http://opensource.org/licenses/MIT.
{% assign summary_listAddressGroupings="lists groups of addresses that may have had their common ownership made public by common use as inputs in the same transaction or from being used as change from a previous transaction." %}
<!-- __ -->
{% autocrossref %}
*Requires wallet support.*
@ -48,29 +50,38 @@ The `listaddressgroupings` RPC {{summary_listAddressGroupings}}
- n: "→ → →<br>Account"
t: "string"
p: "Optional<br>(0 or 1)"
d: "*Deprecated: will be removed in a later version of Bitcoin Core*<br><br>The account the address belongs to, if any. This field will not be returned for change addresses. The default account is an empty string (\"\")"
d: "*Deprecated: will be removed in a later version of Dash Core*<br><br>The account the address belongs to, if any. This field will not be returned for change addresses. The default account is an empty string (\"\")"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
*Example from Dash Core 0.12.2*
{% highlight bash %}
bitcoin-cli -testnet listaddressgroupings
dash-cli -testnet listaddressgroupings
{% endhighlight %}
Result (edited to only the first two results):
Result (edited to only three results):
{% highlight json %}
[
[
[
"mgKgzJ7HR64CrB3zm1B4FUUCLtaSqUKfDb",
"yNpezfFDfoikDuT1f4iK75AiLp2YLPsGAb",
0.00000000
]
],
[
"mnUbTmdAFD5EAg3348Ejmonub7JcWtrMck",
0.00000000,
"test1"
[
"yX7SvurfpwSD7QDA3pZNYNxt6kPPiZmRAk",
27.02970000,
"Test1"
]
],
[
[
"ygMuVDN2raRBma86GpwyQeJV18kR1261d1",
11.00000000,
"Test2"
]
]
]

View file

@ -9,6 +9,8 @@ http://opensource.org/licenses/MIT.
{% assign summary_listLockUnspent="returns a list of temporarily unspendable (locked) outputs." %}
<!-- __ -->
{% autocrossref %}
*Requires wallet support.*
@ -42,10 +44,10 @@ The `listlockunspent` RPC {{summary_listLockUnspent}}
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
*Example from Dash Core 0.12.2*
{% highlight bash %}
bitcoin-cli -testnet listlockunspent
dash-cli -testnet listlockunspent
{% endhighlight %}
Result:
@ -53,8 +55,8 @@ Result:
{% highlight json %}
[
{
"txid" : "ca7cb6a5ffcc2f21036879493db4530c0ce9b5bff9648f9a3be46e2dfc8e0166",
"vout" : 0
"txid": "d3d57ec5e4168b7145e911d019e9713563c1f2db5b2d6885739ea887feca4c87",
"vout": 0
}
]
{% endhighlight %}

View file

@ -7,7 +7,9 @@ http://opensource.org/licenses/MIT.
##### ListReceivedByAccount
{% include helpers/subhead-links.md %}
{% assign summary_listReceivedByAccount="lists the total number of bitcoins received by each account." %}
{% assign summary_listReceivedByAccount="lists the total number of dash received by each account." %}
<!-- __ -->
{% autocrossref %}
@ -15,14 +17,24 @@ http://opensource.org/licenses/MIT.
The `listreceivedbyaccount` RPC {{summary_listReceivedByAccount}}
{{WARNING}} `listreceivedbyaccount` will be removed in a later version of Bitcoin
{{WARNING}} `listreceivedbyaccount` will be removed in a later version of Dash
Core. Use the RPCs listed in the See Also subsection below instead.
*Parameter #1---the minimum number of confirmations a transaction must have to be counted*
{{INCLUDE_CONFIRMATIONS_PARAMETER}}
*Parameter #2---whether to include empty accounts*
*Parameter #2---whether to add 5 confirmations to transactions locked via InstantSend*
{% itemplate ntpd1 %}
- n: "addlockconf"
t: "bool"
p: "Optional<br>(exactly 1)"
d: "Add the number of InstantSend confirmations to InstantSend locked transactions"
{% enditemplate %}
*Parameter #3---whether to include empty accounts*
{% itemplate ntpd1 %}
- n: "Include Empty"
@ -32,7 +44,7 @@ Core. Use the RPCs listed in the See Also subsection below instead.
{% enditemplate %}
*Parameter #3---whether to include watch-only addresses in results*
*Parameter #4---whether to include watch-only addresses in results*
{{INCLUDE_INCLUDE_WATCH_ONLY_PARAMETER}}
@ -60,24 +72,30 @@ Core. Use the RPCs listed in the See Also subsection below instead.
d: "The name of the account"
- n: "→ →<br>`amount`<!--noref-->"
t: "number (bitcoins)"
t: "number (dash)"
p: "Required<br>(exactly 1)"
d: "The total amount received by this account in bitcoins"
d: "The total amount received by this account in dash"
- n: "→ →<br>`confirmations`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "The number of confirmations received by the last transaction received by this account. May be `0`"
- n: "→ →<br>`label`"
t: "string"
p: "Optional<br>(0 or 1)"
d: "A comment for the address/transaction"
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
*Example from Dash Core 0.12.2*
Get the balances for all non-empty accounts, including only transactions
which have been confirmed at least six times:
which have been confirmed at least six times (include InstantSend confirmations
for locked InstantSend transactions):
{% highlight bash %}
bitcoin-cli -testnet listreceivedbyaccount 6 false
dash-cli -testnet listreceivedbyaccount 6 true false true
{% endhighlight %}
Result (edited to only show the first two results):

View file

@ -7,7 +7,9 @@ http://opensource.org/licenses/MIT.
##### ListReceivedByAddress
{% include helpers/subhead-links.md %}
{% assign summary_listReceivedByAddress="lists the total number of bitcoins received by each address." %}
{% assign summary_listReceivedByAddress="lists the total number of dash received by each address." %}
<!-- __ -->
{% autocrossref %}
@ -19,7 +21,17 @@ The `listreceivedbyaddress` RPC {{summary_listReceivedByAddress}}
{{INCLUDE_CONFIRMATIONS_PARAMETER}}
*Parameter #2---whether to include empty accounts*
*Parameter #2---whether to add 5 confirmations to transactions locked via InstantSend*
{% itemplate ntpd1 %}
- n: "addlockconf"
t: "bool"
p: "Optional<br>(exactly 1)"
d: "Add the number of InstantSend confirmations to InstantSend locked transactions"
{% enditemplate %}
*Parameter #3---whether to include empty accounts*
{% itemplate ntpd1 %}
- n: "Include Empty"
@ -29,7 +41,7 @@ The `listreceivedbyaddress` RPC {{summary_listReceivedByAddress}}
{% enditemplate %}
*Parameter #3---whether to include watch-only addresses in results*
*Parameter #4---whether to include watch-only addresses in results*
{{INCLUDE_INCLUDE_WATCH_ONLY_PARAMETER}}
@ -59,12 +71,12 @@ The `listreceivedbyaddress` RPC {{summary_listReceivedByAddress}}
- n: "→ →<br>`account`"
t: "string"
p: "Required<br>(exactly 1)"
d: "*Deprecated: will be removed in a later version of Bitcoin Core*<br><br>The account the address belongs to. May be the default account, an empty string (\"\")"
d: "*Deprecated: will be removed in a later version of Dash Core*<br><br>The account the address belongs to. May be the default account, an empty string (\"\")"
- n: "→ →<br>`amount`"
t: "number (bitcoins)"
t: "number (dash)"
p: "Required<br>(exactly 1)"
d: "The total amount the address has received in bitcoins"
d: "The total amount the address has received in dash"
- n: "→ →<br>`confirmations`"
t: "number (int)"
@ -88,13 +100,14 @@ The `listreceivedbyaddress` RPC {{summary_listReceivedByAddress}}
{% enditemplate %}
*Example from Bitcoin Core 0.13.1*
*Example from Dash Core 0.12.2*
List addresses with balances confirmed by at least six blocks, including
watch-only addresses:
watch-only addresses (include InstantSend confirmations for locked InstantSend
transactions):
{% highlight bash %}
bitcoin-cli -testnet listreceivedbyaddress 6 false true
dash-cli -testnet listreceivedbyaddress 6 true false true
{% endhighlight %}
Result (edit to show only two entries):
@ -102,25 +115,25 @@ Result (edit to show only two entries):
{% highlight json %}
[
{
"address" : "mnUbTmdAFD5EAg3348Ejmonub7JcWtrMck",
"account" : "test1",
"amount" : 1.99900000,
"confirmations" : 55680,
"label" : "test1",
"txids" : [
"4d71a6127796766c39270881c779b6e05183f2bf35589261e9572436356f287f",
"997115d0cf7b83ed332e6c1f2e8c44f803c95ea43490c84ce3e9ede4b2e1605f"
"address": "yV3ZTfwyfUmpspncMSitiwzh7EvqSGrqZA",
"account": "",
"amount": 1000.00000000,
"confirmations": 26779,
"label": "",
"txids": [
"0456aaf51a8df21dd47c2a06ede046a5bf7403bcb95d14d1d71b178c189fb933"
]
},
{
"involvesWatchonly" : true,
"address" : "n3GNqMveyvaPvUbH469vDRadqpJMPc84JA",
"account" : "someone else's address2",
"amount" : 0.00050000,
"confirmations" : 34714,
"label" : "someone else's address2",
"txids" : [
"99845fd840ad2cc4d6f93fafb8b072d188821f55d9298772415175c456f3077d"
"address": "yfoR9uM3rcDfUc7AEfUNm5BjVYGFw7uQ9w",
"account": "Watching",
"amount": 1877.78476068,
"confirmations": 26876,
"label": "Watching",
"txids": [
"cd64114c803a2a243cb6ce4eb5c98e60cd2c688be8e900b3b957fe520cf42601",
"83d3f7f31926908962e336341b1895d5f734f9d7149bdb35f0381cc78019bd83"
]
}
]

View file

@ -7,7 +7,9 @@ http://opensource.org/licenses/MIT.
##### LockUnspent
{% include helpers/subhead-links.md %}
{% assign summary_lockUnspent="temporarily locks or unlocks specified transaction outputs. A locked transaction output will not be chosen by automatic coin selection when spending bitcoins. Locks are stored in memory only, so nodes start with zero locked outputs and the locked output list is always cleared when a node stops or fails." %}
{% assign summary_lockUnspent="temporarily locks or unlocks specified transaction outputs. A locked transaction output will not be chosen by automatic coin selection when spending dash. Locks are stored in memory only, so nodes start with zero locked outputs and the locked output list is always cleared when a node stops or fails." %}
<!-- __ -->
{% autocrossref %}
@ -60,20 +62,20 @@ The `lockunspent` RPC {{summary_lockUnspent}}
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
*Example from Dash Core 0.12.2*
Lock two outputs:
{% highlight bash %}
bitcoin-cli -testnet lockunspent false '''
dash-cli -testnet lockunspent false '''
[
{
"txid": "5a7d24cd665108c66b2d56146f244932edae4e2376b561b3d396d5ae017b9589",
"txid": "d3d57ec5e4168b7145e911d019e9713563c1f2db5b2d6885739ea887feca4c87",
"vout": 0
},
{
"txid": "6c5edd41a33f9839257358ba6ddece67df9db7f09c0db6bbea00d0372e8fe5cd",
"vout": 0
"txid": "607897611b2f7c5b23297b2a352a8d6f4383f8d0782585f93220082d361f8db9",
"vout": 1
}
]
'''
@ -88,7 +90,7 @@ true
Verify the outputs have been locked:
{% highlight bash %}
bitcoin-cli -testnet listlockunspent
dash-cli -testnet listlockunspent
{% endhighlight %}
Result
@ -96,12 +98,12 @@ Result
{% highlight json %}
[
{
"txid": "5a7d24cd665108c66b2d56146f244932edae4e2376b561b3d396d5ae017b9589",
"txid": "d3d57ec5e4168b7145e911d019e9713563c1f2db5b2d6885739ea887feca4c87",
"vout": 0
},
{
"txid": "6c5edd41a33f9839257358ba6ddece67df9db7f09c0db6bbea00d0372e8fe5cd",
"vout": 0
"txid": "607897611b2f7c5b23297b2a352a8d6f4383f8d0782585f93220082d361f8db9",
"vout": 1
}
]
{% endhighlight %}
@ -109,11 +111,11 @@ Result
Unlock one of the above outputs:
{% highlight bash %}
bitcoin-cli -testnet lockunspent true '''
dash-cli -testnet lockunspent true '''
[
{
"txid": "5a7d24cd665108c66b2d56146f244932edae4e2376b561b3d396d5ae017b9589",
"vout": 0
"txid": "607897611b2f7c5b23297b2a352a8d6f4383f8d0782585f93220082d361f8db9",
"vout": 1
}
]
'''
@ -128,7 +130,7 @@ true
Verify the output has been unlocked:
{% highlight bash %}
bitcoin-cli -testnet listlockunspent
dash-cli -testnet listlockunspent
{% endhighlight %}
Result:
@ -136,7 +138,7 @@ Result:
{% highlight json %}
[
{
"txid": "6c5edd41a33f9839257358ba6ddece67df9db7f09c0db6bbea00d0372e8fe5cd",
"txid": "d3d57ec5e4168b7145e911d019e9713563c1f2db5b2d6885739ea887feca4c87",
"vout": 0
}
]