discover method
Detects and validates the custom-unit capability used by Tone/Core API.
Implementation
Future<CustomUnitDiscovery?> discover({BlockNum? atBlock}) async {
if (!await supportsUnit('units', atBlock: atBlock)) return null;
final discovery = CustomUnitDiscovery(
supportedUnits: await supportedUnits(atBlock: atBlock),
preferredUnit: await preferredUnit(atBlock: atBlock),
);
return discovery.isValid ? discovery : null;
}