Skip to content

Instantly share code, notes, and snippets.

@epexa
Last active February 18, 2018 09:27
Show Gist options
  • Save epexa/20f4775eb1a67d52e6fbf96e5b06f0d3 to your computer and use it in GitHub Desktop.
Save epexa/20f4775eb1a67d52e6fbf96e5b06f0d3 to your computer and use it in GitHub Desktop.
golos_check_of_private_key_is_correct
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