diff --git a/CHANGELOG.md b/CHANGELOG.md index b52e300e0..73d0f0ab2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ at anytime. ## [Unreleased] ### Added - * + * Add `wallet_list` command * * diff --git a/lbrynet/core/Wallet.py b/lbrynet/core/Wallet.py index edef63c4f..11a30a05f 100644 --- a/lbrynet/core/Wallet.py +++ b/lbrynet/core/Wallet.py @@ -1106,6 +1106,9 @@ class LBRYumWallet(Wallet): def get_pub_keys(self, address): return self._run_cmd_as_defer_succeed('getpubkeys', address) + def list_addresses(self): + return self._run_cmd_as_defer_succeed('listaddresses') + def _save_wallet(self, val): self.wallet.storage.write() return defer.succeed(val) diff --git a/lbrynet/lbrynet_daemon/Daemon.py b/lbrynet/lbrynet_daemon/Daemon.py index 3b5410dcf..e72f2aaed 100644 --- a/lbrynet/lbrynet_daemon/Daemon.py +++ b/lbrynet/lbrynet_daemon/Daemon.py @@ -2067,6 +2067,22 @@ class Daemon(AuthJSONRPCServer): d.addCallback(lambda r: self._render_response(r)) return d + @AuthJSONRPCServer.auth_required + @defer.inlineCallbacks + def jsonrpc_wallet_list(self): + """ + List wallet addresses + + Args: + None + Returns: + List of wallet addresses + """ + + addresses = yield self.session.wallet.list_addresses() + response = yield self._render_response(addresses) + defer.returnValue(response) + @AuthJSONRPCServer.auth_required def jsonrpc_get_new_address(self): """