Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function getEventTag(eventName) {
if (typeof (eventName) === "string") {
eventName = eventName.toLowerCase();
if (hexDataLength(eventName) === 32) {
return "tx:" + eventName;
}
if (eventName.indexOf(":") === -1) {
return eventName;
}
}
else if (Array.isArray(eventName)) {
return "filter:*:" + serializeTopics(eventName);
}
else if (ForkEvent.isForkEvent(eventName)) {
logger.warn("not implemented");
throw new Error("not implemented");
}
else if (eventName && typeof (eventName) === "object") {
return "filter:" + (eventName.address || "*") + ":" + serializeTopics(eventName.topics || []);
}
throw new Error("invalid event - " + eventName);
}
//////////////////////////////