Skip to main content

Integration Methods

  • React Hook
  • Core Method
The useExportPrivateKey hook will automatically open a popup window where your user can reauthenticate their session and then view and copy the private key for one of their connected wallets.
The hook can only be used from within your app’s ParaProvider context. By default, the key exported will be that for the currently selected wallet, available from the useWallet or useWalletState hooks.
import { useExportPrivateKey, useWallet} from "@getpara/react-sdk";

export function App() {
  const { data: activeWallet } = useWallet();
  const { mutate: exportPrivateKey, isPending } = useExportPrivateKey();

  return (
    <Button
      disabled={isPending}
      onClick={() => {
        exportPrivateKey({
          walletId: activeWallet?.id, // Optional
        });
      }}
    >
      Export Private Key
    </Button>
  );
}

Limitations

Currently, private key export is only available for embedded EVM or Cosmos wallets which are not pregenerated or guest mode wallets.
The key exported will work as either an EVM or Cosmos private key, depending on what wallet it is imported into.
I