Skip to content

Instantly share code, notes, and snippets.

@xavierlepretre
Created July 19, 2016 11:23
Show Gist options
  • Save xavierlepretre/ee456323b2544dd4da22cd5fa6d2894c to your computer and use it in GitHub Desktop.
Save xavierlepretre/ee456323b2544dd4da22cd5fa6d2894c to your computer and use it in GitHub Desktop.
Get the Promise of an account on Ethereum Mist.
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