useCreateWallet hook creates a new wallet for the authenticated user. Call it after signup completes if automatic wallet creation isn’t configured for your app.
Hook for creating a new wallet
useCreateWallet hook creates a new wallet for the authenticated user. Call it after signup completes if automatic wallet creation isn’t configured for your app.
import { useCreateWallet } from "@getpara/react-native-wallet";
import { useCreateWallet } from "@getpara/react-native-wallet";
import { Button } from "react-native";
function CreateWalletButton() {
const { createWalletAsync, isPending } = useCreateWallet();
const handleCreate = async () => {
try {
const [wallet] = await createWalletAsync({ type: "EVM" });
console.log("Created wallet:", wallet.id);
} catch (err) {
console.error(err);
}
};
return <Button title={isPending ? "Creating..." : "Create Wallet"} onPress={handleCreate} disabled={isPending} />;
}