Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rpcclient: listaccounts is deprecated and replaced with listlabels #1974

Open
brandonpille opened this issue May 4, 2023 · 11 comments
Open

Comments

@brandonpille
Copy link

A couple of commands have been deprecated and replaced by others. For example listaccounts is now listlabels. Most accounts related rpcs are now renamed to label. See https://chainquery.com/bitcoin-cli

@brandonpille
Copy link
Author

Can anyone pick this up?

@roy9495
Copy link

roy9495 commented May 14, 2023

Hi, I want to contribute. But I don't know what code changes I have to make. Can you please elaborate on this issue?

@roy9495
Copy link

roy9495 commented May 14, 2023

So these are the commands that got deprecated https://chainquery.com/bitcoin-cli#deprecated. Do you want all occurrences of these commands replaced by the alternatives, in this repo?
Thanks.

@brandonpille
Copy link
Author

Yes, it doesn't make sense to use deprecated calls by default as they will disappear some day. Or at least do the same as in the bitcoin nodes. In the new bitcoin node you can pass an argument telling the node to use the old (deprecated) calls instead. I think it makes sense to do that. We should, by default, use new calls and if wanted use the deprecated calls.

@brandonpille
Copy link
Author

Hi, do we have an estimate for this?

@brandonpille
Copy link
Author

brandonpille commented Jul 5, 2023

If someone wants to contribute, it's just modifying some function names and some arguments. Here are the required changes (got that from bitcoin repository: https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-0.17.0.md#label-and-account-apis-for-wallet):

Deprecated Method New Method Notes
getaccount getaddressinfo getaddressinfo returns a json object with address information instead of just the name of the account as a string.
getaccountaddress n/a There is no replacement for getaccountaddress since labels do not have an associated receive address.
getaddressesbyaccount getaddressesbylabel getaddressesbylabel returns a json object with the addresses as keys, instead of a list of strings.
getreceivedbyaccount getreceivedbylabel no change in behavior
listaccounts listlabels listlabels does not return a balance or accept minconf and watchonly arguments.
listreceivedbyaccount listreceivedbylabel Both methods return new label fields, along with account fields for backward compatibility.
move n/a no replacement
sendfrom n/a no replacement
setaccount setlabel Both methods now:
  • allow assigning labels to any address, instead of raising an error if the address is not receiving address.
  • delete the previous label associated with an address when the final address using that label is reassigned to a different label, instead of making an implicit getaccountaddress call to ensure the previous label still has a receiving address.
Changed Method Notes
addmultisigaddress Renamed account named parameter to label. Still accepts account for backward compatibility if running with '-deprecatedrpc=accounts'.
getnewaddress Renamed account named parameter to label. Still accepts account for backward compatibility. if running with '-deprecatedrpc=accounts'
listunspent Returns new label fields. account field will be returned for backward compatibility if running with '-deprecatedrpc=accounts'
sendmany The account named parameter has been renamed to dummy. If provided, the dummy parameter must be set to the empty string, unless running with the -deprecatedrpc=accounts argument (in which case functionality is unchanged).
listtransactions The account named parameter has been renamed to dummy. If provided, the dummy parameter must be set to the string *, unless running with the -deprecatedrpc=accounts argument (in which case functionality is unchanged).
getbalance account, minconf and include_watchonly parameters are deprecated, and can only be used if running with '-deprecatedrpc=accounts'

@elnosh
Copy link

elnosh commented Jul 28, 2023

Hi, I'm new here and looking to contribute. May I pick this up?

@0xEclair
Copy link
Contributor

Hi, maybe we can work together.

@yemmyharry
Copy link

@brandonpille pls is this issue still unresolved? Would love to contribute.

@joseguru
Copy link

joseguru commented Mar 1, 2024

@brandonpille pls is this issue still unresolved? Would love to contribute.

@yemmyharry If its still unresolved I would also want to help

@Roasbeef
Copy link
Member

Roasbeef commented Mar 1, 2024

See #1934 also

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants