Added option to get token by symbol

This commit is contained in:
Richard Ramos 2018-08-13 11:11:42 -04:00
parent 1b261d29f9
commit 26313bf241
1 changed files with 10 additions and 0 deletions

View File

@ -34,6 +34,16 @@ class ContractSettings {
return this.tokens[token];
}
getTokenBySymbol(symbol){
for(let token in this.tokens){
if(this.tokens[token].symbol == symbol){
const tokenObj = this.tokens[token];
tokenObj.address = token;
return tokenObj;
}
}
}
getContractByTopic(topicName){
return this.contracts[topicName];
}