isAssetId static method
Returns bool representing if the provided address is an asset id. Returns false if there's not enough information to determine that.
Implementation
static Future<bool> isAssetId(
{required String network, required FuelAddress address}) async {
final fuelExplorerApi = _getFuelExplorerApiUrl(network);
if (fuelExplorerApi == null) {
return false;
}
try {
final response = await _dio
.get('$fuelExplorerApi/assets/${address.b256Address.toLowerCase()}');
final asset = response.data as Map<String, dynamic>;
return asset['assetId'] != null;
} catch (e) {
return false;
}
}