You’re viewing the 2.0 (LTS) docs. View the current 3.0 version of this page.
useCreatePregenWalletPerType hook creates pregenerated wallets for multiple chain types for a user who hasn’t signed up yet.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Hook for creating pregenerated wallets for multiple chain types
useCreatePregenWalletPerType hook creates pregenerated wallets for multiple chain types for a user who hasn’t signed up yet.
import { useCreatePregenWalletPerType } from "@getpara/react-native-wallet";
import { useCreatePregenWalletPerType } from "@getpara/react-native-wallet";
function PregenWalletsCreator({ userEmail }: { userEmail: string }) {
const { createPregenWalletPerTypeAsync, isPending } = useCreatePregenWalletPerType();
const handleCreate = async () => {
try {
const wallets = await createPregenWalletPerTypeAsync({
types: ["EVM", "COSMOS"],
pregenId: { email: userEmail },
});
console.log("Created wallets:", wallets.map((w) => w.id));
} catch (err) {
console.error(err);
}
};
return <Button title={isPending ? "Creating..." : "Create Pregen Wallets"} onPress={handleCreate} disabled={isPending} />;
}