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." %} {% 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 %} {% autocrossref %}
*Requires wallet support.* *Requires wallet support.*
@ -48,31 +50,40 @@ The `listaddressgroupings` RPC {{summary_listAddressGroupings}}
- n: "→ → →<br>Account" - n: "→ → →<br>Account"
t: "string" t: "string"
p: "Optional<br>(0 or 1)" 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 %} {% enditemplate %}
*Example from Bitcoin Core 0.10.0* *Example from Dash Core 0.12.2*
{% highlight bash %} {% highlight bash %}
bitcoin-cli -testnet listaddressgroupings dash-cli -testnet listaddressgroupings
{% endhighlight %} {% endhighlight %}
Result (edited to only the first two results): Result (edited to only three results):
{% highlight json %} {% highlight json %}
[ [
[
[ [
[ "yNpezfFDfoikDuT1f4iK75AiLp2YLPsGAb",
"mgKgzJ7HR64CrB3zm1B4FUUCLtaSqUKfDb", 0.00000000
0.00000000
],
[
"mnUbTmdAFD5EAg3348Ejmonub7JcWtrMck",
0.00000000,
"test1"
]
] ]
],
[
[
"yX7SvurfpwSD7QDA3pZNYNxt6kPPiZmRAk",
27.02970000,
"Test1"
]
],
[
[
"ygMuVDN2raRBma86GpwyQeJV18kR1261d1",
11.00000000,
"Test2"
]
]
] ]
{% endhighlight %} {% endhighlight %}

View file

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

View file

