Skip to main content
The useCreateWalletPerType hook creates wallets for multiple chain types in a single call, returning each wallet along with its ID.

Import

import { useCreateWalletPerType } from "@getpara/react-native-wallet";

Usage

import { useCreateWalletPerType } from "@getpara/react-native-wallet";
import { Button } from "react-native";

function CreateWalletsButton() {
  const { createWalletPerTypeAsync, isPending } = useCreateWalletPerType();

  const handleCreate = async () => {
    try {
      const result = await createWalletPerTypeAsync({ types: ["EVM", "COSMOS"] });
      console.log("Created wallets:", result.wallets.map((w) => w.id));
    } catch (err) {
      console.error(err);
    }
  };

  return <Button title={isPending ? "Creating..." : "Create Wallets"} onPress={handleCreate} disabled={isPending} />;
}