ens working

This commit is contained in:
fosse 2023-09-21 10:16:27 -04:00
parent d8d2335a5f
commit a52c7b053e
33 changed files with 133 additions and 63 deletions

View file

@ -211,9 +211,9 @@ I/flutter ( 4474): Gas Used: 53000
}
}
Future<String?> checkEnsName(String ensName) async {
Future<String> checkEnsName(String ensName) async {
if (_client == null) {
return null;
return "";
}
try {
final ens = Ens(client: _client!);
@ -222,7 +222,7 @@ I/flutter ( 4474): Gas Used: 53000
return addr.hex;
} catch (e) {
print(e);
return null;
return "";
}
}

View file

@ -508,4 +508,8 @@ abstract class EthereumWalletBase
@override
String signMessage(String message, {String? address = null}) =>
bytesToHex(_ethPrivateKey.signPersonalMessageToUint8List(ascii.encode(message)));
Future<String> fetchEnsAddress(String name) async {
return await _client.checkEnsName(name);
}
}