diff --git a/WatchConnectivity.ios.js b/WatchConnectivity.ios.js index b603dcf7c..142d25083 100644 --- a/WatchConnectivity.ios.js +++ b/WatchConnectivity.ios.js @@ -126,24 +126,22 @@ function WatchConnectivity() { for (const wallet of wallets) { let receiveAddress; - if (wallet.getAddressAsync) { - if (wallet.chain === Chain.ONCHAIN) { - try { - receiveAddress = await wallet.getAddressAsync(); - } catch (_) {} - if (!receiveAddress) { - // either sleep expired or getAddressAsync threw an exception - receiveAddress = wallet._getExternalAddressByIndex(wallet.next_free_address_index); - } - } else if (wallet.chain === Chain.OFFCHAIN) { - try { - await wallet.getAddressAsync(); - receiveAddress = wallet.getAddress(); - } catch (_) {} - if (!receiveAddress) { - // either sleep expired or getAddressAsync threw an exception - receiveAddress = wallet.getAddress(); - } + if (wallet.chain === Chain.ONCHAIN) { + try { + receiveAddress = await wallet.getAddressAsync(); + } catch (_) {} + if (!receiveAddress) { + // either sleep expired or getAddressAsync threw an exception + receiveAddress = wallet._getExternalAddressByIndex(wallet.next_free_address_index); + } + } else if (wallet.chain === Chain.OFFCHAIN) { + try { + await wallet.getAddressAsync(); + receiveAddress = wallet.getAddress(); + } catch (_) {} + if (!receiveAddress) { + // either sleep expired or getAddressAsync threw an exception + receiveAddress = wallet.getAddress(); } } const transactions = wallet.getTransactions(10); diff --git a/screen/receive/details.js b/screen/receive/details.js index c6d2c3594..1550cc372 100644 --- a/screen/receive/details.js +++ b/screen/receive/details.js @@ -216,7 +216,7 @@ const ReceiveDetails = () => { setAddressBIP21Encoded(address); await Notifications.tryToObtainPermissions(); Notifications.majorTomToGroundControl([address], [], []); - } else if (wallet.getAddressAsync) { + } else { if (wallet.chain === Chain.ONCHAIN) { try { newAddress = await Promise.race([wallet.getAddressAsync(), sleep(1000)]); @@ -244,10 +244,6 @@ const ReceiveDetails = () => { setAddressBIP21Encoded(newAddress); await Notifications.tryToObtainPermissions(); Notifications.majorTomToGroundControl([newAddress], [], []); - } else if (wallet.getAddress) { - setAddressBIP21Encoded(wallet.getAddress()); - await Notifications.tryToObtainPermissions(); - Notifications.majorTomToGroundControl([wallet.getAddress()], [], []); } // eslint-disable-next-line react-hooks/exhaustive-deps }, []); diff --git a/screen/wallets/aopp.js b/screen/wallets/aopp.js index b3ec1878a..d1c687fcc 100644 --- a/screen/wallets/aopp.js +++ b/screen/wallets/aopp.js @@ -37,7 +37,7 @@ const AOPP = () => { const wallet = await selectWallet(navigation.navigate, name, false, availableWallets, 'Onchain wallet is required to sign a message'); if (!wallet) return navigation.pop(); - const address = wallet.getAddressAsync ? await wallet.getAddressAsync() : wallet.getAddress(); + const address = await wallet.getAddressAsync(); navigation.navigate('SignVerify', { walletID: wallet.getID(), address,