The useParaStellarSigner hook returns a Stellar signer for the user’s Stellar wallet.
If the user has multiple Stellar wallets, pass address or walletId to select one. When omitted, the active wallet is used automatically.
Requires @getpara/stellar-sdk-v14-integration and @stellar/stellar-sdk as peer dependencies.
Import
import { useParaStellarSigner } from "@getpara/react-sdk";
Usage
import { useParaStellarSigner } from "@getpara/react-sdk";
import { Networks } from "@stellar/stellar-sdk";
function SignAuthEntry() {
const { stellarSigner, isLoading } = useParaStellarSigner({
networkPassphrase: Networks.TESTNET,
});
const handleSign = async () => {
if (!stellarSigner) return;
const result = await stellarSigner.signAuthEntry("base64EncodedEntry");
console.log("Signed:", result.signedAuthEntry);
};
if (isLoading) return <p>Loading...</p>;
return (
<div>
<p>Address: {stellarSigner?.address}</p>
<button onClick={handleSign}>Sign Auth Entry</button>
</div>
);
}