PsychicCat / monero-nodejs

Monero wallet management via JSON-RPC
MIT License
116 stars 61 forks source link

[question] Why is wallet.height() asynchronous? #3

Closed yeeplusplus closed 8 years ago

yeeplusplus commented 8 years ago

Why is wallet.height() asynchronous, but the rest of the API functions are synchronous?

Is the underlying daemon function asynchronous?

PsychicCat commented 8 years ago

Whoops, looks like I need to update the documentation there. All of the API functions are asynchronous, they return a promise which needs to be resolved with a .then()

For example to use wallet.height():

wallet.height().then(function(response){
// do something with the response object in here
});