@ -7,7 +7,9 @@ http://opensource.org/licenses/MIT.
##### ListReceivedByAccount ##### ListReceivedByAccount
{% include helpers/subhead-links.md %} {% 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 %} {% autocrossref %}
@ -15,14 +17,24 @@ http://opensource.org/licenses/MIT.
The `listreceivedbyaccount` RPC {{summary_listReceivedByAccount}} 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. 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* *Parameter #1---the minimum number of confirmations a transaction must have to be counted*
{{INCLUDE_CONFIRMATIONS_PARAMETER}} {{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 %} {% itemplate ntpd1 %}
- n: "Include Empty" - n: "Include Empty"
@ -32,7 +44,7 @@ Core. Use the RPCs listed in the See Also subsection below instead.
{% enditemplate %} {% 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}} {{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" d: "The name of the account"
- n: "→ →<br>`amount`<!--noref-->" - n: "→ →<br>`amount`<!--noref-->"
t: "number (bitcoins)" t: "number (dash)"
p: "Required<br>(exactly 1)" 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`" - n: "→ →<br>`confirmations`"
t: "number (int)" t: "number (int)"
p: "Required<br>(exactly 1)" p: "Required<br>(exactly 1)"
d: "The number of confirmations received by the last transaction received by this account. May be `0`" 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 %} {% 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 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 %} {% highlight bash %}
bitcoin-cli -testnet listreceivedbyaccount 6 false dash-cli -testnet listreceivedbyaccount 6 true false true
{% endhighlight %} {% endhighlight %}
Result (edited to only show the first two results): Result (edited to only show the first two results):

View file

@ -7,7 +7,9 @@ http://opensource.org/licenses/MIT.
##### ListReceivedByAddress ##### ListReceivedByAddress
{% include helpers/subhead-links.md %} {% 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 %} {% autocrossref %}
@ -19,7 +21,17 @@ The `listreceivedbyaddress` RPC {{summary_listReceivedByAddress}}
{{INCLUDE_CONFIRMATIONS_PARAMETER}} {{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 %} {% itemplate ntpd1 %}
- n: "Include Empty" - n: "Include Empty"
@ -29,7 +41,7 @@ The `listreceivedbyaddress` RPC {{summary_listReceivedByAddress}}
{% enditemplate %} {% 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}} {{INCLUDE_INCLUDE_WATCH_ONLY_PARAMETER}}
@ -59,12 +71,12 @@ The `listreceivedbyaddress` RPC {{summary_listReceivedByAddress}}
- n: "→ →<br>`account`" - n: "→ →<br>`account`"
t: "string" t: "string"
p: "Required<br>(exactly 1)" 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`" - n: "→ →<br>`amount`"
t: "number (bitcoins)" t: "number (dash)"
p: "Required<br>(exactly 1)" 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`" - n: "→ →<br>`confirmations`"
t: "number (int)" t: "number (int)"
@ -88,41 +100,42 @@ The `listreceivedbyaddress` RPC {{summary_listReceivedByAddress}}
{% enditemplate %} {% 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 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 %} {% highlight bash %}
bitcoin-cli -testnet listreceivedbyaddress 6 false true dash-cli -testnet listreceivedbyaddress 6 true false true
{% endhighlight %} {% endhighlight %}
Result (edit to show only two entries): Result (edit to show only two entries):
{% highlight json %} {% highlight json %}
[ [
{ {
"address" : "mnUbTmdAFD5EAg3348Ejmonub7JcWtrMck", "address": "yV3ZTfwyfUmpspncMSitiwzh7EvqSGrqZA",
"account" : "test1", "account": "",
"amount" : 1.99900000, "amount": 1000.00000000,
"confirmations" : 55680, "confirmations": 26779,
"label" : "test1", "label": "",
"txids" : [ "txids": [
"4d71a6127796766c39270881c779b6e05183f2bf35589261e9572436356f287f", "0456aaf51a8df21dd47c2a06ede046a5bf7403bcb95d14d1d71b178c189fb933"
"997115d0cf7b83ed332e6c1f2e8c44f803c95ea43490c84ce3e9ede4b2e1605f" ]
] },
}, {
{ "involvesWatchonly" : true,
"involvesWatchonly" : true, "address": "yfoR9uM3rcDfUc7AEfUNm5BjVYGFw7uQ9w",
"address" : "n3GNqMveyvaPvUbH469vDRadqpJMPc84JA", "account": "Watching",
"account" : "someone else's address2", "amount": 1877.78476068,
"amount" : 0.00050000, "confirmations": 26876,
"confirmations" : 34714, "label": "Watching",
"label" : "someone else's address2", "txids": [
"txids" : [ "cd64114c803a2a243cb6ce4eb5c98e60cd2c688be8e900b3b957fe520cf42601",
"99845fd840ad2cc4d6f93fafb8b072d188821f55d9298772415175c456f3077d" "83d3f7f31926908962e336341b1895d5f734f9d7149bdb35f0381cc78019bd83"
] ]
} }
] ]
{% endhighlight %} {% endhighlight %}

View file

@ -7,7 +7,9 @@ http://opensource.org/licenses/MIT.
##### LockUnspent ##### LockUnspent
{% include helpers/subhead-links.md %} {% 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 %} {% autocrossref %}
@ -60,20 +62,20 @@ The `lockunspent` RPC {{summary_lockUnspent}}
{% enditemplate %} {% enditemplate %}
*Example from Bitcoin Core 0.10.0* *Example from Dash Core 0.12.2*
Lock two outputs: Lock two outputs:
{% highlight bash %} {% highlight bash %}
bitcoin-cli -testnet lockunspent false ''' dash-cli -testnet lockunspent false '''
[ [
{ {
"txid": "5a7d24cd665108c66b2d56146f244932edae4e2376b561b3d396d5ae017b9589", "txid": "d3d57ec5e4168b7145e911d019e9713563c1f2db5b2d6885739ea887feca4c87",
"vout": 0 "vout": 0
}, },
{ {
"txid": "6c5edd41a33f9839257358ba6ddece67df9db7f09c0db6bbea00d0372e8fe5cd", "txid": "607897611b2f7c5b23297b2a352a8d6f4383f8d0782585f93220082d361f8db9",
"vout": 0 "vout": 1
} }
] ]
''' '''
@ -88,7 +90,7 @@ true
Verify the outputs have been locked: Verify the outputs have been locked:
{% highlight bash %} {% highlight bash %}
bitcoin-cli -testnet listlockunspent dash-cli -testnet listlockunspent
{% endhighlight %} {% endhighlight %}
Result Result
@ -96,12 +98,12 @@ Result
{% highlight json %} {% highlight json %}
[ [
{ {
"txid": "5a7d24cd665108c66b2d56146f244932edae4e2376b561b3d396d5ae017b9589", "txid": "d3d57ec5e4168b7145e911d019e9713563c1f2db5b2d6885739ea887feca4c87",
"vout": 0 "vout": 0
}, },
{ {
"txid": "6c5edd41a33f9839257358ba6ddece67df9db7f09c0db6bbea00d0372e8fe5cd", "txid": "607897611b2f7c5b23297b2a352a8d6f4383f8d0782585f93220082d361f8db9",
"vout": 0 "vout": 1
} }
] ]
{% endhighlight %} {% endhighlight %}
@ -109,11 +111,11 @@ Result
Unlock one of the above outputs: Unlock one of the above outputs:
{% highlight bash %} {% highlight bash %}
bitcoin-cli -testnet lockunspent true ''' dash-cli -testnet lockunspent true '''
[ [
{ {
"txid": "5a7d24cd665108c66b2d56146f244932edae4e2376b561b3d396d5ae017b9589", "txid": "607897611b2f7c5b23297b2a352a8d6f4383f8d0782585f93220082d361f8db9",
"vout": 0 "vout": 1
} }
] ]
''' '''
@ -128,7 +130,7 @@ true
Verify the output has been unlocked: Verify the output has been unlocked:
{% highlight bash %} {% highlight bash %}
bitcoin-cli -testnet listlockunspent dash-cli -testnet listlockunspent
{% endhighlight %} {% endhighlight %}
Result: Result:
@ -136,7 +138,7 @@ Result:
{% highlight json %} {% highlight json %}
[ [
{ {
"txid": "6c5edd41a33f9839257358ba6ddece67df9db7f09c0db6bbea00d0372e8fe5cd", "txid": "d3d57ec5e4168b7145e911d019e9713563c1f2db5b2d6885739ea887feca4c87",
"vout": 0 "vout": 0
} }
] ]