From 1521a67c0304b70b1f3c8961380b23d09266b02c Mon Sep 17 00:00:00 2001 From: fosse Date: Mon, 25 Sep 2023 09:56:34 -0400 Subject: [PATCH] fixes for other coin types --- lib/entities/ens_record.dart | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lib/entities/ens_record.dart b/lib/entities/ens_record.dart index 4ca2bba6f..59ae6b9a4 100644 --- a/lib/entities/ens_record.dart +++ b/lib/entities/ens_record.dart @@ -20,6 +20,24 @@ class EnsRecord { try { final ens = Ens(client: _client); + dynamic res; + + if (wallet != null) { + switch (wallet.type) { + case WalletType.monero: + return await ens.withName(name).getCoinAddress(CoinType.XMR); + case WalletType.bitcoin: + return await ens.withName(name).getCoinAddress(CoinType.BTC); + case WalletType.litecoin: + return await ens.withName(name).getCoinAddress(CoinType.LTC); + case WalletType.haven: + return await ens.withName(name).getCoinAddress(CoinType.XHV); + case WalletType.ethereum: + default: + return (await ens.withName(name).getAddress()).hex; + } + } + final addr = await ens.withName(name).getAddress(); return addr.hex; } catch (e) {