Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public async getFeatures(cached: boolean = false): Promise {
if (cached && this.featuresCache)
return this.featuresCache
const features = new Messages.GetFeatures();
const event = await this.transport.call(
Messages.MessageType.MESSAGETYPE_GETFEATURES,
features
) as Event
if(event.message_type === Events.FAILURE) throw event
this.cacheFeatures(event.message)
return event.message as Messages.Features.AsObject
}