useLoginExternalWallet hook initiates the Sign-In With Ethereum (SIWE) flow for an external wallet. After calling it, use useVerifyExternalWallet to complete verification.
Hook for initiating login with an external wallet via SIWE
useLoginExternalWallet hook initiates the Sign-In With Ethereum (SIWE) flow for an external wallet. After calling it, use useVerifyExternalWallet to complete verification.
import { useLoginExternalWallet } from "@getpara/react-native-wallet";
import { useLoginExternalWallet } from "@getpara/react-native-wallet";
function ExternalWalletLogin({ walletInfo }) {
const { loginExternalWalletAsync, isPending } = useLoginExternalWallet();
const handleLogin = async () => {
try {
const result = await loginExternalWalletAsync({ externalWallet: walletInfo });
// Proceed to useVerifyExternalWallet with the result
} catch (err) {
console.error(err);
}
};
return <Button title={isPending ? "Connecting..." : "Connect Wallet"} onPress={handleLogin} disabled={isPending} />;
}