useWallet hook provides access to the currently selected wallet’s information. Use useClient alongside it to derive display addresses.
Hook for retrieving the currently selected wallet
useWallet hook provides access to the currently selected wallet’s information. Use useClient alongside it to derive display addresses.
import { useWallet } from "@getpara/react-native-wallet";
import { useWallet, useClient } from "@getpara/react-native-wallet";
import { View, Text } from "react-native";
function WalletInfo() {
const { data: wallet } = useWallet();
const client = useClient();
if (!wallet) return <Text>No wallet</Text>;
const address = client?.getDisplayAddress(wallet.id, { addressType: "EVM" });
return (
<View>
<Text>Wallet ID: {wallet.id}</Text>
<Text>Address: {address}</Text>
</View>
);
}