useCreateWalletPerType hook creates wallets for multiple chain types in a single call, returning each wallet along with its ID.
Hook for creating wallets for multiple chain types at once
useCreateWalletPerType hook creates wallets for multiple chain types in a single call, returning each wallet along with its ID.
import { useCreateWalletPerType } from "@getpara/react-native-wallet";
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} />;
}