diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d1b2390c..763dcdc1a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,7 +19,7 @@ at anytime. * ### Fixed - * + * Fix wallet_public_key API command * * diff --git a/docs/index.md b/docs/index.md index bc7d73f05..50a0978a3 100644 --- a/docs/index.md +++ b/docs/index.md @@ -633,8 +633,9 @@ Returns: Get public key from wallet address Args: - 'wallet': (str) wallet address in base58 + 'address': (str) wallet address in base58 Returns: - (str) Public key in hex encoding + (list) list of public keys associated with address. + Could contain more than one public key if multisig. ``` diff --git a/lbrynet/core/Wallet.py b/lbrynet/core/Wallet.py index 0937498f4..edef63c4f 100644 --- a/lbrynet/core/Wallet.py +++ b/lbrynet/core/Wallet.py @@ -1101,8 +1101,10 @@ class LBRYumWallet(Wallet): def _address_is_mine(self, address): return self._run_cmd_as_defer_succeed('ismine', address) - def get_pub_keys(self, wallet): - return self._run_cmd_as_defer_succeed('getpubkyes', wallet) + # returns a list of public keys associated with address + # (could be multiple public keys if a multisig address) + def get_pub_keys(self, address): + return self._run_cmd_as_defer_succeed('getpubkeys', address) def _save_wallet(self, val): self.wallet.storage.write() diff --git a/lbrynet/lbrynet_daemon/Daemon.py b/lbrynet/lbrynet_daemon/Daemon.py index 34d81ea4f..3b5410dcf 100644 --- a/lbrynet/lbrynet_daemon/Daemon.py +++ b/lbrynet/lbrynet_daemon/Daemon.py @@ -2052,18 +2052,20 @@ class Daemon(AuthJSONRPCServer): return self.jsonrpc_wallet_public_key(wallet) @AuthJSONRPCServer.auth_required - def jsonrpc_wallet_public_key(self, wallet): + def jsonrpc_wallet_public_key(self, address): """ Get public key from wallet address Args: - 'wallet': (str) wallet address in base58 + 'address': (str) wallet address in base58 Returns: - (str) Public key in hex encoding + (list) list of public keys associated with address. + Could contain more than one public key if multisig. """ - d = self.session.wallet.get_pub_keys(wallet) + d = self.session.wallet.get_pub_keys(address) d.addCallback(lambda r: self._render_response(r)) + return d @AuthJSONRPCServer.auth_required def jsonrpc_get_new_address(self):