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 {
|
|
|
|
address = await channel.invokeMethod(
|
|
|
|
'getUnstoppableDomainAddress',
|
|
|
|
<String, String> {
|
|
|
|
'domain' : domain,
|
|
|
|
'ticker' : ticker
|
|
|
|
}
|
|
|
|
);
|
|
|
|
} catch (e) {
|
|
|
|
print('Unstoppable domain error: ${e.toString()}');
|
|
|
|
address = '';
|
|
|
|
}
|
|
|
|
|
|
|
|
return address;
|
|
|
|
}
|