Created
July 19, 2016 11:23
-
-
Save xavierlepretre/ee456323b2544dd4da22cd5fa6d2894c to your computer and use it in GitHub Desktop.
Get the Promise of an account on Ethereum Mist.
This file contains hidden or 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
if (typeof(mist) !== "undefined") { | |
mist.requestAccountPromise = function () { | |
return new Promise (function (resolve, reject) { | |
mist.requestAccount(function(e, account) { | |
if(e != null) { | |
reject(e); | |
} else { | |
resolve(account); | |
} | |
}); | |
}); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment