2021-04-20 20:49:53 +03:00
|
|
|
import 'package:flutter/services.dart';
|
|
|
|
|
2021-07-07 16:50:55 +03:00
|
|
|
const channel = MethodChannel('com.cake_wallet/native_utils');
|
2021-04-20 20:49:53 +03:00
|
|
|
|
|
|
|
Future<String> fetchUnstoppableDomainAddress(String domain, String ticker) async {
|
2021-07-07 16:50:55 +03:00
|
|
|
var address = '';
|
2021-04-20 20:49:53 +03:00
|
|
|
|
|
|
|
try {
|
2022-10-12 13:09:57 -04:00
|
|
|
address = await channel.invokeMethod<String>(
|
2021-04-20 20:49:53 +03:00
|
|
|
'getUnstoppableDomainAddress',
|
|
|
|
<String, String> {
|
|
|
|
'domain' : domain,
|
|
|
|
'ticker' : ticker
|
|
|
|
}
|
2022-10-12 13:09:57 -04:00
|
|
|
) ?? '';
|
2021-04-20 20:49:53 +03:00
|
|
|
} catch (e) {
|
|
|
|
print('Unstoppable domain error: ${e.toString()}');
|
|
|
|
address = '';
|
|
|
|
}
|
|
|
|
|
|
|
|
return address;
|
|
|
|
}
|