Created
July 19, 2016 11:22
-
-
Save xavierlepretre/ed82f210df0f9300493d5ca79893806a to your computer and use it in GitHub Desktop.
Get the Promise of Web3 accounts
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
web3.eth.getAccountsPromise = function () { | |
return new Promise(function (resolve, reject) { | |
web3.eth.getAccounts(function (e, accounts) { | |
if (e != null) { | |
reject(e); | |
} else { | |
resolve(accounts); | |
} | |
}); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment