Add privToPub and pubToAddr commands

This commit is contained in:
Ivanq 2019-05-01 07:42:56 +03:00
parent f318f76994
commit 4eaeade618

View file

@ -124,6 +124,15 @@ class UiWebsocketPlugin(object):
def actionEcdsaVerify(self, to, data, address, signature):
self.response(to, CryptBitcoin.verify(data, address, signature))
# Gets the publickey of a given privatekey
def actionPrivToPub(self, to, privatekey):
self.response(to, btctools.privtopub(privatekey))
# Gets the address of a given publickey
def actionPubToAddr(self, to, publickey):
address = btctools.pubtoaddr(btctools.decode_pubkey(publickey))
self.response(to, address)
@PluginManager.registerTo("User")
class UserPlugin(object):