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