Added option to get token by symbol
This commit is contained in:
parent
1b261d29f9
commit
26313bf241
|
@ -34,6 +34,16 @@ class ContractSettings {
|
||||||
return this.tokens[token];
|
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){
|
getContractByTopic(topicName){
|
||||||
return this.contracts[topicName];
|
return this.contracts[topicName];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue