Last active
February 18, 2018 09:27
-
-
Save epexa/20f4775eb1a67d52e6fbf96e5b06f0d3 to your computer and use it in GitHub Desktop.
golos_check_of_private_key_is_correct
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var usernamesArr = ['epexa']; | |
golos.api.getAccounts(usernamesArr, function(err, response) { | |
if ( ! err) { | |
var privWif = '5J...'; // private key | |
var resultWifToPublic = golos.auth.wifToPublic(privWif); | |
// example check of private posting key | |
if (response[0].posting.key_auths[0][0] == resultWifToPublic) console.log('yes, is it private posting key!'); | |
else console.log('no, is it not private posting key!'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment