Created
January 27, 2017 15:57
-
-
Save acastellana/5b203c74ae895778c7bf268521818814 to your computer and use it in GitHub Desktop.
getLastMessagesWithString(address,str,start)
This file contains 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
/* | |
* REQUIRES: | |
* - https://gist.github.com/acastellana/320c2e0fa722d9526e98f021d2e5a3b2 | |
*/ | |
/** | |
* getLastMessagesWithString(address,str,start) Obtains the last Message that contains string after position start | |
* | |
* @param {string} address - NEM Address to explore | |
* @param {string} str - String to find on addresses txs | |
* @param {integer} start - Starting position in the transaction message to search | |
* | |
* @return {promise} - A promise of the NetworkRequests service that returns a string with the filtered message | |
*/ | |
getLastMessagesWithString(address,str,start){ | |
var deferred = this._q.defer(); | |
var promise = deferred.promise; | |
this.getTransactionMessagesWithString(address,str,start).then((result)=>{ | |
deferred.resolve(result[result.length-1]); | |
}); | |
return deferred.promise; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment